See https://scipp.readthedocs.io for project context and how to use and install the scipp Python module.
See here for a list of frequently asked questions on how to use scipp. This is also the place to ask new questions that have not been answered yet, by opening a new Question issue.
It is not necessary to build scipp
from source if only the Python package is required.
See installation on how to install using conda
or docker
instead.
XCode 10.2 or greater provides a clang++
implementation with sufficient language support for scipp
.
You will need to be using LLVM Clang version 7 or greater.
You will need version 7 of GCC as a minimum.
To build and install the library:
git submodule init
git submodule update
mkdir -p build
mkdir -p install
cd build
cmake -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCMAKE_INSTALL_PREFIX=../install ..
make -j4 all install
Note that the all
and install
targets do NOT include the tests. Those must be built separately via all-tests
.
You should use Python 3.5 or greater.
To use the scipp
Python module:
cd ../python
python3 -m pip install -r requirements.txt
export PYTHONPATH=$PYTHONPATH:../install
In Python:
import scipp as sc
To run the C++ tests, run (in directory build/
):
./units/test/scipp-units-test
./core/test/scipp-core-test
Note that simply running ctest
also works, but currently it seems to have an issue with gathering templated tests, so calling the test binaries manually is recommended (and much faster).
To run the Python tests, run (in directory python/
):
cd python
python3 -m pip install -r requirements.txt
python3 -m pytest
The demo/tutorial notebooks are using a plugin from nbextension
, which needs to be installed separately:
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
Use pip3
, depending on your environment.
-DDYNAMIC_LIB
forces the shared libraries building, that also decreases link time.
For development purposes -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF -DDYNAMIC_LIB=ON
is recommended.