Installation

Getting the library

xsimd is a header-only library, so installing it is just a matter of copying the include/xsimd directory.

However we provide standardized means to install it, with package managers or with cmake. Besides the xsimd headers, all these methods place the cmake project configuration file in the right location so that third-party projects can use cmake’s find_package to locate xsimd headers.

_images/conda.svg

Using the conda-forge Package

A package for xsimd is available for the mamba (or conda) package manager.

mamba install -c conda-forge xsimd
_images/spack.svg

Using the Spack Package

A package for xsimd is available on the Spack package manager.

spack install xsimd
spack load xsimd
_images/cmake.svg

From Source with cmake

You can install xsimd from source with Cmake. From the source directory:

cmake -B build/ -D CMAKE_INSTALL_PREFIX=/path/to/install/dir
cmake --build build/
cmake --install build/

You may need to customize the default CMake, for instance for picking nmake on Windows platforms:

cmake -B build/ -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=/path/to/install/dir
cmake --build build/
cmake --install build/

Using the library inside CMake

Inside the user’s CMakelists.txt, the user can add xsimd to their build with the xsimd target. When using CMake this way, this will set add the xsimd headers in the compiler options, as well as forward other xsimd requirements (minimum C++ version for instance).

find_package(xsimd REQUIRED)
target_link_libraries(myproject PRIVATE xsimd)