.. _pocl-install: ============ Installation ============ Requirements ------------ In order to build pocl, you need the following support libraries and tools: * A supported version of LLVM & Clang (check release notes) * development files for LLVM & Clang + their transitive dependencies (e.g. libclang-dev, libllvm-dev, zlib1g-dev, libtinfo-dev...) * CMake * GNU make or ninja * pkg-config * pthread (should be installed by default) * hwloc v1.0 or newer (e.g. libhwloc-dev) - optional * python3 (for support of LLVM bitcode with SPIR target; optional but enabled by default) * python3, llvm-spirv (version-compatible with LLVM) and spirv-tools (optional; required for SPIR-V support in CPU / CUDA; Vulkan driver supports SPIR-V through clspv) Installing requirements for Ubuntu ---------------------------------- Note: The binary packages from https://apt.llvm.org/ are recommended (and tested for each release) instead of the binary tar balls or the packages included in the distribution. The following assumes apt.llvm.org is added to your apt repos:: apt install -y python3-dev libpython3-dev build-essential ocl-icd-libopencl1 cmake git pkg-config libclang-${LLVM_VERSION}-dev clang-${LLVM_VERSION} llvm-${LLVM_VERSION} make ninja-build ocl-icd-libopencl1 ocl-icd-dev ocl-icd-opencl-dev libhwloc-dev zlib1g zlib1g-dev clinfo dialog apt-utils libxml2-dev libclang-cpp${LLVM_VERSION}-dev libclang-cpp${LLVM_VERSION} llvm-${LLVM_VERSION}-dev Installing requirements for Arch Linux:: pacman -S gcc patch hwloc cmake git pkg-config make ninja ocl-icd clang llvm llvm-libs clinfo opencl-headers Installing requirements for Fedora:: dnf install gcc gcc-c++ clinfo hwloc-devel hwloc-libs cmake git-core pkgconfig make ninja-build ocl-icd ocl-icd-devel clang clang-devel clang-libs llvm llvm-devel llvm-libs patch redhat-rpm-config findutils There are also Dockerfiles available for a few most common linux distributions in ``tools/docker``, looking into them might be helpful. OpenCL 3.0 support ------------------ If you want PoCL built with ICD and OpenCL 3.0 support at platform level, you will need sufficiently new ocl-icd (2.3.x). For Ubuntu, it can be installed from this PPA: https://launchpad.net/~ocl-icd/+archive/ubuntu/ppa Additionally, if you want the CPU device to report as 3.0 OpenCL, you will need LLVM 14 or newer. Note: PoCL assumes that the OpenCL development headers and the ICD loader (if present on your system) are version compatible. Clang / LLVM Notes ------------------ **IMPORTANT NOTE!** Some targets (TCE and possibly HSA) require that you compile & build LLVM with RTTI on. It can be enabled on cmake command line, as follows:: cmake [other CMake options] -DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_EH=ON Supported LLVM versions ~~~~~~~~~~~~~~~~~~~~~~~~ Note that pocl aims to support **the latest LLVM version** at the time of pocl release, **plus the previous** LLVM version. All older LLVM versions are supported with "best effort" basis; there might not be CI continuously testing the code base nor anyone fixing their possible breakage. Configure & Build ----------------- CMake version 3.12 or higher is required. The build+install is the usual CMake way:: cd mkdir build cd build cmake [-D