|
|
|
Compiling INMOST with PETSc on Linux
|
|
|
|
======
|
|
|
|
|
|
|
|
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-3.5.2.tar.gz
|
|
|
|
rm -f petsc-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-master
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|