Skip to content

Installing MUSIC

Oliver Hahn edited this page Apr 20, 2024 · 3 revisions

Prerequisites

MUSIC requires the following libraries:

  • FFTW3 (non-MPI, multi-threaded double precision version)
  • GSL
  • HDF5 (non-MPI version)
  • CMake

Installation on HPC clusters

Most HPC installations have these libraries pre-installed and they can be simply loaded via module load. You can check which modules are available on your system by running typically

  module avail

Installation on Linux

These libraries are available through the apt package manager of linux. Make sure to install the double precision, multi-threaded version of FFTW3.

Installation on MacOS

All of the packages can be installed via homebrew.

Some output plugins might require additional libraries to function.

Building MUSIC from source

While we still supply the old Makefile, using CMake is now the preferred way of building. CMake use out-of-source build, i.e. you create a build directory, and then configure the code using CMake. Inside the music directory, do

  mkdir build
  cd build
  ccmake ..
  make -j

to configure the code (you will se a menu), and then start a parallel compilation. If CMake has trouble finding your FFTW or HDF5 installation, you can add hints as follows

  FFTW3_ROOT=<path> HDF5_ROOT=<path> ccmake ..

If you want to build on macOS, then it is strongly recommended to use GNU (or Intel) compilers instead of Apple's Clang. Install them e.g. via homebrew and then configure cmake to use them instead of the macOS default compiler via

  CC=gcc-13 CXX=g++-13 ccmake ..

This is necessary since Apple's compilers haven't supported OpenMP for years.