Building GEOS
Build steps
Create a host-config file that sets all system-specific CMake variables. Take a look at host-config examples. We recommend the same host-config is used for both TPL and GEOS builds. In particular, certain options (such as
ENABLE_MPI
orENABLE_CUDA
) need to match between the two.Provide paths to all enabled TPLs. This can be done in one of two ways:
Provide each path via a separate CMake variable (see Third-party dependencies for path variable names).
If you built TPLs from the
tplMirror
repository, you can setGEOSX_TPL_DIR
variable in your host-config to point to the TPL installation path, andinclude("/path/to/GEOS/host-configs/tpls.cmake")
which will set all the individual TPL paths for you.
Configure via
config-build.py
script:cd GEOS python scripts/config-build.py --hostconfig=/path/to/host-config.cmake --buildtype=Release --installpath=/path/to/install/dir
where
--buildpath
or-bp
is the build directory (by default, created under current working dir).--installpath
or-ip
is the installation directory(wrapsCMAKE_INSTALL_PREFIX
).--buildtype
or-bt
is a wrapper to theCMAKE_BUILD_TYPE
option.--hostconfig
or-hc
is a path to host-config file.all unrecognized options are passed to CMake.
If
--buildpath
is not used, build directory is automatically namedbuild-<config-filename-without-extension>-<buildtype>
. It is possible to keep automatic naming and change the build root directory with--buildrootdir
. In that case, build path will be set to<buildrootdir>/<config-filename-without-extension>-<buildtype>
. Both--buildpath
and--buildrootdir
are incompatible and cannot be used in the same time. Same pattern is applicable to install path, with--installpath
and--installrootdir
options.Run the build:
cd <buildpath> make -j $(nproc)
You may also run the CMake configure step manually instead of relying on config-build.py
.
A full build typically takes between 10 and 30 minutes, depending on chosen compilers, options and number of cores.
Configuration options
Below is a list of CMake configuration options, in addition to TPL options above.
Some options, when enabled, require additional settings (e.g. ENABLE_CUDA
).
Please see host-config examples.
Option |
Default |
Explanation |
---|---|---|
|
|
Build with MPI (also applies to TPLs) |
|
|
Build with OpenMP (also applies to TPLs) |
|
|
Build with CUDA (also applies to TPLs) |
|
|
Enable CUDA NVTX user instrumentation (via GEOS_MARK_SCOPE or GEOS_MARK_FUNCTION macros) |
|
|
Build with HIP/ROCM (also applies to TPLs) |
|
|
Build documentation (Sphinx and Doxygen) |
|
|
Treat all warnings as errors |
|
|
Enable PVTPackage library (required for compositional flow runs) |
|
|
Enables TotalView debugger custom view of GEOS data structures |
|
|
Enables code coverage |
|
|
Enables unit testing targets |
|
|
Choiсe of Linear Algebra backend (Hypre/Petsc/Trilinos) |
|
|
Use CMake Object Libraries build |
|
|
Build |
|
Max. number of compile jobs (when using Ninja), in addition to |
|
|
Max. number of link jobs (when using Ninja), in addition to |
|
|
|
Enables schema generation and installation |