Missing Configuration Options in CMake Interface (ccmake)

Dear all,

I’m currently setting up OpenGeoSys (OGS) and running into an issue when I run ccmake.
I was following the tutorials on the OGS website (https://www.opengeosys.org/docs/tutorials/advancing-glacier/), in particular part 2: solving (https://youtu.be/GL5sugIyHEk). Check out 00:01:55.
The list of configuration options appears to be incomplete. I noticed that there are much more variables in the list (in the tutorial), in comparison to when I run cmake with GUI myself.
I expected to see more OGS-specific settings (like OGS-PROCESS-HT or any other variables starting with OGS-PROCESS-), but the displayed variables are mostly general CMake settings like compilers and linker flags.
Could it be related to cloning, an incorrect source directory, or a problem with my CMake configuration?

For reference:
I cloned the OGS repository and created a build directory. Then in the ‘build’ directory I ran:
cmake …

Any insights or suggestions on how to get the full set of OGS CMake configuration options would be greatly appreciated!

I would be happy to provide more info if that could be helpful to get to the bottom of this :slight_smile:

Dear AP76,

it seems to me that the video tutorial is not 100% in line with our developer guide. Sorry for the inconvenience.

Please follow our written build instructions very closely. They should bring you through the build process.

Essentially, in the source directory run cmake --preset release. Then the following should give you a complete list of configuration options:

ccmake ../build/release

If there’s something missing from that list, note that ccmake by default hides advanced settings. You can show them by pressing the t key while in ccmake.

That should solve the problem that you asked about. But it’s not the final step of the OGS build.

I hope that helps.

Best regards,
Christoph

Hello Christoph,

Thank you for the clarification. I’m currently using debian. I followed the written build instructions ( and also made sure to setup the prerequisites).
Essentially it seems like that I have access to a broader range of variables in the cmake GUI now, including the OGS-BUILD-PROCESS variables such as:
OGS_BUILD_PROCESS_ComponentTra ON
OGS_BUILD_PROCESS_HT ON
OGS_BUILD_PROCESS_HeatConducti ON
OGS_BUILD_PROCESS_HeatTranspor ON
OGS_BUILD_PROCESS_HydroMechani ON
OGS_BUILD_PROCESS_LIE_HM ON
OGS_BUILD_PROCESS_LIE_M ON
OGS_BUILD_PROCESS_LiquidFlow ON

and so on …

But I encounter another issue when running cmake with a preset using cmake --preset release:
After setting up the compiler (build-essential),Cmake, Ninja, Python3 and also getting the source code, I proceeded to the build configuration step.
However, when configuring with a preset, I see the following error:

CMake Error at scripts/cmake/BuildExternalProject.cmake:12 (find_package):
Could not find a package configuration file provided by “VTK” with any of
the following names:

VTKConfig.cmake
vtk-config.cmake

Add the installation prefix of “VTK” to CMAKE_PREFIX_PATH or set “VTK_DIR”
to a directory containing one of the above files. If “VTK” provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
scripts/cmake/BuildExternalProject.cmake:132 (BuildExternalProject_find_package)
scripts/cmake/DependenciesExternalProject.cmake:491 (BuildExternalProject)
CMakeLists.txt:85 (include)

I think cmake is trying to find VTK (Visualization Toolkit), but it cannot locate it on my system.
This issue leads to an error when I want to configure the configuration list after using ccmake:

Configure failed with the following output

By not providing “FindVTK.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “VTK”, but
CMake did not find one.

Could not find a package configuration file provided by “VTK” (requested
version 9.3.0) with any of the following names:

 VTKConfig.cmake
 vtk-config.cmake

Add the installation prefix of “VTK” to CMAKE_PREFIX_PATH or set “VTK_DIR”
to a directory containing one of the above files. If “VTK” provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
CMakeLists.txt:85 (include)

Maybe it is helpful to mention something regarding the installation of CMake:
I had it installed already and when I proceeded to run sudo apt install cmake, I see this:
cmake is already the newest version (3.25.1-1).
0 upgraded, 0 newly installed, 0 to remove and 84 not upgraded.

Kind regards,

OK, so do you have VTK installed on your system?

If not, please try that.

Indeed, we do not mention VTK as a prerequisite in the developer guide.
A complication is that installing VTK is optional. OGS can build it if you pass -DOGS_BUILD_VTK=ON to cmake initially:

cmake --preset release -DOGS_BUILD_VTK=ON

If you don’t have VTK installed you can try to make the OGS build process build it. Or is it installed and just not found?

Best regards,
Christoph

I think the problem is with finding the VTK directory and also two specific files:

  • VTKConfig.cmake
  • vtk-config.cmake

When installing VTK I also encountered this warning:

libvtk9.1 is already the newest version (9.1.0+really9.1.0+dfsg2-5).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
python3-paraview : Conflicts: python3-vtk9 but 9.1.0+really9.1.0+dfsg2-5 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

There seems to be a conflict between paraview and vtk

Unfortunately inconsistent systems or conflicting Linux packages is something we can hardly account for on our side. There are so many ways systems can become inconsistent and there are so many different Linux distributions. It’s impossible for us to add hints/guidance in our docs or in OGS’s build scripts.

The possible options I see at the moment are:

  1. Try cmake --preset release -DOGS_BUILD_VTK=ON if you have not done so, yet.
  2. Get your OS back to a clean state (re-installation? If that’s an option for you)
  3. If you only want to run OGS pip install ogs might be enough for you.

Good luck!

Best regards,
Christoph

@AP76 OGS has an automated system which install dependencies into the build directory (or into CPM_SOURCE_CACHE if you configured that. When something goes wrong, it is shown on the first run only, so please delete the build directory (or cpm cache) and reconfigure with cmake. Then send us the complete CMake configure log.

Hello Mr. Bilke,

Thank you for the feedback. I have attached the logs to this reply.

Cmake logs.zip (7.1 KB)

Thanks, but I meant the output of the cmake-command on the command line.

I removed the build directory and then proceeded with the configuration again. I was able to run cmake and configure successfully. Hence I can’t view the error in the log again. I am not sure what exactly changed.
However, in the meantime, before configuration, I can tell you that I reinstalled ogstools and ogs via pip.

Here is the log after successful configuration:

Generator: Unix Makefiles
OGS VERSION: 6.5.4-183-g069c1fee (reported by git)
Using GNU gold linker. (GNU gold (GNU Binutils for Debian 2.40) 1.16
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
)
Number of (logical) cores: 4, Free memory: 7223 MB
Job pool light_tasks using 4 cores.
Job pool heavy_tasks using 1 cores.
Could NOT find GEOTIFF (missing: libgeotiff_INCLUDE_DIR xtiff_INCLUDE_DIR)
VTK_OPTIONS:
-DVTK_GROUP_ENABLE_Rendering=DONT_WANT;-DVTK_GROUP_ENABLE_StandAlone=DONT_WANT;-DBUILD_TESTING=OFF;-DVTK_BUILD_EXAMPLES=OFF;-DVTK_BUILD_TESTING=OFF;-DVTK_ENABLE_WRAPPING=OFF;-DVTK_USE_64BIT_IDS=ON;-DVTK_MODULE
_ENABLE_VTK_IOXML=YES;-DVTK_MODULE_ENABLE_VTK_IOLegacy=YES;-DVTK_MODULE_ENABLE_VTK_FiltersGeneral=YES;-DVTK_MODULE_ENABLE_VTK_FiltersParallel=YES;-DVTK_MODULE_ENABLE_VTK_FiltersSources=YES;-DBUILD_SHARED_LIBS=
OFF;-DCMAKE_BUILD_TYPE=Release
Searching VTK on system with components: IOXML;IOLegacy;FiltersGeneral;FiltersParallel;FiltersSources
Dependencies.cmake
CPM: Adding package [email protected] (v1.16.0)
CPM: Adding package autocheck@0 (e388ecbb31c49fc2724c8d0436da313b6edca7fd)
CPM: Adding package [email protected] (v1.15.0)
Build spdlog: 1.15.0
Build type: Release
CPM: Adding package [email protected] (81b3d2a0c47895c22e9bb8c577f5ab521f76e5d2)
CPM: Adding package [email protected] (v2.13.2)
pybind11 v2.13.2
CPM: Adding package [email protected] (3.5.0-1)
CPM: Adding package [email protected] (3.4.90)
CPM: Adding package [email protected] (1.82.0)
Boost: Release build, static libraries, MPI OFF, Python OFF, testing OFF
Boost: libraries included: math;property_tree;algorithm;smart_ptr;tokenizer;assign;dynamic_bitset;range;variant;interprocess
Boost.Math: standalone mode OFF
Found the following ICU libraries:
data (required): /usr/lib/x86_64-linux-gnu/libicudata.so
i18n (required): /usr/lib/x86_64-linux-gnu/libicui18n.so
uc (required): /usr/lib/x86_64-linux-gnu/libicuuc.so
Boost.Thread: threading API is pthread
CPM: Using local package [email protected]
CPM: Adding package [email protected] (v0.4.2)
CPM: Adding package [email protected] (3.10.5)
CPM: Adding package [email protected] (0.0.3)
CPM: Adding package [email protected] (0.12.0)
[range-v3]: C++ std=2a
CPM: Adding package vtkdiff@0 (628c4694783f865d7f0ab3ba9bdd5530ce4567e9)
CPM: vtkdiff: Using local package [email protected]
CPM: Adding package [email protected] (374ee63abf605ab4c6639989bebc5096881f4f57)
CPM: Adding package [email protected] (8bd6bad750b2b0d90800c632cf18e8ee93ad72d7)
CMake Deprecation Warning at build/_deps/gklib-src/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument value or use a … suffix to tell
CMake that the project does not need compatibility with older versions.

 CPM: Adding package [email protected] (v5.2.1)

CMake Deprecation Warning at build/_deps/metis-src/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument value or use a … suffix to tell
CMake that the project does not need compatibility with older versions.

End Dependencies.cmake
time-command is required for time wrapper but was not found! All corresponding tests are disabled.

The following packages have been found:

  • Python (required version >= 3.9)
  • Doxygen (required version >= 1.9.2)
  • OpenMP
  • BLAS
  • ZLIB
  • HDF5 (required version >= 1.10.7)
  • ICU
  • Threads
  • TIFF
  • Boost
  • MPI
  • LibXml2

– The following features have been enabled:

  • OGS, The OGS simulator (OGS_BUILD_CLI)
  • Utilities, Command line tools (OGS_BUILD_UTILS)
  • Tests, Unit and benchmarks tests (OGS_BUILD_TESTING)
  • build-unity, Unity build (OGS_USE_UNITY_BUILDS)

All processes have been enabled.

Configuring done

There are some issues I have encountered. Firstly, as I view the configuration list and follow the instructions in the tutorial of the complete workflow, I noticed that the option OGS-USE-PYTHON is missing and instead I have OGS-USE-PIP. Can they be used interchangeably? Or should I necessarily have the former?
Further, after configuration and generation of the make files and then running

make -j8

, I received a warning and an error:

The warning:

[ 3%] Building CXX object _deps/iphreeqc-build/CMakeFiles/IPhreeqc.dir/src/IPhreeqc.cpp.o
In file included from /home/aparsi/ogs/build/_deps/boost-src/libs/container/src/dlmalloc_ext_2_8_6.c:52,
from /home/aparsi/ogs/build/_deps/boost-src/libs/container/src/alloc_lib.c:24:
In function ‘internal_multialloc_arrays’,
inlined from ‘boost_cont_multialloc_arrays’ at /home/aparsi/ogs/build/_deps/boost-src/libs/container/src/dlmalloc_ext_2_8_6.c:1112:13:
/home/aparsi/ogs/build/_deps/boost-src/libs/container/src/dlmalloc_ext_2_8_6.c:1085:41: warning: iteration 2305843009213693951 invokes undefined behavior [-Waggressive-loop-optimizations]
1085 | size = request2size(sizes[i]*element_size);
| ^
/home/aparsi/ogs/build/_deps/boost-src/libs/container/src/dlmalloc_2_8_6.c:2231:6: note: in definition of macro ‘request2size’
2231 | (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req))
| ^~~
/home/aparsi/ogs/build/_deps/boost-src/libs/container/src/dlmalloc_ext_2_8_6.c:1083:24: note: within this loop
1083 | for(++i; i != next_i; ++i) {
| ^~~~~~~
[ 3%] Linking CXX static library ../lib/libCMakeInfoLib.a

The error:

[ 48%] Building CXX object MeshLib/CMakeFiles/MeshLib.dir/Unity/unity_0_cxx.cxx.o
In file included from /usr/include/hdf5/openmpi/hdf5.h:22,
from /home/aparsi/ogs/MeshLib/IO/XDMF/HdfData.h:15,
from /home/aparsi/ogs/MeshLib/IO/XDMF/HdfData.cpp:10,
from /home/aparsi/ogs/build/MeshLib/CMakeFiles/MeshLib.dir/Unity/unity_3_cxx.cxx:3:
/usr/include/hdf5/openmpi/H5public.h:68:10: fatal error: mpi.h: No such file or directory
68 | #include <mpi.h>
| ^~~~~~~
compilation terminated.
make[2]: *** [MeshLib/CMakeFiles/MeshLib.dir/build.make:93: MeshLib/CMakeFiles/MeshLib.dir/Unity/unity_3_cxx.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs…
In file included from /usr/include/hdf5/openmpi/hdf5.h:22,
from /home/aparsi/ogs/MeshLib/IO/XDMF/HdfWriter.h:14,
from /home/aparsi/ogs/MeshLib/IO/XDMF/XdmfHdfWriter.h:18,
from /home/aparsi/ogs/MeshLib/IO/writeMeshToFile.cpp:19,
from /home/aparsi/ogs/build/MeshLib/CMakeFiles/MeshLib.dir/Unity/unity_2_cxx.cxx:11:
/usr/include/hdf5/openmpi/H5public.h:68:10: fatal error: mpi.h: No such file or directory
68 | #include <mpi.h>
| ^~~~~~~
compilation terminated.
make[2]: *** [MeshLib/CMakeFiles/MeshLib.dir/build.make:109: MeshLib/CMakeFiles/MeshLib.dir/Unity/unity_2_cxx.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:8376: MeshLib/CMakeFiles/MeshLib.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Regards,

Regarding the error:

You have hdf5 installed on your system which was compiled against OpenMPI but you want to compile ogs without OpenMPI (PETSc) - support. This mismatch can be fixed when you let OGS compile HDF5 by itself with the following CMake-option:

cmake [your other options] -DOGS_BUILD_HDF5=ON

Thank you for the solution!
It is resolved and seems like the compilation goes further than before.
Though the following errors occurred when I compile the project using 8 cores (make -j8):

[ 83%] Building CXX object ProcessLib/HeatTransportBHE/CMakeFiles/HeatTransportBHE.dir/Unity/unity_0_cxx.cxx.o
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [ProcessLib/HeatTransportBHE/CMakeFiles/HeatTransportBHE.dir/build.make:109: ProcessLib/HeatTransportBHE/CMakeFiles/HeatTransportBHE.dir/Unity/unity_0_cxx.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:9091: ProcessLib/HeatTransportBHE/CMakeFiles/HeatTransportBHE.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [ProcessLib/ComponentTransport/CMakeFiles/ComponentTransport.dir/build.make:93: ProcessLib/ComponentTransport/CMakeFiles/ComponentTransport.dir/Unity/unity_0_cxx.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:8938: ProcessLib/ComponentTransport/CMakeFiles/ComponentTransport.dir/all] Error 2
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [ProcessLib/LIE/HydroMechanics/CMakeFiles/LIE_HM.dir/build.make:93: ProcessLib/LIE/HydroMechanics/CMakeFiles/LIE_HM.dir/Unity/unity_0_cxx.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:9297: ProcessLib/LIE/HydroMechanics/CMakeFiles/LIE_HM.dir/all] Error 2

And the following error when I run it with two cores (make -j2):

[ 83%] Building CXX object ProcessLib/HydroMechanics/CMakeFiles/HydroMechanics.dir/Unity/unity_0_cxx.cxx.o
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [ProcessLib/ComponentTransport/CMakeFiles/ComponentTransport.dir/build.make:93: ProcessLib/ComponentTransport/CMakeFiles/ComponentTransport.dir/Unity/unity_0_cxx.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:8938: ProcessLib/ComponentTransport/CMakeFiles/ComponentTransport.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[ 83%] Linking CXX static library ../../lib/libHydroMechanics.a
[ 83%] Built target HydroMechanics
make: *** [Makefile:166: all] Error 2

I do not think this has something to do with my system, as it has 8 cores, 16 GB RAM.

OGS compilation is quite resource-hungry. If you build with make then please use one or two cores (compilation of one process implementation can take up to 10 GB RAM).

The following CMake option also reduces RAM usage during compilation:

-DOGS_EIGEN_DYNAMIC_SHAPE_MATRICES=ON

See also this page: Build

The compilation was successfully completed. Thank you for the replies @bilke and @chleh .