Commit Graph

443 Commits

Author SHA1 Message Date
Arne Morten Kvarving
54d895af29 fixed: downloaded libfmt with a super build
have to check that it has not been populated before.
we have to push two variables up to the parent scope
2023-11-24 11:12:04 +01:00
Arne Morten Kvarving
2497c62f25 fixed: refine the libfmt fetchcontent approach
rather than doing a full MakeAvailable, only download,
prepare then use from source directory
2023-11-22 15:19:49 +01:00
Arne Morten Kvarving
d9ca8694ae changed: vendor cjson using FetchContent 2023-11-22 10:46:13 +01:00
Arne Morten Kvarving
76d769960e changed: vendor libfmt using FetchContent 2023-11-22 08:21:05 +01:00
Arne Morten Kvarving
e2566b1487 changed: vendor pybind11 using FetchContent 2023-11-16 09:49:34 +01:00
Kjetil Olsen Lye
df80891256
Fail if Damaris is requested and not found
In the current setup, `USE_DAMARIS_LIB` is set to `OFF` by default, but setting it to `ON` does not issue an error if Damaris is not found. This issues an error if `USE_DAMARIS_LIB==ON` and Damaris is not found.
2023-11-10 11:59:08 +01:00
David Landa Marban
9588947ee3 Fix to linker error in building tests (clang, macOS) 2023-11-01 10:04:23 +01:00
Markus Blatt
ce7e010010 Use LESS comparison to test if system is at least 64bit.
Indeed this is clearer and better.
2023-10-25 08:17:20 +02:00
Markus Blatt
8ec7378dd4 Make CMake fail on non-64bit systems.
Running simulations on those does not make sense as it seriously
limits the time span that can be simulated. In addition the OPM code
neglects 32bit issues at various places as it was written at a time
where 64bit was already ubiquitous.

Currently, we would fail in some regression tests on 32bit
systems. With this change CMake will already check whether it is run
on a 64bit system and already fail if this is not the case.
2023-10-11 21:53:54 +02:00
Arne Morten Kvarving
9d8826c2e5 fixed typo in status message 2023-09-26 14:53:45 +02:00
Arne Morten Kvarving
4041f9cc69 remove prereqs file for opm-vertex
this module is defunct and has been defunct for
10 years by now.
2023-09-26 14:53:45 +02:00
Arne Morten Kvarving
ca864e4be9 changed: remove generation of .pc files
this has been broken for a long time, yielding files
containing cmake target names in the linker lines.
2023-09-26 14:53:45 +02:00
Arne Morten Kvarving
02fc95d0f7 remove trailing semicolon in package dependency list
causes a cmake warning,
"Empty dependency in find module for dune-polygongrid (check for trailing semi-colon)"
2023-04-28 09:43:02 +02:00
Arne Morten Kvarving
344e920956 remove unused cmake module 2023-04-28 08:26:31 +02:00
Bård Skaflestad
c5d25fa663
Merge pull request #3436 from hnil/fem-withpolygrid
fixed error if dune-fem is buildt with polygongrid
2023-03-17 13:46:26 +01:00
Arne Morten Kvarving
215fdae47d changed: remove explicit option to enable/disable quadmath
not necessary as it is now only used for relevant targets
you can still use the generic -DCMAKE_DISABLE_FIND_PACKAGE_QuadMath=1 if you
so desire
2023-03-16 09:07:13 +01:00
Arne Morten Kvarving
1ef0492763 sync FindQuadMath with dune
while at it, change to FindQuadMath, not FindQuadmath
2023-03-16 09:07:13 +01:00
Arne Morten Kvarving
d0b6546a38 fixed: quote in case of no existing flags
this can happen for fortran flags as opm is not
using fortran itself (but it's potentially enabled
by BLAS)
2023-03-15 10:26:40 +01:00
hnil
29e35211de fixed extra comment 2023-03-14 10:13:13 +01:00
hnil
8cf9efbcf6 fixed error if dune-fem is buildt with polygongrid 2023-03-09 11:41:04 +01:00
Arne Morten Kvarving
d5f895901f fixed: allow reconfiguring with a different WITH_NDEBUG value
in particular we have to make sure to remove the -UNDEBUG value from the
flags, as these are cached so any values previously added will still be
used
2023-03-08 09:40:03 +01:00
Arne Morten Kvarving
ccfc3d6ac3 fixed: do not append to flags to CMAKE_CXX_FLAGS
this should only be set on the target if using QuadMath.
every time cmake was rerun a build directory new entry was added,
leading to very long compile commands eventually.
2022-12-21 11:03:12 +01:00
Atgeirr Flø Rasmussen
2b437cbd11
Merge pull request #3205 from blattms/skip-compile-checks
Make sure compilation is not tested when searching for DUNE/OPM module
2022-11-07 14:53:26 +01:00
Markus Blatt
87a4017e06 Make sure compilation is not tested.
This is broken for DUNE >= 2.8 and dune module that use  OPM.
2022-11-01 22:10:16 +01:00
Atgeirr Flø Rasmussen
5b90e56e75 The commented-out part seems to be necessary, uncommenting. 2022-10-31 10:47:41 +01:00
Atgeirr Flø Rasmussen
1647bba68c Use MPI_FOUND not MPI_Found. 2022-10-19 13:57:25 +02:00
Arne Morten Kvarving
bd3aa76268 fixed: damaris depends on MPI 2022-10-18 13:08:34 +02:00
Arne Morten Kvarving
6c740656bb changed: do not output damaris info if damaris is not requested 2022-10-18 13:08:33 +02:00
Markus Blatt
3f8f4d0362
Merge pull request #3177 from blattms/fix-mult-find-dune-fem
Fixes bug that hit only for multiple find calls.
2022-10-17 11:44:23 +02:00
Markus Blatt
2a2a9748a3 Prevent Zoltan vars from growing with multiple find_package. 2022-10-12 22:57:43 +02:00
Markus Blatt
20e3202067 Make sure HAVE_${MODULE} is always defined in all scopes.
1. Was a normal variable if no test program was compiled before.
  that meant HAVE_DUNE_FEM was not defined even if dune-fem was found.
