Build AMUSE on Windows

I'm currently in the process of building AMUSE on windows, the goal is to get a build process capable of producing binaries for people wanting to try amuse and running on windows (So not the most optimized version, or every last code needs to be available). Also build process will not be fully automatic.

getting the software

  1. python from portable python (I installed it in c:\amuse\pe)
  2. visual studio 9 express, see here
  3. mpich2,
  4. hdf5 shared lib, see here
  5. mingw and msys, for gnu compilers, make and other unix tools
  6. tdm gcc (for gnu compilers compatible with mpich2, see here
  7. subversion binary windows (google it)
  8. cmake binary windows (google it)
  9. gsl (tested with version 1.12)
  10. fftw 3 (see here

Install everything in a common root directory (not the default Program Files, I choose: c:\amuse)

python packages


(run in a dos prompt with vcvarsall.bat ran)

  1. download from PYPI
  2. unpack somewhere
  3. edit mpicfg, look for section mpich2 and windows and copy this to the top section
  4. run: c:\amuse\pp\App\python.exe install


(run in a dos prompt with vcvarsall.bat ran)

  1. downalod from PYPI
  2. run: set HDF5_DIR c:\amuse\hdf5\1.8.9
  3. run: c:\amuse\pp\App\python.exe
  4. run: c:\amuse\pp\App\python.exe install

docutils, nosetests

use easy_install from portable python:

  1. run: c:\amuse\pp\App\Scripts\easy_install.exe docutils
  2. run: c:\amuse\pp\App\Scripts\easy_install.exe nosetests

MPI compilers

MPICH2 for windows does not seem to come with mpiXX wrappers.

To fix this, I copied over the mpiXX scripts from a UNIX install and edited the directories at the start of the file. I emptied all C, fortran and LD flags (-O2 -m64 etc,)

For mpif90, you'll need to remove all references to ${MPILIBNAME}f90 and replace it with fmpich2g.

$ mpif90 -show                                                                                                                                                     
gfortran -I/c/amuse/mpich2/include -I/c/amuse/mpich2/include -L/c/amuse/mpich2/lib -lfmpich2g -lmpi  
$ mpicxx -show                                                                                                                                                     
c++ -I/c/amuse/mpich2/include/ -L/c/amuse/mpich2/lib -lmpicxx -lmpi

Set the mpiXX script in the path


For cmake you need to define the cmake generator (defaults to MSVC projects and we need MSYS Makefiles)

export CMAKE_GENERATOR="MSYS Makefiles"

TDM compiler

Add the TDM binary directory as the first item to your path:

export PATH=/c/TDM/bin:$PATH


Add the gsl bin and lib-shared directories to the windows PATH

After configure edit the file and change the GSL_LIBS setting to point to lib-shared instead of lib

export PATH=$PATH:/c/amuse/gsl-1.12/bin:/c/amuse/gsl-1.12/lib-shared/

part of

GSL_LIBS=-L/c/amuse/gsl-1.12/bin/../lib-shared -lgsl -lgslcblas   


Add the fftw3 directory to your path:

export PATH=$PATH:/c/amuse/fftw3/

Edit the file after configure to set the FFTW specific flags (configure will probably not find fftw3 automatically)

FFTW_LIBS=-L/c/amuse/fftw3/ -llibfftw3-3   


Edit the file after configure

HDF5_LIBS=-L/c/amuse/HDF5/1.8.9/bin -lhdf5dll                                  


Get amuse from svn (or latests release might also work)

  1. export PYTHON="C:
  2. Run configure ./configure --with-hdf5=/c/amuse/HDF5/1.8.9/ FFTW_FLAGS=-I/c/amuse/fftw3/ FFTW_LIBS="-L/c/amuse/fftw3/ -llibfftw3-3"
  3. Edit for fftw, gsl, hdf5 etc.
  4. Run make

Current status on the windows port: 24 out of 31 codes built Not built: adaptb, hacs64, hop, kepler, pynbody, simplex, smalln

create file amuserc with:


Run a test with:

/c/amuse/mpich2/bin/mpiexec.exe -localonly 1  /c/amuse/pp/app/Scripts/nosetests -v test/codes_tests/
Last modified 7 years ago Last modified on Jun 27, 2012, 2:56:25 PM