*nix like OS (Linux, Unix, …)
Other operating systems have not been tested and they likely require a more complex procedure for the installation (this includes the Microsoft Windows family..).
gcc (or an alternative C/C++ compiler)
gfortran (or an alternative Fortran compiler)
Installing requirements on Ubuntu¶
sudo apt install gcc libc6-dev sudo apt install gfortran libgfortran3 sudo apt install libopenmpi-dev
Installing requirements on Mac OS (using homebrew)¶
brew install llvm brew install gfortran brew install open-mpi
First of all make sure to have the latest version of pip installed
pip install --upgrade pip
The package and its python dependencies can be installed running the commands:
pip install --upgrade TransportMaps
The packages numpy and cython must be installed separately because some dependencies do not list then among the build requirements.
If one whish to enable some of the optional dependencies:
pip install --upgrade TransportMaps[option]
These options will install the following modules:
DOLFIN – dolfin package for Partial Differential Equations
SUITESPARSE – scikit-sparse
HMC – Hamiltonian Monte Carlo pyhmc (it requires having numpy and cython already installed)
If anything goes wrong with the automatic installation you can try to install from source:
git clone email@example.com:dabi86/transportmaps.git cd transportmaps pip install --upgrade numpy cython pip install .
Running the Unit Tests¶
Unit tests are available and can be run through the command:
>>> import TransportMaps as TM >>> TM.tests.run_tests()
Or directly using the bash command:
The Git repository also contains a docker-compose configuration file to test the whole suite on several versions of python.
There are >2000 unit tests, and it will take some time to run all of them.
List of Frequently Asked Questions
mpi4py fail to install with error: missing <mpi.h>¶
One mpi backend must be installed on the machine (e.g. OpenMPI, MPICH) and find out where the corresponding header file <mpi.h> is located. Then the package can be installed by setting the environment variables
CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:<mpi_path> \ pip install --upgrade mpi4py