MolSSI Integral Reference Project
Building MIRP from Source


There appear to be bugs and instabilities when using Intel 2016. It is strongly recommended that 2017 or newer be used
The versions given for Arb, Flint, MPFR, and GMP are the lowest versions that MIRP has been tested with. Other versions are likely to work (particularly for GMP and MPFR).

See Building Dependencies for some info on building the dependencies, or Obtaining Binaries of MIRP and Dependencies for how to obtain dependencies in binary form.

Building and Installing MIRP

MIRP is built with CMake, and in general uses the standard options. No files are modified within the source tree, so multiple out-of-source builds can share the same source directory.

The most common options are:

Other MIRP-specific options:

An example of configuring, building, testing, and installing:

cd /path/to/mirp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/path/to/mirp_deps \
-DCMAKE_INSTALL_PREFIX=/home/user/mirp_install \
make install

Testing MIRP

Testing of the library is done using the ctest command, as shown above. The tests are designed to thoroughly cover all the functionality of the library.

Currently, the tests take less than 5 minutes on reasonably modern hardware.

If you have a failing test, please file a bug report using github issues or by emailing the main author directly.

Building Dependencies

There is a helper script in the build_scripts directory of MIRP. The script is called and takes a single argument specifying the architecture (for gcc's -march option). If you are unsure what to use, and you are compiling this on the same architecture you are going to use MIRP on, use "native".

This script will download and compile the dependencies using GCC (which must be in your path). It will create a directory within the current working directory named mirp_deps_v${version}_${arch} where ${arch} is the argument you gave to and ${version} is the current version of MIRP (see the VERSION file). The is directory (mirp_deps_v${version}_${arch}) should then be included in the CMAKE_PREFIX_PATH for MIRP.

If the patchelf program is available, the RUNPATH of the dependencies will be changed to make the package self contained. The current working directory will be used to store the downloaded files. Compilation will take place in a subdirectory deps_build_${arch}.

The script is fairly rudimentary, so feel free to modify as you wish for your own purposes.

As an example, here could be a complete workflow for downloading/compiling MIRP from scratch:

# Abort if an error is encountered or on undefined variables
set -eu
# Download MIRP sources
git clone
# Build dependencies in a separate directory
mkdir mirp_deps
cd mirp_deps
bash ../MIRP/build_scripts/ native
cd ../
# mirp_deps directory should now contain
# mirp_deps_native subdirectory
# Now build MIRP (change v0.5 to whichever version you have)
mkdir mirp_build
cd mirp_build
cmake -DCMAKE_PREFIX_PATH="$(pwd)/../mirp_deps/mirp_deps_v0.5_native" \
-DCMAKE_INSTALL_PREFIX="$(pwd)/../mirp_install" \
make install