2. The if-statement checking whether there is something to compile was
   wrong as this is macro and hence prog is not a variable. Resorted
   to comparison to empty string.
2022-10-12 22:56:00 +02:00
Atgeirr Flø Rasmussen
6c8120abe6
Merge pull request #3176 from akva2/damaris_cmake_script
add cmake script for damaris handling
2022-10-12 14:39:36 +02:00
Markus Blatt
499663f048
Merge pull request #3175 from blattms/fix-mssing-targets-for-multiple-cmake-runs
[cmake] Search for modules/packages each time a search is triggered.
2022-10-12 13:45:16 +02:00
Arne Morten Kvarving
64964c3afe add cmake script for damaris handling 2022-10-12 11:16:43 +02:00
Markus Blatt
2b87eecd68 Search for modules/packages each time a search is triggered.
This is essential if find package modules define imported
targets (usual for modern Cmake). Without this rerunning Cmake another
time in a non-clean build directory will abort with errors if imported
targets are used. E.g. with
```

CMake Error at /home/mblatt/src/dune/opm-2.9/opm-common/cmake/Modules/OpmSatellites.cmake:320 (add_executable):
  Target "test_mpiutil" links to target "ParMETIS::ParMETIS" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  CMakeLists.txt:308 (opm_add_test)

CMake Error at /home/mblatt/src/dune/opm-2.9/opm-common/cmake/Modules/OpmSatellites.cmake:320 (add_executable):
  Target "test_mpiutil" links to target "QuadMath::QuadMath" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  CMakeLists.txt:308 (opm_add_test)
```

This will result in multiple searches, but this should be rather fast
due their previous results being cached.
2022-10-11 20:50:46 +02:00
Markus Blatt
991ea3cf0d Allow find_package calls for METIS/Quadmath if targets already exists 2022-10-11 20:46:38 +02:00
Arne Morten Kvarving
57bc9a8f02 added: add headers to library definition
for better IDE integration
2022-10-05 09:18:31 +02:00
Arne Morten Kvarving
90f27b58cd fixed: use proper case in find_package_handle_standard_args 2022-07-27 18:08:52 +02:00
Markus Blatt
819a28a94d Make sure USE_SUPERLU is defined when calling FindSuperLU.cmake
Previously, touching CMakeLists.txt after a first compilation would
trigger compile errors as the two CMake runs were done with
inconsistent parameters (first one without USE_SUPERLU defined and
second one with -DUSE_SUPERLU=ON). Of course that meant that the
options would also differ from module to module, which seems like a
recipe for desaster.

