Skip to content

Installation

The ncarray package is written predominantly in C++; however, it does contain two halves:

  • The core libncarray library
  • The ncarray Python package.

Like all XFELPP projects, these can be built in a variety of formats, which are described in more detail on the general installation page.

Note that regardless of the format chosen, the necessary headers and shared libraries can always be found from Python if needed (e.g. from build scripts). Two utility functions are provided at the top of the ncarray package to assist in locating the correct binaries and files:

import ncarray
# Headers:
path_to_headers: str = ncarray.get_include()
# Shared libs:
path_to_libs: str = ncarray.get_lib_dir()

Currently, the recommended method for installation is to select one of the distributed wheels from the XFELPP indices, depending on whether you require GPU support (Windows and Linux only), or host only.

Installation from the command-line using pip directly is straightforward. When running pip install simply provide the extra keyword argument --extra-index-url pointing to the index for the variant of interest.

Terminal window
pip install ncarray --extra-index-url https://pypi.xfelpp.org/host

If you need to setup extra indices for use with different tools, some examples are provided with the general installation information.

The wheels are also distributed directly on GitHub and can be found attached to each release. Refer to the releases to select the correct package. After downloading the wheel, the package can be installed with pip install.

The entire procedure can be done from the command-line, for example:

Terminal window
wget https://github.com/XFELPP/ncarray/releases/download/v0.6.0/ncarray-0.6.0-cp311-cp311-manylinux_2_28_x86_64.whl
pip install ncarray-0.6.0-cp311-cp311-manylinux_2_28_x86_64.whl

ncarray is currently in the process of preparing conda packages. A recipe is available in the repo (here); however, the package is not yet available on conda-forge and/or a private channel.

The source code is available on GitHub. Please refer to the build instructions for more information if building from source.