Overview

Request 1224306 superseded

Initial packaging of AdaptiveCpp.

Adaptivecpp is an open implementation of SYCL for CPUs and GPUs

Loading...

Martin Pluskal's avatar

Please do not use group, this tag is obsolete


Eyad Issa's avatar

Sure, I'll remove it


Aaron Puchert's avatar

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?


Eyad Issa's avatar
author source maintainer target maintainer

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


Aaron Puchert's avatar

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.


Eyad Issa's avatar
author source maintainer target maintainer

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???


Aaron Puchert's avatar

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.


Aaron Puchert's avatar

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 dlopened into a running process that already has all the dependencies. Modules don't get an SO name.


Eyad Issa's avatar
author source maintainer target maintainer

Yup, it now builds and links correctly. Thank you for the patch and for the guidance!


Martin Pluskal's avatar

A bit of nitpicking - you should explicitly mention patch in changelog even when creating new package


Eyad Issa's avatar
author source maintainer target maintainer

Sure, will do

Request History
Eyad Issa's avatar

VaiTon created request

Initial packaging of AdaptiveCpp.

Adaptivecpp is an open implementation of SYCL for CPUs and GPUs


Eyad Issa's avatar

VaiTon superseded request

superseded by 1224524

openSUSE Build Service is sponsored by