You can pip install M3 in serial mode using PyPi via:

pip install mthree

Alternatively, one can install from source:

python install

To enable OpenMP one must have an OpenMP 3.0+ enabled compiler and install with:

python install --with-openmp

Optionally one can also set -march=native using:

python install --with-native

The openmp and native flags can be used simultaneously using a comma.

OpenMP on OSX

On OSX one must install LLVM using homebrew (You cannot use GCC):

brew install llvm

after which the following (or the like) must be executed in the terminal:

export PATH="/usr/local/opt/llvm/bin:$PATH"


export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"

Then installation with openmp can be accomplished using:

CC=clang CXX=clang python install --with-openmp