Skip to content

Installation on macOS with Python3

Steven Rieder edited this page Nov 29, 2023 · 16 revisions

First, install the prerequisites.


On macOS:

I use macports for this, but other methods may work just as well.

sudo port install gcc12 openmpi-gcc12 hdf5 gsl cmake gmp mpfr fftw-3 +gcc12
sudo port install python311 py311-virtualenv 

Next, set the just installed compilers to be the default.

sudo port select --set mpi openmpi-gcc12-fortran
sudo port select --set gcc mp-gcc12
sudo port select --set python3 python311

Then, make a virtual environment for Amuse.

python3 -m venv Amuse-env

This virtual environment ensures you are using the correct modules, and isolates them from other system-installed packages.

To activate the environment, use

. Amuse-env/bin/activate

From this point, your prompt will have 'Amuse-env ' in front of it, to indicate that you are using this virtual environment.

Install the python modules required by Amuse:

pip install numpy scipy matplotlib nose docutils mpi4py h5py wheel

Also, install any additional modules you might want to use, like Astropy:

pip install astropy jupyter

Modules needed for some of the textbook examples:

pip install pandas seaborn

Now, go to your Amuse repository

cd $AMUSEDIR

Now run configure

./configure [--enable-cuda] [--enable-sapporo2]

Finally, install Amuse

python setup.py install

Done!

Clone this wiki locally