Installation of LLVM-based compilerΒΆ
The LLVM website describes a list of build requirements of LLVM.
You should be able to compile and install the LLVM-based compiler with the following commands:
$ cmake -S llvm -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$INSTALLATION_PREFIX \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \
-DCLANG_DEFAULT_OMPSS2_RUNTIME=libnanos6 \
-DCLANG_DEFAULT_NANOS6_HOME=$INSTALLATION_PREFIX \
-DCLANG_DEFAULT_NODES_HOME=$INSTALLATION_PREFIX
$ cd build
$ make
$ make install
The LLVM/Clang can compile OmpSs-2 code and generate the binaries for both Nanos6
and NODES runtime systems. The support for OmpSs-2 and their runtime systems is
always enabled. Deciding whether an OmpSs-2 binary is generated for a specific
runtime is done when compiling the user application with clang
.
During the building stage, LLVM/Clang only needs to know where to find the runtime libraries. The following CMake options are available to specify the path to the runtime libraries and which is the default runtime for OmpSs-2 binaries:
CLANG_DEFAULT_NANOS6_HOME
to specify the default path to the Nanos6 installation. If not provided, the default path is the installation prefix of LLVM/Clang. This Nanos6 path can be overriden when compiling OmpSs-2 applications by defining theNANOS6_HOME
environment variableCLANG_DEFAULT_NODES_HOME
to specify the default path to the NODES installation. If not provided, the default path is the installation prefix of LLVM/Clang. This NODES path can be overriden when compiling OmpSs-2 applications by defining theNODES_HOME
environment variableCLANG_DEFAULT_OMPSS2_RUNTIME
to specify which runtime library is targeted by default if the user did not specify which runtime when compiling an application. The accepted values arelibnanos6
(default) andlibnodes
More details about customizing the LLVM build can be found in the LLVM website