KESTENER Pierre via llvm-dev
2021-Apr-29 13:04 UTC
[llvm-dev] building with openmp target nvptx with llvm 12 versus 11
Hello, I have succesfully built and used clang with OpenMP offload target for Nivida architecture (sm_80) using llvm-11.0.1 release sources. However, using release 12.0.0, I have a strange compile error. Here is how I configure the openmp support with cmake: ccmake -DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_80 -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=80 -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;libcxx;libcxxabi;lld;openmp" -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/opt/local/llvm-12-omptarget -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../openmp here clang and clang++ are actually clang-12 and clang++-12 (built previously, I crossed check that I was able to compile cuda code, it is ok). The compile error in building openmp support is [ 24%] Building LLVM bitcode target_impl.cu-cuda_112-sm_80.bc cd /home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/build-openmp/libomptarget/deviceRTLs/nvptx && /opt/local/llvm-12-omptarget/bin/clang -S -x c++ -O1 -std=c++14 -target nvptx64 -Xclang -emit-llvm-bc -Xclang -aux-triple -Xclang x86_64-unknown-linux-gnu -fopenmp -fopenmp-cuda-mode -Xclang -fopenmp-is-device -D__CUDACC__ -I/home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/openmp/libomptarget/deviceRTLs -I/home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/openmp/libomptarget/deviceRTLs/nvptx/src -DOMPTARGET_NVPTX_DEBUG=0 -Xclang -target-cpu -Xclang sm_80 -D__CUDA_ARCH__=800 -Xclang -target-feature -Xclang +ptx70 -DCUDA_VERSION=11200 /home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu -o target_impl.cu-cuda_112-sm_80.bc In file included from /home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu:14: In file included from /home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h:15: In file included from /usr/include/assert.h:35: /usr/include/features.h:461:12: fatal error: 'sys/cdefs.h' file not found # include <sys/cdefs.h> ^~~~~~~~~~~~~ I don't know why this header is not found, it is actually present in my system (Ubuntu 20.04) Did I miss something here ? It was building fine with llvm-11.0.1. Thanks for your help. Pierre
Johannes Doerfert via llvm-dev
2021-Apr-30 15:27 UTC
[llvm-dev] building with openmp target nvptx with llvm 12 versus 11
This was an oversight and we'll make sure the runtime will be freestanding in the future. That said, Ye Luo fixed this by installing gcc-multilib, maybe that helps you too. If not, we'll have to come up with a hotfix. ~ Johannes On 4/29/21 8:04 AM, KESTENER Pierre via llvm-dev wrote:> Hello, > > I have succesfully built and used clang with OpenMP offload target for Nivida architecture (sm_80) using llvm-11.0.1 release sources. > > However, using release 12.0.0, I have a strange compile error. > > Here is how I configure the openmp support with cmake: > ccmake -DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_80 -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=80 -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;libcxx;libcxxabi;lld;openmp" -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/opt/local/llvm-12-omptarget -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../openmp > > here clang and clang++ are actually clang-12 and clang++-12 (built previously, I crossed check that I was able to compile cuda code, it is ok). > > The compile error in building openmp support is > > [ 24%] Building LLVM bitcode target_impl.cu-cuda_112-sm_80.bc > cd /home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/build-openmp/libomptarget/deviceRTLs/nvptx && /opt/local/llvm-12-omptarget/bin/clang -S -x c++ -O1 -std=c++14 -target nvptx64 -Xclang -emit-llvm-bc -Xclang -aux-triple -Xclang x86_64-unknown-linux-gnu -fopenmp -fopenmp-cuda-mode -Xclang -fopenmp-is-device -D__CUDACC__ -I/home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/openmp/libomptarget/deviceRTLs -I/home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/openmp/libomptarget/deviceRTLs/nvptx/src -DOMPTARGET_NVPTX_DEBUG=0 -Xclang -target-cpu -Xclang sm_80 -D__CUDA_ARCH__=800 -Xclang -target-feature -Xclang +ptx70 -DCUDA_VERSION=11200 /home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu -o target_impl.cu-cuda_112-sm_80.bc > In file included from /home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu:14: > In file included from /home/kestener/install/llvm/llvm-project-llvmorg-12.0.0/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h:15: > In file included from /usr/include/assert.h:35: > /usr/include/features.h:461:12: fatal error: 'sys/cdefs.h' file not found > # include <sys/cdefs.h> > ^~~~~~~~~~~~~ > > I don't know why this header is not found, it is actually present in my system (Ubuntu 20.04) > > Did I miss something here ? It was building fine with llvm-11.0.1. > > Thanks for your help. > > Pierre > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev