-
Notifications
You must be signed in to change notification settings - Fork 15k
Closed
Labels
build-problemcmakeBuild system in general and CMake in particularBuild system in general and CMake in particularopenmpquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
When trying to build openmp I'm getting the following error:
[ 42%] Building CXX object libomptarget/plugins/cuda/CMakeFiles/omptarget.rtl.cuda.dir/src/rtl.cpp.o
/gpfs/projects/ChapmanGroup/alok/git/llvm-project-build/openmp/libomptarget/plugins/cuda/src/rtl.cpp:262:18: error: no member named 'make_unique' in namespace 'std'
Ptr = std::make_unique<std::atomic_uint>(0);
~~~~~^
/gpfs/projects/ChapmanGroup/alok/git/llvm-project-build/openmp/libomptarget/plugins/cuda/src/rtl.cpp:262:46: error: expected '(' for function-style cast or type construction
Ptr = std::make_unique<std::atomic_uint>(0);
~~~~~~~~~~~~~~~~^
2 errors generated.
make[2]: *** [libomptarget/plugins/cuda/CMakeFiles/omptarget.rtl.cuda.dir/src/rtl.cpp.o] Error 1
make[1]: *** [libomptarget/plugins/cuda/CMakeFiles/omptarget.rtl.cuda.dir/all] Error 2
make: *** [all] Error 2
I never faced this issue till a couple of weeks back.
I always build my llvm with clang first and then use the clang to build openmp with offloading support.
To build llvm/clang:
cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release -DCLANG_BUILD_EXAMPLES=1 -DCMAKE_INSTALL_PREFIX=$LLVM_PATH -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLLVM_TARGETS_TO_BUILD="X86;NVPTX" $LLVM_SRC/llvm
make -j16
make install
To build openmp:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$LLVM_PATH -DCMAKE_C_COMPILER=$LLVM_PATH/bin/clang -DCMAKE_CXX_COMPILER=$LLVM_PATH/bin/clang++ -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=35,60,70 $LLVM_SRC/openmp
make -j16
make install
My gcc version is 6.5.0
$ gcc --version
gcc (GCC) 6.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Metadata
Metadata
Assignees
Labels
build-problemcmakeBuild system in general and CMake in particularBuild system in general and CMake in particularopenmpquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!