In order to successfully build and install Open SYCL, the following dependencies must be installed for all backends:
- python 3 (for the
syclccandsyclcc-clangcompiler wrappers) cmake- the Boost C++ libraries (in particular
boost.fiber,boost.contextand for the unit testsboost.test)- it may be helpful to set the
BOOST_ROOTcmakevariable to the path to the root directory of Boost you wish to use ifcmakedoes not find it automatically - Note for boost 1.78 users: There seems to be a bug in the build system for boost 1.78, causing the compiled fiber and context libraries not to be copied to the installation directory. You will have to copy these libraries manually to the installation directory. In binary packages from some distribution repositories this issue is fixed. You might be only affected when building boost manually from source.
- it may be helpful to set the
In addition, the various supported compilation flows have additional requirements (see here for more information on available compilation flows):
| Compilation flow | Target hardware | Short description | Requirements |
|---|---|---|---|
omp.library-only |
Any CPU | OpenMP CPU backend | Any OpenMP compiler |
omp.accelerated |
Any CPU supported by LLVM | OpenMP CPU backend (compiler-accelerated) | LLVM >= 11 |
cuda.integrated-multipass |
NVIDIA GPUs | CUDA backend (clang) | CUDA >= 10, LLVM >= 10 |
cuda.explicit-multipass |
NVIDIA GPUs | CUDA backend (clang, can be targeted simultaneously with other backends) | CUDA >= 10, LLVM 11 or 13+ |
cuda-nvcxx |
NVIDIA GPUs | CUDA backend (nvc++) | Latest NVIDIA HPC SDK |
hip.integrated-multipass |
AMD GPUs (supported by ROCm) | HIP backend (clang) | ROCm >= 4.0, LLVM >= 10 |
spirv |
Intel GPUs | SPIR-V/Level Zero backend | Level Zero driver and loader, clang with SYCL patches (e.g DPC++) |
generic |
NVIDIA, AMD, Intel GPUs | Generic single-pass compiler | LLVM >= 14. When dispatching kernels to AMD hardware, ROCm >= 5.3 is recommended. When dispatching to NVIDIA, clang needs nvptx64 backend enabled. Open SYCL runtime backends for the respective target hardware need to be available. |
Please make sure to read the instructions below for the dependencies that apply to your use case.
Follow these instructions.
Follow these instructions
Follow these instructions
Follow these instructions.
Once the software requirements mentioned above are met, clone the repository:
$ git clone https://github.com/OpenSYCL/OpenSYCL
Then, create a build directory and compile Open SYCL. As described below, some backends and compilation flows must be configured with specific cmake arguments which should be passed during the cmake step.
$ cd <build directory>
$ cmake -DCMAKE_INSTALL_PREFIX=<installation prefix> <more optional options, e.g. to configure the LLVM dependency> <Open SYCL source directory>
$ make install
The default installation prefix is /usr/local. Change this to your liking.
Note: Open SYCL needs to be installed to function correctly; don't replace "make install" with just "make"!
-DCMAKE_CXX_COMPILERshould be pointed to the C++ compiler to compile Open SYCL with. Note that this also sets the default C++ compiler for the CPU backend when using syclcc once Open SYCL is installed. This can however also be modified later usingHIPSYCL_CPU_CXX.
-DCMAKE_CXX_COMPILERcan be used to set the default OpenMP compiler.
-DWITH_ACCELERATED_CPU=OFF/ONcan be used to explicitly disable/enable CPU acceleration. Support for CPU acceleration is enabled by default when enabling the LLVM dependency, and LLVM is sufficiently new.
- See the CUDA installation instructions instructions (section on clang).
- See the CUDA installation instructions instructions (section on nvc++).
- See the ROCm installation instructions instructions.
- No specific cmake flags are currently available.
On Mac, only the CPU backends are supported. The required steps are analogous to Linux.
For experimental building on Windows (CPU and CUDA backends) see the corresponding wiki.
The omp.accelerated CPU compilation flow is unsupported on Windows.
Note: The software repositories mentioned below are outdated and in the process of being restructured. They do not contain modern Open SYCL versions.
Another way to install Open SYCL is to use our repositories. We provide repositories for several distributions (currently Ubuntu 18.04, CentOS 7, Arch Linux). A description of the repositories is available here
Our repositories cover the entire software stack, i.e. they include a compatible clang/LLVM distribution and ROCm stacks. The following packages are available:
hipSYCL- contains the actual Open SYCL libraries, tools and headershipSYCL-base- contains the LLVM/clang stack used by Open SYCL. Installation of this package is mandatory.hipSYCL-rocm- contains a ROCm stack. This package is only required if you wish to target AMD ROCm GPUs.hipSYCL-nightly- built from the current develop branch every day.hipSYCL-base-nightly- contains the LLVM/clang stack for the nightly Open SYCL packageshipSYCL-rocm-nightly- contains a ROCm stach compatible with the nighlty Open SYCL packages
Note: For legal reasons, we do not redistribute the Open SYCL-cuda package This package is only required if you wish to target CUDA GPUs. You will either have to create a CUDA package using install/scripts/packaging/make-<distribution>-cuda-pkg.sh or you can install CUDA directly using the install/scripts/install-cuda.sh script.
We also provide scripts for packaging Open SYCL and its dependencies. For more information on packaging and how to create your own Open SYCL packages, please see the documentation.