File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1+ set (LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;compiler-rt;lld" CACHE STRING "" )
2+ set (LLVM_ENABLE_RUNTIMES "libunwind;libcxx;libcxxabi;openmp;offload" CACHE STRING "" )
3+ set (LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "" )
4+
5+ set (CLANG_DEFAULT_CXX_STDLIB "libc++" CACHE STRING "" )
6+ set (CLANG_DEFAULT_LINKER "lld" CACHE STRING "" )
7+
8+ set (LLVM_RUNTIME_TARGETS default;amdgcn-amd-amdhsa;nvptx64-nvidia-cuda CACHE STRING "" )
9+ set (RUNTIMES_nvptx64-nvidia-cuda_CACHE_FILES "${CMAKE_SOURCE_DIR} /../libcxx/cmake/caches/NVPTX.cmake" CACHE STRING "" )
10+ set (RUNTIMES_amdgcn-amd-amdhsa_CACHE_FILES "${CMAKE_SOURCE_DIR} /../libcxx/cmake/caches/AMDGPU.cmake" CACHE STRING "" )
11+ set (RUNTIMES_nvptx64-nvidia-cuda_LLVM_ENABLE_RUNTIMES "compiler-rt;libc;libcxx;libcxxabi" CACHE STRING "" )
12+ set (RUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES "compiler-rt;libc;libcxx;libcxxabi" CACHE STRING "" )
Original file line number Diff line number Diff line change @@ -51,7 +51,23 @@ All patches go through the regular `LLVM review process
5151
5252Q: How to build an OpenMP GPU offload capable compiler?
5353^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54- To build an *effective * OpenMP offload capable compiler, only one extra CMake
54+
55+ The easiest way to create an offload capable compiler is to use the provided
56+ CMake cache file. This will enable the projects and runtimes necessary for
57+ offloading as well as some extra options.
58+
59+ .. code-block :: sh
60+
61+ $> cd llvm-project # The llvm-project checkout
62+ $> mkdir build
63+ $> cd build
64+ $> cmake ../llvm -G Ninja \
65+ -C ../offload/cmake/caches/Offload.cmake \ # The preset cache file
66+ -DCMAKE_BUILD_TYPE=< Debug| Release> \ # Select build type
67+ -DCMAKE_INSTALL_PREFIX=< PATH> \ # Where the libraries will live
68+ $> ninja install
69+
70+ To manually build an *effective * OpenMP offload capable compiler, only one extra CMake
5571option, ``LLVM_ENABLE_RUNTIMES="openmp;offload" ``, is needed when building LLVM (Generic
5672information about building LLVM is available `here
5773<https://llvm.org/docs/GettingStarted.html> `__.). Make sure all backends that
You can’t perform that action at this time.
0 commit comments