Skip to content

Building with CMake

This page describes the procedure from obtaining the FrontISTR source code through building and installation. For details of the dependent libraries, see Required and Optional Dependencies.

Obtaining the Source Code

The FrontISTR source code can be obtained from GitLab or GitHub.

# GitLab
git clone https://gitlab.com/FrontISTR-Commons/FrontISTR.git

# GitHub (mirror)
git clone https://github.com/FrontISTR/FrontISTR.git

Build Procedure

FrontISTR assumes an out-of-source build (building directly in the source tree is prohibited). Create a build directory and run cmake inside it.

cd FrontISTR
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_MPI=ON -DWITH_OPENMP=ON ..
make -j$(nproc)

After the build, it can be run directly as /path/to/FrontISTR/build/fistr1/fistr1. To install it into the system path (CMAKE_INSTALL_PREFIX), additionally run the following command.

cmake --build . --target install

CMake Options

Options whose default is listed as "ON if detected" are enabled automatically when the corresponding library is found on the system when cmake is run. They can be disabled explicitly by specifying -DWITH_XXX=OFF.

Option Default Description
WITH_MPI ON Enables MPI parallelism
WITH_OPENMP ON if detected Enables OpenMP thread parallelism
WITH_METIS ON if detected Enables domain decomposition using METIS
METIS_VER_4 OFF Uses METIS v4 (OFF uses v5)
WITH_MUMPS ON if detected Enables the MUMPS parallel direct solver
WITH_MKL ON if detected Enables Intel MKL (including PARDISO)
WITH_LAPACK ON if detected Enables condition-number estimation using LAPACK
WITH_ML ON if detected Enables AMG preconditioning using Trilinos ML
WITH_REFINER ON if detected Enables mesh refinement using REVOCAP_Refiner
WITH_REVOCAP ON if detected Enables coupled analysis using REVOCAP_Coupler
WITH_TOOLS ON Builds the bundled tools
WITH_DOC OFF Generates API documentation with Doxygen
WITH_NETCDF ON if detected Enables Exodus II output (NetCDF)
WINDOWS OFF Enables building for Windows
CMAKE_BUILD_TYPE RELEASE Build type (RELEASE / DEBUG)
CMAKE_INSTALL_PREFIX /usr/local Installation directory
DEBUG_EXTRA OFF Enables memory-leak checking (for GCC, -fsanitize=address)

DEBUG Build

When CMAKE_BUILD_TYPE=DEBUG is specified, the following compiler-specific debug flags are added.

Compiler Additional flags
GCC -fbounds-check -fbacktrace
Intel -check uninit,bound -traceback
cmake -DCMAKE_BUILD_TYPE=DEBUG ..

Building with a GPU

When NVIDIA HPC SDK (nvc/nvc++/nvfortran) is specified as the compiler, CMake automatically adds the following flags.

Flag Description
-acc Enables OpenACC
-Minfo=accel Displays information about GPU offloading at compile time
-gpu=ccnative,mem:managed Automatically detects the GPU in the build environment to determine the target and uses Unified Memory

For detailed procedures for GPU builds with OpenACC, see Building with a GPU.