Build Instructions

From Warpx

Jump to: navigation, search

Before you begin you must have an account on the WarpX PSI Center subversion repository. You can get access to this by filling out this form. A caveat: on some systems it is best to consult your system-administrator for build instructions or have him/her build the key software, specially the MPI libraries. You are strongly encouraged to build all needed software (except MPI) yourself.

These instructions have been tested on Mac OS X and a Fedora Linux box. Significant work may be needed to get the dependencies working on other platforms. Note that WarpX itself is very easy to build once you have the dependencies figured out. We have built it from desktops to latest supercomputer clusters.

You can cut and paste all instructions to build on your machine. Ideally no other instructions should be needed. If your system does not have the "curl" program to download the software needed by WarpX you can use "wget" instead. If you do not have either of these, then cut-and-paste the URLs to a web browser and copy the archives to the appropriate directory.

It is recommended that you use the system MPI on a cluster. In that case you do not need to reinstall MPI yourself. If you do use the system MPI then in the instructions given below make sure that you replace the MPI directory locations to your system MPI.

These installation instruction process does not need administrator permissions. First, make two directories in your $HOME directory

 cd
 mkdir software
 mkdir buildDir

The buildDir directory will have the sources and the software directory will be the directory in which all software is installed.

Contents

Getting and installing MPI

In general MPI should be built by the system administrator. If this already exists just add the location of the directory in which mpicc lives to you config.py file. You must build parallel HDF5 and parallel WarpX with the same MPI.

Get it first. We will use OpenMPI.

 cd $HOME/buildDir
 curl http://www.open-mpi.org/software/ompi/v1.2/downloads/openmpi-1.2.5.tar.gz -O

Now unzip and untar

 gunzip openmpi-1.2.5.tar.gz 
 tar -xvf openmpi-1.2.5.tar

Now build and install it

 cd openmpi-1.2.5
 ./configure --prefix=$HOME/software/openmpi-1.2.5
 make
 make install

Now go back to the software directory and softlink for ease of use.

 cd $HOME/software
 ln -s openmpi-1.2.5 mpi

Put your MPI location in your path

 export PATH=$HOME/software/mpi/bin:$PATH

Getting and installing HDF5

Get it first.

 cd $HOME/buildDir
 curl http://www.hdfgroup.org/ftp/HDF5/prev-releases/hdf5-1.8.2/src/hdf5-1.8.2.tar -O

Now unzip and untar::

 gunzip hdf5-1.8.2.tar.gz
 tar -xvf hdf5-1.8.2.tar

We will need both parallel and serial builds.

Serial HDF5 build

We will build serial HDF5 out-of-place.

 cd hdf5-1.8.2
 mkdir serial
 cd serial
 ../configure --prefix=$HOME/software/hdf5-1.8.2
 make
 make install

Now go back to the software directory and softlink for ease of use.

 cd $HOME/software
 ln -s hdf5-1.8.2 hdf5

Parallel HDF5 build

We will build parallel HDF5 out-of-place.

 cd $HOME/buildDir/hdf5-1.8.2
 mkdir parallel
 cd parallel
 export CC=$HOME/software/mpi/bin/mpicc
 export CXX=$HOME/software/mpi/bin/mpicxx
 export LD_LIBRARY_PATH=$HOME/software/mpi/lib/
 ../configure --prefix=$HOME/software/hdf5-1.8.2-openmpi-1.2.5
 make
 make install

Now go back to the software directory and softlink for ease of use

 cd $HOME/software
 ln -s hdf5-1.8.2-openmpi-1.2.5 hdf5mpi

Optional: Getting and Installing PETSc

The PETSc libraries are required for some of the subsolvers in WarpX, specially ones that deal with solving a large sparse system of linear/non-linear equations.

For version 3.0.0-p3 (which was the latest by the time of this writing), you can use:

 cd $HOME/buildDir
 curl ftp://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.0.0-p7.tar.gz -O

Extract the tar file and set the environmental variable PETSC_DIR to the PETSc installation folder

 tar -xzvf petsc-3.0.0-p7.tar.gz
 cd petsc-3.0.0-p7
 export PETSC_DIR=$PWD
 cd $PETSC_DIR

For parallel build, make sure that MPI has already been installed.

Serial Petsc build

For ease of use, have PETSc download, configure, compile and install using

./config/configure.py --with-shared=0 --with-mpi=0 \
--prefix=$HOME/software/petsc-3.0.0-p7 \
--with-debugging=0 --COPTFLAGS='-O2 -g' --with-x=0 \
--download-superlu --download-f-blas-lapack=yes