This patch fixes this by moving the definition of the USE_SUPERLU
option to OpmInit.cmake which is included very early in the top most
CMakeLists.txt of each module.

Closes OPM/opm-simulators#3908
2022-06-09 12:26:56 +02:00
Håkon Hægland
fa740678e0 Adds a method get_injection_properties()
Adds a method get_injection_properties() to the Python interface to
Opm::Schedule. This method can be used to get information about
Well::WellInjectionProperties for a given report step.

In order to avoid code duplication between opm-simulators and opm-common,
logic in CMakeLists.txt was refactored out into
cmake/Modules/PyInstallPrefix.cmake
2022-05-20 06:27:29 +02:00
Markus Blatt
cec7cffe7a Do not hard-code shared-libs in package configuration if not needed.
We usually list all libraries that might be needed for linking in the
CMake package configuration files. This is needed when building static
libraries as we do not yet use CMake targets (which would allow to
list them differently). As we are doing this unconditionally and
also including the ones listed in modules that we depend on, changing
a library (e.g. moving from Python 3.9 to 3.10) requires a complete
rebuild of all modules to get rid of the stale dependency on
libpython3.9.

At least when building shared libraries listing the dependencies is
not needed and this patch simply removes all shared libraries form the
list in the CMake package configuration file. Thus we only need to
recompile the modules that have direct dependency on a stale library.
2022-05-06 10:49:46 +02:00
Markus Blatt
b8ab89591a Make not finding Quadmath non-fatal (e.g. not available on arm64)
Quadmath is usually unused except when a dependency uses it and
explicitly puts QuadMath::QuadMath into their CMake package
configuration file.

On most platforms the compiler has Quadmath available by
default. But on those that don't we should not stop CMake and fail.
Hence now we only print a message that Quadmath is not available.
2022-04-29 09:18:50 +02:00
Markus Blatt
ecde5ebc8c
Merge pull request #2995 from blattms/use-dune-buildsystem-defaults
Use dune buildsystem defaults for MPI SuperLU, and Quadmath
2022-04-20 19:43:09 +02:00
Markus Blatt
85837a71a5 Require UMFPack
A direct coarse solver of AMG is needed for good convergence and umfpack
was tested to work better than SuperLU previously. Hence we now require it.
2022-04-20 17:31:24 +02:00
Markus Blatt
2f726690e7 Always build with MPI and search for SuperLU and Quadmath.
Concerning MPI, both DUNE and OPM must be compiled with the
same default. For DUNE that is to used MPI if it is found.
With the previous default Cmake in opm-grid would fail for
DUNE 2.8

Even if SuperLU is found umfpack will be used as the coarse
solver for AMG. But if dune-fem is used  that will need SuperL
if it is on the system otherwise linking will fail for DUNE 2.8

Quadmath is used by dune-fem if it is found and linking of flow
will fail in this case for DUNE 2.8 if we did not search for it.
2022-04-20 17:31:23 +02:00
Markus Blatt
0cdfeae0e5 Added CMake variable to prevent timestamps in flow binary packages.
One can now set the variable OPM_BINARY_PACKAGE_VERSION to a
meaningful version string (Debian 11.2: 2021.10-4). When building
outside of git it will be used as the project hash. If the variable is
non-empty there will also be no timestamp in project-timestamp.hh (as
this would break reproducible builds).

Note that if building from git or not setting the variable then everything
will be like before.
2022-03-23 22:53:43 +01:00
Markus Blatt
283d7b3dce Do not try to get git hashes for version if built from tarballs. 2022-03-23 22:37:31 +01:00
Joakim Hove
9685946196
Merge pull request #2799 from akva2/fix_suitesparse_warning
changed: use STRING type
2021-10-29 16:39:51 +02:00
Arne Morten Kvarving
fecd879840 changed: use STRING type
there is no such thing as INT type in cmake
2021-10-29 14:25:41 +02:00
Arne Morten Kvarving
c979f25d02 fix cjson find module
the param to find_package_handle_standard_args should match module name
2021-10-29 13:15:47 +02:00