Overview
Request 1224306 superseded
Initial packaging of AdaptiveCpp.
Adaptivecpp is an open implementation of SYCL for CPUs and GPUs
- Created by VaiTon
- In state superseded
- Package maintainer: VaiTon
- Supersedes 1224050
- Superseded by 1224524
Please do not use group, this tag is obsolete
What's the reason for clearing the linker flags?
I assume you're building against LLVM 18 because LLVM 19 doesn't have openmp
at the moment, or is not yet supported?
Support for LLVM 19 was merged in August, i.e. after 24.06 was released.
https://github.com/AdaptiveCpp/AdaptiveCpp/issues/1576
About the linker flags, if I don't clear them I get a lot of errors with ld not being able to link to some clang functions. I spent ~1 week understanding that the %cmake macro sets some linker flags by itself xD
It could be that -Wl,--no-undefined
is causing the errors, but this would indicate issues.
Could you try out which build flag is causing the issues and then post a snippet of the error message? You should definitely not just clear all of them.
A snippet of the error:
[ 118s] /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: /tmp/ccLgN66D.ltrans8.ltrans.o:/usr/include/clang/AST/StmtIterator.h:99:(.text+0xb727): undefined reference to `clang::StmtIteratorBase::NextDecl(bool)'
[ 118s] /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: /tmp/ccLgN66D.ltrans8.ltrans.o:/usr/include/clang/AST/StmtIterator.h:99:(.text+0xb755): undefined reference to `clang::StmtIteratorBase::NextDecl(bool)'
[ 118s] /usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: /tmp/ccLgN66D.ltrans8.ltrans.o:/usr/include/clang/AST/StmtIterator.h:99:(.text+0xb771): undefined reference to `clang::StmtIteratorBase::NextDecl(bool)'
Yeah, it may be the --no-undefined, but I already installed it on my system and it works???
That looks like --no-undefined
. It should link with -lclang-cpp
. It might still work at runtime (sometimes) because the library is loaded by someone else, but it's still a good habit to link with all required libraries directly.
Unless this is a plug-in/module that's not properly declared as such in CMake. I guess I'll need to check this out myself.
It looks like a module. Try this patch:
diff --git a/src/compiler/CMakeLists.txt b/src/compiler/CMakeLists.txt index 96eb97f..faa7c50 100644 --- a/src/compiler/CMakeLists.txt +++ b/src/compiler/CMakeLists.txt @@ -75,7 +75,7 @@ else() set(REFLECTION_BUILTINS "") endif() -add_library(acpp-clang SHARED +add_library(acpp-clang MODULE AdaptiveCppClangPlugin.cpp GlobalsPruningPass.cpp ${SSCP_COMPILER}
Basically the difference is that a SHARED
library can be used on the linker command line, while a MODULE
is supposed to be dlopen
ed into a running process that already has all the dependencies. Modules don't get an SO name.
Yup, it now builds and links correctly. Thank you for the patch and for the guidance!
A bit of nitpicking - you should explicitly mention patch in changelog even when creating new package
Request History
VaiTon created request
Initial packaging of AdaptiveCpp.
Adaptivecpp is an open implementation of SYCL for CPUs and GPUs
superseded by 1224524