LLVM-14.0.0 with OpenMP offloading Installation Issue, sm_75 architechture

Hello all,

I am a beginner in this domain and I am facing an error when I build LLVM/Clang with OpenMP Offloading to NVIDIA GPUs for llvm version-14.0.0. Please find the installation steps I followed and the error below.

$ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/llvm-14.0.0.src.tar.xz

$ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang-14.0.0.src.tar.xz

$ wget https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/openmp-14.0.0.src.tar.xz

$ tar xf llvm-14.0.0.src.tar.xz

$ tar xf clang-14.0.0.src.tar.xz

$ tar xf openmp-14.0.0.src.tar.xz

$ mv clang-14.0.0.src llvm-14.0.0.src/tools/clang

$ mv openmp-14.0.0.src llvm-14.0.0.src/projects/openmp

//build folder


$ make -j8

$ make -j8 install

//after executing above clang is installed in $(pwd)/…/install/bin/clang

//Inside build-openmp folder. Using the above installed clang I tried to rebuild openmp

$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/…/install-14 -DCMAKE_C_COMPILER=$(pwd)/…/install-14/bin/clang -DCMAKE_CXX_COMPILER=$(pwd)/…/install-14/bin/clang++ -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=35,60,75 …/llvm-14.0.0.src/projects/openmp

$ make -j8

[ 9%] Building LLVM bitcode Reduction.cpp-gfx700.bc

/home/user/cost-model/llvm-14.0.0.src/projects/openmp/libomptarget/DeviceRTL/src/Mapping.cpp28:2832::: /home/user/cost-model/llvm-14.0.0.src/projects/openmp/libomptarget/DeviceRTL/src/Mapping.cpp28::32 error: error: :28:no type named ‘GV’ in namespace 'llvm::omp’error: no type named ‘GV’ in namespace ‘llvm::omp’

no type named ‘GV’ in namespace 'llvm::omp’error: /home/user/cost-model/llvm-14.0.0.src/projects/openmp/libomptarget/DeviceRTL/src/Mapping.cpp

I tried this multiple times, but I get the same error every time. Please help to solve the above issue or let me know if there is any issue in the steps followed. The above steps worked perfectly fine for previous versions of llvm/openmp.

Thank you!

1 Like

Might be the individual tarballs are from different repository revisions, but I don’t know how this could happen. Try the source directly from the repository for the LLVM 14 release.

git clone git@github.com:llvm/llvm-project.git
cd llvm-project
git checkout release/14.x

Or download it from as zip archive: https://github.com/llvm/llvm-project/archive/refs/heads/release/14.x.zip

Instead of a standalone build of OpenMP (the second cmake …/llvm-14.0.0.src/projects/openmp), you could also try doing it by the build system itself with cmake -DLLVM_ENABLE_RUNTIMES=openmp ... added to the first cmake line.