Once the configuration step is complete (it may take a while) set the enviornment variables as instructed by PETSC. On my Mac I have to do

 PETSC_ARCH=darwin9.6.0-c-opt; export PETSC_ARCH 

Then build the code using

 make all
 make install

Now go back to the software directory and softlink for ease of use

 cd $HOME/software
 ln -s petsc-3.0.0-p7 petsc

Parallel Petsc build

First go back to your petsc directory

 cd $PETSC_DIR

To build in parallel you must have MPI installed. Configure PETSC using the following command

 ./config/configure.py --with-shared=0 --with-mpi-dir=$HOME/software/mpi \
 --prefix=$HOME/software/petsc-3.0.0-p7-openmpi-1.2.5 \
 --with-debugging=0 --COPTFLAGS='O2 -g' --with-x=0 \
 --download-hypre --download-parmetis --download-blacs \
 --download-superlu_dist \
 --download-scalapack --download-mumps --download-sundials

MPI may be installed on a different folders for different machines. Adjust the --with-mpi-dir flag accordingly. Make sure that you compile PETSc with the same MPI installation that you use for WarpX.

Once petsc has been configured it can be built using the instructions which the build script prints on successful configuration. Unfortunately, due some strange problem in PETSC the instructions are not so clear. Read the output carefully to figure this out. On my Mac I need to do:

 export PETSC_ARCH=darwin9.6.0-c-opt
 export PETSC_DIR=/Users/ammar/buildDir/petsc-3.0.0-p7

Now build the code using

make all
make install

Now go back to the software directory and softlink for ease of use

 cd $HOME/software
 ln -s petsc-3.0.0-p7-openmpi-1.2.5 petscmpi

Getting Python

In general you will not need to install Python as it comes standard with almost all Mac and Linux systems. On the Mac you may want to upgrade to Python 2.5 by downloading MacPython 2.5 from the Python website.

Getting and installing Scons

Scons is the WarpX build system. First get it from

 http://prdownloads.sourceforge.net/scons/scons-1.0.1.tar.gz

Save it in your $HOME/buildDir directory. Then

 cd $HOME/buildDir
 gunzip scons-1.0.1.tar.gz
 tar -xvf scons-1.0.1.tar

Now build it

 cd scons-1.0.1
 python setup.py install --prefix=$HOME/software/scons-1.0.1

Now go back to the software directory and softlink for ease of use.

 cd $HOME/software
 ln -s scons-1.0.1 scons

Add the path to scons to your PATH and PYTHONPATH variables. You can do this by adding the following lines to you .bashrc or .profile files

export PATH=$HOME/software/scons/bin:$PATH
export PYTHONPATH=$HOME/software/scons/bin:$PYTHONPATH

Getting and installing WarpX

To obtain WarpX you need need an svn account on the University of Washington PSI-Center cluster. Checkout the latest version by doing

 svn co svn+ssh://warpx@psicenter.org/warpx/trunk warpx

Then cd to the src directory

 cd warpx/src

Create a file called config.py

 touch config.py

Now open this in Emacs or some other text editor and add the following lines to it

 import os
 
 mpi = os.environ.get("HOME") + "/software/mpi"
 hdf5s = os.environ.get("HOME") + "/software/hdf5"
 hdf5p = os.environ.get("HOME") + "/software/hdf5mpi"

Your MPI path may be different if you are using a MPI already installed on the system. Now you are ready to build WarpX.

Serial WarpX build

To build WarpX in serial, from the warpx/src directory do

 scons parallel=no debug=no

This will build WarpX in serial without any debugging symbols. The compiled code is put into a directory (in warpx/src) called build. The executable is in the build/warpx directory and is called xwarpx.

You can also build with debugging enabled

 scons parallel=no debug=yes

The compiled code is put into a directory (in warpx/src) called build-deb. The executable is in the build-deb/warpx directory and is called xwarpx.

Parallel WarpX build

To build WarpX in parallel, from the warpx/src directory do

 scons parallel=yes debug=no

This will build WarpX in parallel without any debugging symbols. The compiled code is put into a directory (in warpx/src) called build-par. The executable is in the build-par/warpx directory and is called xwarpx.

You can also build with debugging enabled

 scons parallel=yes debug=yes

The compiled code is put into a directory (in warpx/src) called build-par-deb. The executable is in the build-par-deb/warpx directory and is called xwarpx.

Building WarpX with PETSc

Use

 scons usepetsc=yes

to build WarpX with PETSc. Other options can also be used as usually. WarpX will then check for PETSc, BLAS and LAPACK libraries and headers in the specified folders. If any of these libraries is not found, scons will stop the building process and output an error message.

Building WarpX with the TAU profiling tools

Still to do.