MultiNest Installation Notes
macOS 10.12
The following notes (by J. R. Lu) may help with installing MultiNest using MPI for enabling parallel processing. This installation was performed on a Mac with macOS 10.12 (64-bit architecture) on a early-2015 MacBook Pro laptop.
Dependencies: MacPorts, Anaconda, AstroConda
Install dependencies and packages through MacPorts:
sudo port install gcc49 sudo port install cmake sudo port install openmpi # Select the compilers sudo port select --set gcc mp-gcc49 sudo port select --set mpi openmpi-mp-fortran
Install mpi4py. Note that you shouldn't install mpi4py from conda as it installs its own openmpi. This version did not work for me. Instead, using the "pip install" approach uses the MacPorts install of openmpi.
pip install mpi4py
Download Multinest from Johannes Buchner's git repository.
git clone https://github.com/JohannesBuchner/MultiNest.git cd MultiNest/build/ cmake .. make sudo make install
Downloaded latest PyMultiNest. You may or may not need sudo when you run the last install step. Make sure you have activated the desired conda environment.
git clone https://github.com/JohannesBuchner/PyMultiNest.git cd PyMultiNest python setup.py install
Test that the installation works. First, in the MultiNest install directory, you can run the examples from bin/.
rm chains/* ./eggboxC
To test MPI operations, start
top -o cpu
in a separate terminal window and monitor whether the following commands initiate many threads.
rm chains/* mpirun -np 6 eggboxC
To test pymultinest, go into the PyMultiNest install directory. You can run the demo.
python pymultinest_demo_minimal.py
To test pymultinest in MPI mode, you need to modify pymultinest_demo_minimal.py to set init_MPI=False in the run() command. I don't know why this fails yet (haven't explored).
rm chains/* mpirun -np 6 python pymultinest_demo_minimal.py
OS X v10.9
The following notes (by J. R. Lu) may help with installing MultiNest using MPI for enabling parallel processing. This installation was performed on a Mac with OS X 10.9 (64-bit architecture) on a mid-2014 Mac Pro.
Dependencies: Ureka
Downloaded Open MPI 1.8.4-rc1 from here. Installed with the following:
./configure
make all
sudo make install
Downloaded CMake 3.1.0-rc3 from here (with OS X *.dmg). Installed as app and added the following symbolic links to /usr/local/bin/
sudo ln -s *abspath*/CMake.app/Contents/bin/ccmake sudo ln -s *abspath*/CMake.app/Contents/bin/cmake sudo ln -s *abspath*/CMake.app/Contents/bin/cmake-gui sudo ln -s *abspath*/CMake.app/Contents/bin/cmakeexbuild sudo ln -s *abspath*/CMake.app/Contents/bin/cpack sudo ln -s *abspath*/CMake.app/Contents/bin/ctest
Install mpi4py -- pymultinest dependency
sudo pip install mpi4py
Download Multinest from Johannes Buchner's git repository.
git clone https://github.com/JohannesBuchner/MultiNest.git cd MultiNest/build/ cmake .. make
Copy the libraries into /usr/local/lib. Also make symbolic links for a *.so file since this what pymultinest will depend on. Execute in Multinest/lib/.
sudo cp libmultinest.3.8.dylib /usr/local/lib/ sudo cp libmultinest_mpi.3.8.dylib /usr/local/lib/ sudo cp libmultinest.a /usr/local/lib/ sudo cp libmultinest_mpi.a /usr/local/lib/ sudo ln -s /usr/local/lib/libmultinest.3.8.dylib /usr/local/lib/libmultinest.dylib sudo ln -s /usr/local/lib/libmultinest.dylib /usr/local/lib/libmultinest.so sudo ln -s /usr/local/lib/libmultinest_mpi.3.8.dylib /usr/local/lib/libmultinest_mpi.dylib sudo ln -s /usr/local/lib/libmultinest_mpi.dylib /usr/local/lib/libmultinest_mpi.so
Downloaded latest PyMultiNest. You may or may not need sudo when you run the last install step.
git clone https://github.com/JohannesBuchner/PyMultiNest.git cd PyMultiNest python setup.py install
Test that the installation works. First, in the MultiNest install directory, you can run the examples from bin/.
rm chains/* eggboxC
To test MPI operations, start
top -o cpu
in a separate terminal window and monitor whether the following commands initiate many threads.
rm chains/* mpirun -np 6 eggboxC
To test pymultinest, go into the PyMultiNest install directory. You can run the demo.
python pymultinest_demo_minimal.py
To test pymultinest in MPI mode, you need to modify pymultinest_demo_minimal.py to set init_MPI=False in the run() command. I don't know why this fails yet (haven't explored).
rm chains/* mpirun -np 6 python pymultinest_demo_minimal.py