Closed zjin-lcf closed 2 years ago
Hi,
You can find instructions in the top-level README.md, which is rendered here:
https://github.com/llvm-doe-org/llvm-project/tree/clacc/main
Let me know if you have any questions.
Thanks.
Is the common command build clacc targeting an nvidia gpu offloading below:
cmake -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS='clang' - DLLVM_ENABLE_RUNTIMES='openmp' -DCLANG_ACC_TEST_EXE_NVPTX64=6 -DCMAKE_BUILD_TYPE=Release ../llvm ?
It's a good starting point if you indeed have 6 NVIDIA GPUs on your system.
Other cmake options might be required depending on your system. LLVM's documentation covers those. I'm happy to help if you're struggling to find the right combination for your system.
I got the following errors:
cmake -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS='clang' -DLLVM_ENABLE_RUNTIMES='openmp' \ -DCLANG_ACC_TEST_EXE_NVPTX64=4 -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=NVPTX ../llvm
Then, I type "make"
[100%] Linking CXX executable ../../bin/lli [100%] Linking CXX executable ../../bin/llvm-jitlink [100%] Linking CXX executable ../../../../bin/clang-scan-deps [100%] Built target c-index-test [100%] Built target llvm-jitlink [100%] Built target lli [100%] Built target clang-scan-deps [100%] Built target clang Scanning dependencies of target runtimes-clobber [100%] Clobbering bootstrap build and stamp directories [100%] Built target runtimes-clobber Scanning dependencies of target runtimes [100%] No download step for 'runtimes' [100%] No update step for 'runtimes' [100%] No patch step for 'runtimes' [100%] Performing configure step for 'runtimes'
-- The C compiler identification is unknown -- The CXX compiler identification is unknown -- The ASM compiler identification is Clang -- Found assembler: /path/to/llvm-project-clacc/build/./bin/clang -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.11") -- Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.11") -- Linker detection: GNU ld -- Performing Test C_SUPPORTS_FPIC -- Performing Test C_SUPPORTS_FPIC - Failed -- Performing Test CXX_SUPPORTS_FPIC -- Performing Test CXX_SUPPORTS_FPIC - Failed CMake Warning at /path/to/llvm-project-clacc/llvm/cmake/modules/HandleLLVMOptions.cmake:271 (message): -fPIC is not supported. Call Stack (most recent call first): /path/to/llvm-project-clacc/llvm/cmake/modules/HandleLLVMOptions.cmake:307 (add_flag_or_print_warning) CMakeLists.txt:92 (include)
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG -- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Failed -- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS -- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS - Failed -- Performing Test C_SUPPORTS_FDATA_SECTIONS -- Performing Test C_SUPPORTS_FDATA_SECTIONS - Failed -- Performing Test CXX_SUPPORTS_FDATA_SECTIONS -- Performing Test CXX_SUPPORTS_FDATA_SECTIONS - Failed -- Looking for os_signpost_interval_begin -- Looking for os_signpost_interval_begin - not found -- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter -- Performing Test OPENMP_HAVE_WALL_FLAG -- Performing Test OPENMP_HAVE_WALL_FLAG - Failed -- Performing Test OPENMP_HAVE_WERROR_FLAG -- Performing Test OPENMP_HAVE_WERROR_FLAG - Failed -- Performing Test OPENMP_HAVE_WCAST_QUAL_FLAG -- Performing Test OPENMP_HAVE_WCAST_QUAL_FLAG - Failed -- Performing Test OPENMP_HAVE_WFORMAT_PEDANTIC_FLAG -- Performing Test OPENMP_HAVE_WFORMAT_PEDANTIC_FLAG - Failed -- Performing Test OPENMP_HAVE_WIMPLICIT_FALLTHROUGH_FLAG -- Performing Test OPENMP_HAVE_WIMPLICIT_FALLTHROUGH_FLAG - Failed -- Performing Test OPENMP_HAVE_WSIGN_COMPARE_FLAG -- Performing Test OPENMP_HAVE_WSIGN_COMPARE_FLAG - Failed -- Performing Test OPENMP_HAVE_WNO_EXTRA_FLAG -- Performing Test OPENMP_HAVE_WNO_EXTRA_FLAG - Failed -- Performing Test OPENMP_HAVE_WNO_PEDANTIC_FLAG -- Performing Test OPENMP_HAVE_WNO_PEDANTIC_FLAG - Failed -- Performing Test OPENMP_HAVE_WNO_MAYBE_UNINITIALIZED_FLAG -- Performing Test OPENMP_HAVE_WNO_MAYBE_UNINITIALIZED_FLAG - Failed -- Performing Test OPENMP_HAVE_STD_GNUPP14_FLAG -- Performing Test OPENMP_HAVE_STD_GNUPP14_FLAG - Failed -- Performing Test OPENMP_HAVE_STD_CPP14_FLAG -- Performing Test OPENMP_HAVE_STD_CPP14_FLAG - Failed -- Performing Test LIBOMP_HAVE_FNO_EXCEPTIONS_FLAG -- Performing Test LIBOMP_HAVE_FNO_EXCEPTIONS_FLAG - Failed -- Performing Test LIBOMP_HAVE_FNO_RTTI_FLAG -- Performing Test LIBOMP_HAVE_FNO_RTTI_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_CLASS_MEMACCESS_FLAG -- Performing Test LIBOMP_HAVE_WNO_CLASS_MEMACCESS_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG -- Performing Test LIBOMP_HAVE_WNO_COVERED_SWITCH_DEFAULT_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_FRAME_ADDRESS_FLAG -- Performing Test LIBOMP_HAVE_WNO_FRAME_ADDRESS_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_STRICT_ALIASING_FLAG -- Performing Test LIBOMP_HAVE_WNO_STRICT_ALIASING_FLAG - Failed -- Performing Test LIBOMP_HAVE_WSTRINGOP_OVERFLOW_FLAG -- Performing Test LIBOMP_HAVE_WSTRINGOP_OVERFLOW_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_STRINGOP_TRUNCATION_FLAG -- Performing Test LIBOMP_HAVE_WNO_STRINGOP_TRUNCATION_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_SWITCH_FLAG -- Performing Test LIBOMP_HAVE_WNO_SWITCH_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_UNINITIALIZED_FLAG -- Performing Test LIBOMP_HAVE_WNO_UNINITIALIZED_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_UNUSED_BUT_SET_VARIABLE_FLAG -- Performing Test LIBOMP_HAVE_WNO_UNUSED_BUT_SET_VARIABLE_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_RETURN_TYPE_C_LINKAGE_FLAG -- Performing Test LIBOMP_HAVE_WNO_RETURN_TYPE_C_LINKAGE_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_CAST_QUAL_FLAG -- Performing Test LIBOMP_HAVE_WNO_CAST_QUAL_FLAG - Failed -- Performing Test LIBOMP_HAVE_WNO_INT_TO_VOID_POINTER_CAST_FLAG -- Performing Test LIBOMP_HAVE_WNO_INT_TO_VOID_POINTER_CAST_FLAG - Failed -- Performing Test LIBOMP_HAVE_MSSE2_FLAG -- Performing Test LIBOMP_HAVE_MSSE2_FLAG - Failed -- Performing Test LIBOMP_HAVE_FTLS_MODEL_FLAG -- Performing Test LIBOMP_HAVE_FTLS_MODEL_FLAG - Failed -- Performing Test LIBOMP_HAVE_MMIC_FLAG -- Performing Test LIBOMP_HAVE_MMIC_FLAG - Failed -- Performing Test LIBOMP_HAVE_M32_FLAG -- Performing Test LIBOMP_HAVE_M32_FLAG - Failed -- Looking for shm_open -- Looking for shm_open - not found -- Looking for shm_open -- Looking for shm_open - not found -- Performing Test LIBOMP_HAVE_X_FLAG -- Performing Test LIBOMP_HAVE_X_FLAG - Failed -- Performing Test LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG -- Performing Test LIBOMP_HAVE_WARN_SHARED_TEXTREL_FLAG - Failed -- Performing Test LIBOMP_HAVE_AS_NEEDED_FLAG -- Performing Test LIBOMP_HAVE_AS_NEEDED_FLAG - Failed -- Performing Test LIBOMP_HAVE_VERSION_SCRIPT_FLAG -- Performing Test LIBOMP_HAVE_VERSION_SCRIPT_FLAG - Failed -- Performing Test LIBOMP_HAVE_STATIC_LIBGCC_FLAG -- Performing Test LIBOMP_HAVE_STATIC_LIBGCC_FLAG - Failed -- Performing Test LIBOMP_HAVE_Z_NOEXECSTACK_FLAG -- Performing Test LIBOMP_HAVE_Z_NOEXECSTACK_FLAG - Failed -- Looking for pthread.h -- Looking for pthread.h - not found CMake Error at /usr/local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find Threads (missing: Threads_FOUND) Call Stack (most recent call first): /usr/local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/local/share/cmake-3.15/Modules/FindThreads.cmake:220 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) /path/to/llvm-project-clacc/openmp/runtime/cmake/config-ix.cmake:138 (find_package) /path/to/llvm-project-clacc/openmp/runtime/CMakeLists.txt:240 (include)
-- Configuring incomplete, errors occurred! See also "/path/to/llvm-project-clacc/build/runtimes/runtimes-bins/CMakeFiles/CMakeOutput.log". See also "/path/to/llvm-project-clacc/build/runtimes/runtimes-bins/CMakeFiles/CMakeError.log". make[2]: [runtimes/CMakeFiles/runtimes.dir/build.make:107: runtimes/runtimes-stamps/runtimes-configure] Error 1 make[1]: [CMakeFiles/Makefile2:72383: runtimes/CMakeFiles/runtimes.dir/all] Error 2 make: *** [Makefile:152: all] Error 2
Please try either not setting LLVM_TARGETS_TO_BUILD or setting it as:
-DLLVM_TARGETS_TO_BUILD='host;NVPTX'
Are you working on an ExCL system? If so, let me know which one, and I can probably just paste a cmake config for you.
it is equinox.
The error message after setting the two targets is:
CMake Error at /usr/local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find Threads (missing: Threads_FOUND)
Could these errors be detected before the status of 'make' reaches 100% ?
Thanks
The following works for me on equinox:
$ module load nvhpc
$ PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/21.7/cuda/11.4/bin:$PATH
$ cmake -DCMAKE_INSTALL_PREFIX=../install \
-DLLVM_ENABLE_PROJECTS='clang' -DLLVM_ENABLE_RUNTIMES='openmp' \
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ \
-DCLANG_ACC_TEST_EXE_NVPTX64=4 -DCMAKE_BUILD_TYPE=Release \
../llvm
It works for me. Thanks
Could you please show the instructions to install clacc from source ? Thanks.