cms-sw / cmsdist

CMS Offline Software build configuration
Other
27 stars 183 forks source link

add openmp and libc++ to clang #9478

Open VinInn opened 1 month ago

VinInn commented 1 month ago

In my clang installation I used this

cmake -S llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt;openmp" -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" -DCMAKE_INSTALL_PREFIX=/afs/cern.ch/user/i/innocent/w5/
ninja -j 8 -k 1024 -C build
ninja install -C build

and managed to use openmp and libc++

clang++ test.cc -o sample -fopenmp -stdlib=libstd++ -v
clang++ test.cc -o sample -fopenmp -stdlib=libc++ -v

even compiling for gpu target...

clang++ --offload-arch=native -xhip testGPU.cc -o sample -fopenmp -v -stdlib=libc++ -std=c++20 > & /dev/null ; ./sample
clang++ --offload-arch=native -xhip testGPU.cc -o sample -fopenmp -v -stdlib=libstdc++ -std=c++20 > & /dev/null ; ./sample

the latter uses the "system" gcc (well the one I used to build clang) not a random local one as hip does...

it could be useful to have it in cmsdist if anybody else is interested

cmsbuild commented 1 month ago

cms-bot internal usage

cmsbuild commented 1 month ago

A new Issue was created by @VinInn.

@Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here