Documentation for PISM, the Parallel Ice Sheet Model

This is an old revision of the document!


Installing PISM on systems with unusual PETSc installations

PISM uses the CMake script FindPETSc.cmake to learn about your PETSc installation. This page describes a way to build PISM using a PETSc installation that heuristics in FindPETSc.cmake fail on.

We need to set the following CMake variables:

  • PETSC_FOUND - system has PETSc
  • PETSC_INCLUDES - the PETSc include directories
  • PETSC_LIBRARIES - Link these to use PETSc
  • PETSC_COMPILER - Compiler used by PETSc, helpful to find a compatible MPI
  • PETSC_DEFINITIONS - Compiler switches for using PETSc
  • PETSC_MPIEXEC - Executable for running MPI programs
  • PETSC_VERSION - Version string (MAJOR.MINOR.SUBMINOR)

In addition to this, setting PETSC_EXECUTABLE_RUNS to YES disables checks in FindPETSc.cmake.

Below is a CMake script you can use as a template:

petsc_manual_config.cmake
set (PETSC_EXECUTABLE_RUNS YES CACHE BOOL "Disable checking if this setup works" FORCE)
 
set (PETSC_FOUND YES CACHE BOOL "PETSc was found (manually)" FORCE)
 
set (PETSC_INCLUDES "EDIT THIS" CACHE STRING
  "Semicolon-delimited list of PETSc include directories" FORCE)
 
set (PETSC_LIBRARIES "EDIT THIS" CACHE STRING
  "Semicolon-delimited list of PETSc libraries" FORCE)
 
set (PETSC_COMPILER "EDIT THIS" CACHE FILEPATH
  "PETSc compiler; helpful to find a compatible MPI" FORCE)
 
set (PETSC_DEFINITIONS "EDIT THIS" CACHE STRING
  "PETSc definitions" FORCE)
 
set (PETSC_MPIEXEC "EDIT THIS" CACHE FILEPATH
  "Executable for running PETSc MPI programs" FORCE)
 
set (PETSC_VERSION "EDIT THIS" CACHE STRING
  "PETSc version: MAJOR.MINOR.SUBMINOR" FORCE)
 
mark_as_advanced (PETSC_INCLUDES PETSC_LIBRARIES
  PETSC_COMPILER PETSC_DEFINITIONS
  PETSC_MPIEXEC PETSC_EXECUTABLE_RUNS PETSC_VERSION)

How do I use this?

  1. Download the script quoted above
  2. Edit to match your PETSc installation
  3. Run cmake -C path/to/petsc_manual_config.cmake path/to/pism-source in your build directory
  4. Follow the rest of PISM's build instructions.
manual_petsc_setup.1314216537.txt.gz ยท Last modified: 2011/08/24 20:08 by Constantine Khroulev
© 2020 by PISM | webmaster