<commit_before>.. Copyright (c) 2016, <NAME>, <NAME> and <NAME>

   Distributed under the terms of the BSD 3-Clause License.

   The full license is in the file LICENSE, distributed with this software.


.. raw:: html

   <style>
   .rst-content .section>img {
       width: 30px;
       margin-bottom: 0;
       margin-top: 0;
       margin-right: 15px;
       margin-left: 15px;
       float: left;
   }
   </style>

Installation
============

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.

.. image:: conda.svg

Using the conda package
-----------------------

A package for xtensor is available on the conda package manager.

.. code::

    conda install -c conda-forge xtensor

.. image:: debian.svg

Using the Debian package
------------------------

A package for xtensor is available on Debian.

.. code::

    sudo apt-get install xtensor-dev

.. image:: spack.svg

Using the Spack package
-----------------------

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

.. code::

    spack install xtensor
    spack load --dependencies xtensor

.. image:: cmake.svg

From source with cmake
----------------------

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:

.. code::

    mkdir build
    cd build
    cmake -DCMAKE_INSTALL_PREFIX=/path/to/prefix ..
    make install

On Windows platforms, from the source directory:

.. code::

    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.

.. _xtl: https://github.com/QuantStack/xtl
<commit_msg>adde precisions to the installation instructions<commit_after>.. Copyright (c) 2016, <NAME>, <NAME> and <NAME>

   Distributed under the terms of the BSD 3-Clause License.

   The full license is in the file LICENSE, distributed with this software.


.. raw:: html

   <style>
   .rst-content .section>img {
       width: 30px;
       margin-bottom: 0;
       margin-top: 0;
       margin-right: 15px;
       margin-left: 15px;
       float: left;
   }
   </style>

Installation
============

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.

.. image:: conda.svg

Using the conda package
-----------------------

A package for xtensor is available on the conda package manager.

.. code::

    conda install -c conda-forge xtensor

.. image:: debian.svg

Using the Debian package
------------------------

A package for xtensor is available on Debian.

.. code::

    sudo apt-get install xtensor-dev

.. image:: spack.svg

Using the Spack package
-----------------------

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

.. code::

    spack install xtensor
    spack load --dependencies xtensor

.. image:: cmake.svg

From source with cmake
----------------------

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:

.. code::

    mkdir build
    cd build
    cmake -DCMAKE_INSTALL_PREFIX=path_to_prefix ..
    make install

On Windows platforms, from the source directory:

.. code::

    mkdir build
    cd build
    cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=path_to_prefix ..
    nmake
    nmake install

``path_to_prefix`` is the absolute path to the folder where cmake searches for
dependencies and installs libraries. ``xtensor`` installation from cmake assumes
this folder contains ``include`` and ``lib`` subfolders.

See the :doc:`build-options` section for more details about cmake options.

Including xtensor in your project
---------------------------------

The different packages of ``xtensor`` are built with cmake, so whatever the
installation mode you choose, you can add ``xtensor`` to your project using cmake:

.. code::

    find_package(xtensor REQUIRED)
    target_include_directories(your_target PUBLIC ${xtensor_INCLUDE_DIRS})
    target_link_libraries(your_target PUBLIC xtensor)

.. _xtl: https://github.com/QuantStack/xtl

{'fraction_non_alphanumeric': 0.12634238787113075, 'fraction_numerical': 0.005474836807749, 'mean_word_length': 2.749013417521705, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2857367', 'n_tokens_mistral': 1414, 'n_tokens_neox': 1320, 'n_words': 554}