Although xtensor is a header-only library, we provide standardized means to
install it, with package managers or with cmake.
Besides the xtensor 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 xtensor headers.
A package for xtensor is available on the conda package manager.
conda install -c conda-forge xtensor
A package for xtensor is available on Debian.
sudo apt-get install xtensor-dev
A package for xtensor is available on the Spack package manager.
spack install xtensor spack load --dependencies xtensor
You can also install xtensor from source with cmake. This requires that you
have the xtl library installed on your system. On Unix platforms, from the
source directory:
mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=/path/to/prefix .. make install
On Windows platforms, from the source directory:
mkdir build cd build cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=/path/to/prefix .. nmake nmake install
See the section of the documentation on :doc:`build-options`, for more details on how to cmake options.