Skip to content

add openmp and libc++ to clang #9478

@VinInn

Description

@VinInn

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions