Created attachment 252822 [details] Makefile.patch When using FLAVOR=lite for devel/llvm15 package devel/libclc fails to check dependencies and tries to install llvm15 again: root@desktop:/usr/ports/devel/libclc# pkg info | grep llvm15-lite llvm15-lite-15.0.7_10 LLVM and Clang root@desktop:/usr/ports/devel/libclc# make ===> License LLVM accepted by the user ===> libclc-15.0.4 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by libclc-15.0.4 for building ===> Extracting for libclc-15.0.4 => SHA256 Checksum OK for libclc-15.0.4.src.tar.xz. ===> Patching for libclc-15.0.4 ===> Applying FreeBSD patches for libclc-15.0.4 from /usr/ports/devel/libclc/files ===> libclc-15.0.4 depends on package: llvm15>=15.0 - not found ===> License BSD3CLAUSE LLVM MIT PD REGEX LLVM2 accepted by the user ===> llvm15-lite-15.0.7_10 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by llvm15-lite-15.0.7_10 for building ===> Extracting for llvm15-lite-15.0.7_10 When BUILD_DEPENDS changed as described in a patch package builds successfully.
Maybe www/chromium style should be used: LLVM_DEFAULT= 15 BUILD_DEPENDS+= clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT}
Could this work: USES+=llvm:15 ?
Created attachment 252960 [details] Fix build dependency and honor LLVM_DEFAULT I think this patch should do.
BTW, lang/clover has LLVM:max=16 but I think it should be removed. I haven't tried devel/llvm17 but it worked fine for me with devel/llvm18. I will create a new PR if 17 and 19 work.
(In reply to Jung-uk Kim from comment #4) Sorry, I missed Bug 280943. I will update the PR if 17 and 19 work.
(In reply to Jung-uk Kim from comment #3) I think it should yes, can someone test this for me ? (My build box is busy currently).
Note that I'm working on a flavored version of libclc which should be better. Hoping to finish today.
Created attachment 253004 [details] Flavorize devel/libclc
Currently testing my patch.
(In reply to Emmanuel Vadot from comment #8) > BUILD_DEPENDS= llvm${FLAVOR:S/llvm//}>=0:devel/${FLAVOR} \ Why not: > USES= llvm:${FLAVOR:S/llvm//},build,noexport or without "noexport"?
*** Bug 280997 has been marked as a duplicate of this bug. ***
Created attachment 253017 [details] Flavorize devel/libclc
(In reply to Vladimir Druzenko from comment #10) Done
(In reply to Emmanuel Vadot from comment #7) Please feel free to update Bug 280957 while you are at it. :-)
(In reply to Jung-uk Kim from comment #14) I can address this at the same time, just give me some time to at least compile clover with different libclc/llvm :)
So for some reason my patch doesn't work, it keeps finding (and using) the wrong llvm -- The CXX compiler identification is Clang 18.1.8 -- The C compiler identification is Clang 18.1.8 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/local/llvm18/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/local/llvm18/bin/clang - skipped -- Detecting C compile features -- Detecting C compile features - done -- Found ZLIB: /usr/lib/libz.so (found version "1.3.1") -- Found zstd: /usr/local/lib/libzstd.so -- Linker detection: LLD LLVM version: 17.0.6 clang: /usr/local/llvm17/bin/clang llvm-as: /usr/local/llvm17/bin/llvm-as llvm-link: /usr/local/llvm17/bin/llvm-link opt: /usr/local/llvm17/bin/opt llvm-spirv: /usr/local/llvm17/bin/llvm-spirv I'll have another look at it tomorrow.
(In reply to Emmanuel Vadot from comment #16) Try CMAKE_ARGS+= -DLLVM_CONFIG="${LLVM_CONFIG}" as I did in my patch.
(In reply to Emmanuel Vadot from comment #16) It's bug in upstream - install for example llvm14 together with llvm17 and it'll "find" llvm14. "CMAKE_ARGS+=-DLLVM_CONFIG=${LLVM_CONFIG}" doesn't help.
Comment on attachment 253017 [details] Flavorize devel/libclc > CONFLICTS+= libclc-${flavor} Flavors can be co-installable if installed under LLVM_DIR (aka ${LOCALBASE}/llvm*) like spirv-llvm-translator. libclc is part of LLVM upstream, so have a "blessed version" doesn't make sense and may become a problem if libclc grows more consumers. Note, LLVM_CONFIG can be replaced with LLVM_DIR which prevents CMake from looking elsewhere.
(In reply to Jung-uk Kim from comment #17) That dooesn't change things for some version of llvm. llvm15 flavor and llvm17 flavors works as expected, but llvm16 and llvm18 fallbacks to llvm17, I guess there is a problem with those for libclc, just need to find what.
(In reply to Jan Beich from comment #19) Yeah I'll work on this after finding why some llvm version makes libclc not happy.
Created attachment 253034 [details] Flavorize devel/libclc Flavors are now installable in // Works fine in a clean env (i.e. poudriere) for the llvm problem but doesn't in a non-clean env (i.e. make from ports dir with all llvm installed).
Created attachment 253104 [details] Flavorize devel/libclc Problem fixed by specifing CMAKE_PREFIX_PATH.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=c01e7d09ade35c40645935cbeef38cf28cb487d1 commit c01e7d09ade35c40645935cbeef38cf28cb487d1 Author: Emmanuel Vadot <manu@FreeBSD.org> AuthorDate: 2024-08-22 09:05:56 +0000 Commit: Emmanuel Vadot <manu@FreeBSD.org> CommitDate: 2024-08-27 16:29:44 +0000 devel/libclc: Flavorize the port Defines some flavors for llvm15 to llvm18 for libclc. This will allow users to use a different LLVM_DEFAULT without having to rely on the default one (llvm15 for now). PR: 280863 Sponsored by: Beckhoff Automation GmbH & Co. KG devel/libclc/Makefile | 30 +- devel/libclc/distinfo (gone) | 3 - devel/libclc/distinfo.llvm15 (new) | 3 + devel/libclc/distinfo.llvm16 (new) | 3 + devel/libclc/distinfo.llvm17 (new) | 3 + devel/libclc/distinfo.llvm18 (new) | 3 + devel/libclc/pkg-plist | 744 ++++++++++++++++++++----------------- graphics/mesa-devel/Makefile | 4 +- graphics/mesa-dri/Makefile | 5 +- lang/clover/Makefile | 4 +- 10 files changed, 444 insertions(+), 358 deletions(-)