Skip to content

installAMUSE.md

Simon Portegies Zwart edited this page Aug 17, 2020 · 16 revisions

##How to make a virtual machine for AMUSE

Create a directory where you will put your AMUSE repository
mkdir AMUSE
cd AMUSE\

Start a virtual environment, for example a python3 environment
python3 -m venv AMUSE-env

Source the environment to get it started
source AMUSE-env/bin/activate

Your prompt will change to something like: (AMUSE) spz@Flater\

Probably it is best to update pip en setuptools first.
pip install --upgrade pip
pip install --upgrade setuptools

Install jupyter notebook (if you like to work this way).
pip install jupyter

Install mpi4py, which is an important package for AMUSE and which is not installed automatically.
pip install mpi4py

Install the basic AMUSE framework
pip install amuse-framework

Now, we still have a slight bug in the AMUSE installation. That means that you will have to load the first few modules explicitely by hand.
pip install amuse-ph4
pip install amuse-SeBa
pip install amuse-gadget2

By this time you are ready to run AMUSE, but there is not much you can do yet, because you will be missing most of the embedded codes. Additional codes can be added using pip. For adding ph4, for example:
pip install amuse-BHTree

Or add amuse-halogen
pip install halogen

etc. A full list of packages can be found in Astrophysical Recipes (2018).\

If you want to plot, it may be a good idea to install some plotting
package, such as matplotlib.
pip install matplotlib

Once you are satisfied installing packages, AMUSE can be started from the command line:
>>> python
>>> from amuse.lab import *

or start jupyter notebook:
jupyter notebook
and import AMUSE in the appropriate way.

Clone this wiki locally