To make sure that the key PETSc and MPI prerequisites work properly together, so that you
can run PISM in parallel, you might want to make sure that the correct
mpiexec can be
found, by setting your
PATH. For instance, if you used the option
--download-mpich=1 in the PETSc configure, the MPI
bin directory will have a path
$PETSC_DIR/$PETSC_ARCH/bin. Thus the following lines might appear in your
.profile, if not there already:
export PETSC_DIR=/home/user/petsc-3.10.2/ export PETSC_ARCH=opt export PATH=$PETSC_DIR/$PETSC_ARCH/bin/:$PATH
From now on we will assume that the
PETSC_DIR variables are set.
PETSC_ARCH variable is not needed if PETSc was configured using the
Follow these steps to build PISM:
Get the latest source for PISM using the Git version control system by running
git clone https://github.com/pism/pism.git pism-stable
A directory called “
pism-stable” will be created. Note that in the future when you enter that directory,
git pullwill update to the latest revision of PISM. 1
You can also download a tarball from GitHub.
mkdir -p pism-stable/build cd pism-stable/build export CC=mpicc export CXX=mpicxx cmake -DCMAKE_INSTALL_PREFIX=~/pism .. make -j install
pism-stableis the directory containing PISM source code while
~/pismis the directory PISM will be installed into.
CXXspecify MPI compiler wrappers provided by your MPI installation.
When using MPI’s compiler wrappers, make sure that
mpicxxyou select were used to compile the PETSc library: PISM and PETSc have to use the same MPI installation.
Commands above will configure PISM to be installed in
~/pism/lib/then compile and install all its executables and scripts.
If your operating system does not support shared libraries3, then set
Pism_LINK_STATICALLYto “ON”. This can be done by either running
cmake -DPism_LINK_STATICALLY=ON ..
or by using
and then change
Pism_LINK_STATICALLY(and then press
cto “configure” and
gto “generate Makefiles”). Then run
Temporary files created during the build process (located in the
buildsub-directory) are not automatically deleted after installing PISM, so run “
make clean” if space is an issue. You can also delete the build directory altogether if you are not planning on re-compiling PISM.
When using Intel’s compiler and high optimization settings such as
-fp-model precisemay be needed to get reproducible model results. Set it using
ccmakeor by setting
CXXFLAGSenvironment variables when building PISM’s prerequisites (such as PETSc) and PISM itself.
export CFLAGS="-fp-model precise" export CXXFLAGS="-fp-model precise" cmake [other options] ..
To achieve best performance it can be useful to tell the compiler to target the “native” architecture. (This gives it permission to use CPU instructions that may not work on older CPUs.)
export CFLAGS="-march=native" export CXXFLAGS="-march=native" cmake [other options] ..
PISM executables can be run most easily by adding the
bin/sub-directory in your selected install path (
~/pism/binin the example above) to your
PATH. For instance, this command can be done in the Bash shell or in your
PISM’s build-time configuration¶
Some of PISM’s features (the ones requiring additional libraries, for example) need to be enabled when building PISM. This section lists important build-time options.
"build type": set to "Debug" for development
build shared (as opposed to static) libraries (this is the default)
set CMake flags to try to ensure that everything is linked statically
specifies whether PISM should look for libraries (disable this on Crays)
build additional executables (needed to run
build PISM’s Python bindingd; requires
use the PROJ library to compute latitudes and longitudes of grid points
use the ParallelIO library to write output files
use NetCDF for parallel file I/O
use PnetCDF for parallel file I/O
enables extra sanity checks in the code (this makes PISM a lot slower but simplifies development)
To enable PISM’s use of PROJ, for example, run
cmake -DPism_USE_PROJ [other options] ..
Building PISM with libraries in non-standard locations¶
To build PISM with libraries installed in a non-standard location such as
use CMake’s variable
CMAKE_FIND_ROOT_PATH. Set it to a semicolon-separated list of
For example, if
netcdf.h is located in
libnetcdf.so is in
cmake -DCMAKE_FIND_ROOT_PATH=~/local/netcdf [other options] ..
To build PISM using parallel I/O libraries installed as described in Installing parallel I/O libraries, do this:
cmake -DCMAKE_FIND_ROOT_PATH="~/local/netcdf;~/local/pnetcdf;~/local/parallelio" \ -DPism_USE_PNETCDF \ -DPism_USE_PARALLEL_NETCDF4 \ -DPism_USE_PIO \ ..
Of course, after
git pullyou will
make -C build installto recompile and re-install PISM.
Please report any problems you meet at these build stages by sending us the output.
This might be necessary if you’re building on a Cray XT5 or a Sun Opteron Cluster, for example.
cmake-curses-guipackage to get