Install from source¶
For most users, the default installation using pip should be sufficient.
To build the package from source on github use Poetry. Follow the installation instructions for Poetry and use
$ poetry shell
$ poetry install
$ poetry build
If you are building with cython, use
poetry install -E cython
If you are building the Sphinx documentation or want to be sure all packages are installed to run the notebooks,
poetry install -E docs
Mac OS¶
On Mac OS, the default compiler, clang, does not have openMP support. The package uses openMP as compiler arguments in this package’s build.py script as
extra_compile_args=['-fopenmp'],
extra_link_args=['-fopenmp']
These can be removed. Alternatively, to take advantage of multithreading install a g++ compiler using homebrew
$ brew install gcc
After installation, check the various g++ on the system, e.g. g++ –version, to find the one installed from homebrew. For example,
$ g++-9 --version
>> g++-9 (Homebrew GCC 9.2.0_3) 9.2.0
>> ...
is an example of a desired compiler. Now set some environment variables for this compiler to be used by the build. Go to build.py and uncomment
# MAC OS
# ======
# Change the default compiler, e.g. from clang for MAC OS.
# import os
# COMPILE_WITH = 'g++-9'
os.environ['CC'] = COMPILE_WITH
os.environ['CXX'] = COMPILE_WITH
# @rpath must be specified to dynamically link to the correct library
# See also: extra_link_args in Extension
OSX_LINK_ARGS = '-Wl,-rpath,/usr/local/opt/gcc@9/lib/gcc/9/'
# ======
where COMPILE_WITH and OSX_LINK_ARGS reflect the compiler version number you just installed.