../_images/ubuntu.png

External libraries

1. C and fortran compilers

Using either gcc or clang to compile MAGEMin is up to you as the runtime performances are similar. However, in the event you want to modify MAGEMin for your own use, I would advice that you compile MAGEMin with clang as the error handling system is more strict which will save you from having unexpected segfaults errors…

sudo apt-get install gcc
sudo apt-get install clang
sudo apt-get install gfortran

2. Open MPI (Message Passing Interface)

sudo apt-get install openmpi-bin libopenmpi-dev

Note that mpich can equally be used.

3. lapacke (C version of the fotran lapack library)

sudo apt-get install liblapacke-dev

4. NLopt (Non Linear optimization library)

First cmake must be installed on your machine

sudo apt-get install cmake

Then NLopt can installed such as

sudo apt-get install libnlopt-dev

Alternatively NLopt be downloaded and installed

git clone https://github.com/stevengj/nlopt.git
cd nlopt
mkdir build
cd build
cmake ..
make
sudo make install

Done - all installed

../_images/ubuntu.png

MAGEMin

Choose the C compiler in the first line of the Makefile by commenting out one

#CC=gcc
CC=clang

Make sure the open MPI paths for libraries and include directory in Makefile are correct. By default the paths to openmpi are the following:

LIBS   += (...) -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi
INC     = (...) -I/usr/lib/x86_64-linux-gnu/openmpi/include/

Depending on the machine on which you want to install MAGEMin, you might need to manually give the paths to NLopt libraries and include directory too

LIBS   += (...) --L/local/home/kwak/nlopt_install/install/lib -lnlopt
INC     = (...) -I/local/home/kwak/nlopt_install/install/include

If you are using Lockless memory allocator, add the following flag in the Makefile:

LIBS   += (...) -lllalloc

Then compile MAGEMin:

make clean; make all;

Note that by default the optimization flag -O3 and debugging flag -g are used.

To test if MAGEMin compilation was successful you can for instance check the version of MAGEMin by running:

./MAGEMin --version