AdaptiveCpp Installation
Minimum Version
THOR requires AdaptiveCpp >= 24.06.0. Check your version with acpp --acpp-version.
Docker Alternative
Pre-built SYCL containers (AdaptiveCpp and Intel) are at github.com/thor-rt/syclcontainers. For production on HPC, build from source for performance and portability.
See the official AdaptiveCpp install guide. The notes below cover the common case where the system Clang is unsuitable.
Clang
AdaptiveCpp requires a Clang built with options most HPC system Clangs lack, so you typically need to compile your own. Download the LLVM source and build with the options below.
First download, e.g. Clang18 here: https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/llvm-project-18.1.8.src.tar.xz
After unpacking in its root folder, compile with the following options:
mkdir -p build
rm -rf build/*
pushd build
cmake -G "Unix Makefiles" ../llvm -DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_ENABLE_PROJECTS="clang;openmp;lld" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DLIBOMP_ENABLE_SHARED=ON \
-DLLVM_INCLUDE_BENCHMARKS=0 \
-DLLVM_INCLUDE_EXAMPLES=0 \
-DLLVM_INCLUDE_TESTS=0 \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_ENABLE_DUMP=OFF \
-DLLVM_ENABLE_OCAMLDOC=OFF \
-DLLVM_ENABLE_BINDINGS=OFF
make -j16
make DESTDIR=~/llvm install
For AMD GPU support, add AMDGPU to LLVM_TARGETS_TO_BUILD (i.e. "AMDGPU;X86"). Nvidia support is configured in the AdaptiveCpp step below.
AdaptiveCpp
rm -rf build/*
cd build
export INCL_CLANG=SPECIFY
export EXEC_CLANG=SPECIFY
export LLVM_DIR=SPECIFY
export INSTALL_DIR=SPECIFY
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DLLVM_DIR=$LLVM_DIR -DCLANG_EXECUTABLE_PATH=$EXEC_CLANG -DCLANG_INCLUDE_PATH=$INCL_CLANG ..
make -j16
make install
For AMD GPUs, add -DWITH_ROCM_BACKEND=ON -DROCM_PATH=$ROCM_PATH with the corresponding path for ROCm.
For Nvidia GPUs, add -DWITH_CUDA_BACKEND=ON -DNVCXX_COMPILER=$EXEC_NVCXX -DCUDA_TOOLKIT_ROOT_DIR=$DIR_CUDA with the respective paths for CUDA and NVCXX.
For more details and targets, see the official AdaptiveCpp docs.