Installing Pylith using Pylith Installer


PyLith is a finite element code for the solution of dynamic and quasi-static tectonic deformation problems. This entry will only focus on the compilation of Pylith from the installer. Most if not all of the information comes from INSTALLER files.


OVERVIEW

This installer builds the current PyLith release and its dependencies from source.

PyLith depends on several other libraries, some of which depend on other libraries. As a result, building PyLith from source can be tricky and is fraught with potential pitfalls. This installer attempts to eliminate these obstacles by providing a utility that builds all of the dependencies in the proper order with the required options in addition to PyLith itself.

The installer will download the source code for PyLith and all of the dependencies during the install process, so you do not need to do this yourself. Additionally, the installer provides the option of checking out the PyLith and PETSc source code from the Subversion and Mercurial repositories (requires subversion and mercurial be installed); only use this option if you want the bleeding edge versions and are willing to rebuild frequently.

SYSTEM REQUIREMENTS

PyLith Installer should work on any UN*X system.  It requires the following language tools:

* A C compiler.
* Tar archiving utility
* wget or curl networking downloaders.

If you are using a modern UN*X system, there is a good chance that the above tools are already installed.

STEP 1 – Download and unpack the installer

Download the installer.

http://www.geodynamics.org/cig/software/pylith/pylith-installer-1.6.1-0.tgz

Untar the source code for the installer:

# mkdir -p $HOME/src/pylith
# cd $HOME/src/pylith
# mv $HOME/Downloads/pylith-installer-1.6.1-0.tgz
# tar -zxf pylith-installer-1.6.1-0.tgz

STEP 2 – Run Configure

On multi-core and multi-processor systems (not clusters but systems with more than one core and/or processor), the build process can be sped up by using multiple threads when running “make”. Use the configure argument –with-make-threads=NTHREADS where NTHREADS is the number of threads to use (1, 2, 4, 8, etc). The default is to use only
one thread. In the examples below, we set the number of threads to 2.

The examples below is not an exhaustive list of configure settings, rather it is a list of common combinations. You can enable/disable building each package to select the proper set of dependencies that need to be built.

Run configure with –help to see all of the command line arguments.

DEFAULT Installation

The default installation assumes you have
* C, C++, and Fortran compilers
* Python 2.4 or later
* MPI

$ mkdir -p $HOME/build/pylith
$HOME/src/pylith/pylith-installer-1.6.1-0/configure \
--with-make-threads=2 \
--prefix=$HOME/pylith

DESKTOP-LINUX-OPENMPI
In this case we assume MPI does not exist on your system and you want to use the OpenMPI implementation.

We assume you have
* C, C++, Fortran compilers
* Python 2.4 or later

mkdir -p $HOME/build/pylith
$HOME/src/pylith/pylith-installer-1.6.1-0/configure \
--enable-mpi=openmpi \
--with-make-threads=2 \
--prefix=$HOME/pylith

CLUSTER

We assume the cluster has been configured with compilers and MPI appropriate for the hardware. We assume that Python has not been installed or was not built with the selected compiler suite. So we assume you have
* C, C++, Fortran compilers
* MPI

mkdir -p $HOME/build/pylith
$HOME/src/pylith/pylith-installer-1.6.1-0/configure \
--enable-python \
--with-make-threads=2 \
--prefix=$HOME/pylith

STEP 3 – Setup your environment

Setup your environment variables (as indicated in the output of the
configure script).

cd $HOME/build/pylith
source setup.sh

STEP 4 – Build the software

Build all of the required dependencies and then PyLith. You do not need to run “make install”, because the installer includes this step in the make process.

#  make

NOTE

Depending on the speed and memory of your machine and the number of dependencies and which ones need to be built, the build process can   take anywhere from about ten minutes to several hours. As discussed above you can interrupt the build process and continue at a later   time from where you left off.

If you get error messages while running make with multiple threads, then try running make again as not all packages fully support parallel builds. You can also go to the build directory of the package and run “make” before running make in $HOME/build/pylith   again to resume the build process. For example,

#  cd netcdf-build
#  make

STEP 5 – Verify the installation

Run your favorite PyLith example or test problem to insure that PyLith
was installed properly.

Add the line

. $HOME/build/pylith/setup.sh

to your .bashrc (or other appropriate file) or manually add the environment variables from setup.sh to your .bashrc (or other appropriate file) so that the environment is setup properly automatically every time you open a shell.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s