Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • I INMOST
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Terekhov
  • INMOST
  • Wiki
  • 0403 Compilation PETSc Linux

Last edited by Kirill Terekhov Sep 21, 2015
Page history

0403 Compilation PETSc Linux

Compiling INMOST with PETSc on Linux

INMOST may be configured with optional PETSc support. In this case INMOST will support calling linear solvers from PETSc package, i.e. you will be able to activate Solver::PETSc package in Solver::Solver constructor.

INMOST requires PETSc version 3.5.0 or higher.

Compiling PETSc

PETSc installer can also install a lot of other dependencies for you. The following instructions assume that MPI is already installed and functional. You can use option --download-openmpi to install Open MPI with PETSc.

These steps can take some time.

cd "$INMOST_ROOT"
wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.5.2.tar.gz
tar zxf petsc-lite-3.5.2.tar.gz
cd petsc-3.5.2
export PETSC_DIR="`pwd`"
export PETSC_ARCH=linux-gnu-debug
./configure --download-f2cblaslapack --with-mpi=1
make all

You may as well compile optimized version of PETSc for timing and production runs.

PETSC_ARCH=linux-gnu-opt ./configure --download-f2cblaslapack --with-mpi=1 --with-debugging=0 -CFLAGS="-O2" -CXXFLAGS="-O2"
make PETSC_ARCH=linux-gnu-opt all

Once you are ready to switch to optimized version run

export PETSC_ARCH=linux-gnu-opt

and reconfigure and recompile INMOST.

Compiling INMOST with PETSc support

Make sure the environment variables PETSC_DIR and PETSC_ARCH are initialized correctly. CMake will detect your PETSc installation if both variables are present.

cd "$INMOST_ROOT"
mkdir -p INMOST-build
cd INMOST-build
cmake -DUSE_SOLVER_PETSC=ON ../INMOST-0.1
make all

Changing default compilers

The simplest way to use different compilers is to provide specific MPI wrappers to this compilers. This highly depends on you MPI installation. Below you will find several examples of using Intel Compilers with different MPI libraries.

If you use MPICH, you can set environment variables MPICH_CC, MPICH_CXX and MPICH_F77 to override default compilers.

cd "$PETSC_DIR"
export PETSC_ARCH=linux-intel-debug
export MPICH_CC=icc
export MPICH_CXX=icpc
export MPICH_F77=ifort
./configure --download-f2cblaslapack --with-mpi=1
make all

cd "$INMOST_ROOT"
mkdir -p INMOST-build-intel
cd INMOST-build-intel
cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DUSE_SOLVER_PETSC=ON ../INMOST-0.1
make all

If you use Intel MPI, then usually you will have separate mpiicc, mpiicpc and mpiifort wrappers.

cd "$PETSC_DIR"
export PETSC_ARCH=linux-intel-debug
./configure --with-cc=mpiicc --with-cxx=mpiicpc --with-fc=mpiifort --download-f2cblaslapack --with-mpi=1
make all

cd "$INMOST_ROOT"
mkdir -p INMOST-build-intel
cd INMOST-build-intel
cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DMPI_C_COMPILER=mpiicc -DMPI_CXX_COMPILER=mpiicpc -DUSE_SOLVER_PETSC=ON ../INMOST-0.1
make all

Note, that you can also use PETSc installer to download and compile Open MPI using your desired compilers.

cd "$PETSC_DIR"
export PETSC_ARCH=linux-intel-debug
./configure --with-cc=icc --with-cxx=icpc --with-fc=ifort --download-f2cblaslapack --download-openmpi=1
make all

cd "$INMOST_ROOT"
mkdir -p INMOST-build-intel
cd INMOST-build-intel
cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DMPI_C_COMPILER="$PETSC_DIR/$PETSC_ARCH/bin/mpicc" -DMPI_CXX_COMPILER="$PETSC_DIR/$PETSC_ARCH/bin/mpic++" -DMPIEXEC="$PETSC_DIR/$PETSC_ARCH/bin/mpiexec" -DUSE_SOLVER_PETSC=ON ../INMOST-0.1
make all

Refer to your MPI manual and compiler documentation for further information.

Clone repository
  • 0100 Compilation
  • 0200 Compilation Windows
  • 0201 Obtain MSVC
  • 0202 Obtain MSMPI
  • 0203 Compilation INMOST Windows
  • 0204 Compilation ParMETIS Windows
  • 0205 Compilation Zoltan Windows
  • 0206 Compilation PETSc Windows
  • 0207 Compilation Trilinos Windows
  • 0400 Compilation Linux
  • 0401 Install MPI
  • 0402 Compilation INMOST Linux
  • 0403 Compilation PETSc Linux
  • 0404 Compilation Trilinos Linux
  • 0405 Compilation ParMETIS Linux
View All Pages