PyLith installation instructions for the recycled cluster (radon) and any x86 machine running Debian Etch*


[Update:] For v1.4.1 Pyrex/Pyrexembed is replaced by SWIG (Install using ./configure --prefix=$SCRATCH/Pylith; make; make install). If you have an older version installed (for example /usr/bin/swig) then simply set the $SWIG variable (pointing towards the new installation) before installing Spatialdata (v0.5.2) and PyLith. Also add --enable-swig flag while configuring Spatialdata/PyLith.

[Update:] The instructions below also work for PyLith 1.3.x

PyLith (v1.1.x) makes use of Nemesis, Proj.4, Spatialdata, Pyrex, Pyrexembed, FIAT, numpy and PETSc (development version) which further needs to be compiled with sieve, chaco (for graph partitioning) and boost.

Replace $SCRATCH with the absolute path of scratch directory. A good place to get/build all required packages on radon is /tmp (fast).

# module purge all
# module load mpich2-gcc (invokes mpich2-1.0.5p4 with gcc-4.2.1 compilers)
# mkdir $SCRATCH/Pylith

PetSc
# tar -xzf petsc-dev.tar.gz; cd petsc-dev
# export PETSC_DIR=`pwd`
# ./config/configure.py --with-clanguage=C++ --with-mpi-dir=/opt/mpich2-1.0.5p4/32/ssm-gcc-4.2.1 --with-blas-lapack-dir=/opt/intel/mkl721 --with-shared=0 --with-debugging=0 --with-sieve=1 --with-chaco=1 --download-chaco=1 --with-boost=1 --download-boost=1
# export PETSC_ARCH=linux-gnu-cxx-opt
# make all

Nemesis
# tar -xzf nemesis-1.0.tar.gz; cd nemesis-1.0
# ./configure --prefix=$SCRATCH/Pylith
# make; make install

Proj.4
# tar -xzf proj-4.6.0.tar.gz; cd proj-4.6.0/nad
# unzip proj-datumgrid-1.3.zip; cd ../
# ./configure --prefix=$SCRATCH/Pylith
# make; make install

Pyrexembed
# tar -xzf pyrexembed-1.0.tar.gz; cd pyrexembed-1.0
# python setup.py install --prefix=$SCRATCH/Pylith

Pyrex
# tar -xzf Pyrex-0.9.6.4.tar.gz; cd Pyrex-0.9.6.4
# python setup.py install --prefix=$SCRATCH/Pylith

FIAT
# tar -xzf FIAT-0.3.3.tar.gz; cd FIAT-0.3.3
# python setup.py install --prefix=$SCRATCH/Pylith

Numpy
# tar -xzf numpy-1.0.4.tar.gz; cd numpy-1.0.4
# python setup.py config_fc --fcompiler gfortran install --prefix=$SCRATCH/Pylith
{You can also tell Numpy to use the MKL in which case save this file in the numpy-1.0.4 and then use 'python setup.py config --compiler=intel --fcompiler=intel --prefix=$SCRATCH/Pylith'}

Spatialdata
# tar -xzf spatialdata.tar.gz; cd spatialdata
# export PATH=$PATH:$SCRATCH/Pylith/bin
# export PYTHONPATH=$PYTHONPATH:$SCRATCH/Pylith/lib/python2.4/site-packages
# autoreconf -f -i {Only if needed}
{If you get the error "aclocal: couldn't open directory `./m4': No such file or directory" then simply create an empty directory named m4}
# ./configure --prefix=$SCRATCH/Pylith LDFLAGS="-L$SCRATCH/Pylith/lib" CPPFLAGS="-I$SCRATCH/Pylith/include -I/usr/include/python2.4" --enable-pythia
#make; make install

NetCDF {Used to read Cubit mesh that is stored in Exodus (based on NetCDF) file format}
# tar -xzf netcdf.tar.gz; cd netcdf-3.6.2
# ./configure --disable-examples --disable-f77 --disable-f90 --disable-utilities --prefix=$SCRATCH/pylith
# make; make install

PyLith
# tar -xzf pylith-1.0.2.tgz; cd pylith-1.0.2
{Make sure that PATH, PYTHONPATH, PETSC_DIR and PETSC_ARCH variables are all set}
# ./configure --prefix=$SCRATCH/Pylith --enable-cubit CPPFLAGS="-I$SCRATCH/pylith/include" LDFLAGS="-L$SCRATCH/pylith/lib"
{If it complains about a missing 'petscconf' then simply create it as a symlink to 'petscvariables' in $PETSC_DIR/$PETSC_ARCH/conf}
# make
# make install

Finally create this file in $HOME/.pyre/pylithapp, add $SCRATCH/Pylith/bin to $PATH and delete PetSc and all other packages.

Test the installation by running the ..examples/3d/hex8 example
# qsub -I -l nodes=2
# pylith dislocation.cfg --nodes=2

---
[*] In certain cases, for example when you build PyLith on one machine and use on another, you might have to set/update PYTHONPATH and LD_LIBRARY_PATH variables. You can also use apt-get to install things like python-numpy, netcdf and netcdfg-dev. Also do make sure that python-dev installed.

[*] On 64-bit machines you might have to use the '--with-pic' option while configuring PETSc and NetCDF. Also dont forget to add ../Pylith/lib64 to PYTHONPATH