Commit Graph

388 Commits

Author SHA1 Message Date
Markus Blatt
4bb23ecf5a [cmake] Use scotch include dir for parmetis bindings of scotch.
The parmetis.h distributed via the parmetis binding of scotch
with Ubuntu 18.04 (libscotchparmetis-dev) includes the header
scotch.h located in /usr/include/scotch/. Therefore our check
of the include file failed. With this commit we check the
parmetis.h header another time with the scotch include path added.
Now parmetis is found on my Ubuntu.
2020-10-28 13:48:57 +01:00
Markus Blatt
7c30586fde Only compile code if non-empty code was submitted for DUNE/OPM.
Also make the search fail if the compilation fails.
2020-08-11 00:53:45 +02:00
Markus Blatt
d5388ba653 Fix compile check for dune-geometry from DUNE>2.7
Dune::Geometry::makeQuadrilateral() is deprecated since 2.6 and has recently
been removed. We are using now using Dune::GeometryTypes::quadrilateral
2020-08-11 00:25:23 +02:00
Arne Morten Kvarving
64cbbdde65 add a cmake flag to disable warnings 2020-06-09 15:11:44 +02:00
Arne Morten Kvarving
1d3843cef1 changed: move build timestamp to separate header
to avoid rebuilds for things only needing project versions
2020-06-08 10:06:03 +02:00
Markus Blatt
9452796c57 Send error for required but disabled packages.
When using CMAKE_DISABLE_FIND_PACKAGE_<name>=ON for a required package
CMake did not issue an errors since we never trigger the find_package
call. With this commit we now check whether such package is required
and send an error.
2020-05-20 14:55:52 +02:00
Markus Blatt
eeb63d8694
Merge pull request #1758 from blattms/mark-openmp-as-prereq
Mark OpenMP as prerequisite for opm-common
2020-04-29 12:57:02 +02:00
Joakim Hove
ad536b718b
Merge pull request #1754 from blattms/find-zoltan-only-with-mpi
[CMake] Find Zoltan only if MPI is available.
2020-04-28 14:50:08 +02:00
Markus Blatt
a87e6f281d Quietly searcg for OpenMP in opm-common-prereqs.cmake 2020-04-28 12:58:39 +02:00
Markus Blatt
b6dd398c32 Find Zoltan only if MPI is available.
Otherwise we experience compilation errors if OPM is configured with
deactivated MPI and activated and found dune-alugrid (cpmpile error
that mpi.h is not found). This commit fixes this for me.
2020-04-27 16:00:49 +02:00
Markus Blatt
0ebe62a1d5 Use OpenMP::OpenMP_CXX target when linking libopmcommon
This should allow downstream to automatically use the correct
compile and linke flags for CMake > 3.9. For older versions
we fall back to the old approach.

Closes #1751
2020-04-27 12:54:18 +02:00
Joakim Hove
7a2394ae12 Set flag for embedded Python in the opm-common-config.cmake file 2020-04-17 14:14:26 +02:00
Markus Blatt
8e3ba156a6
Merge pull request #1675 from blattms/refactor-policy-settings
Fix policy warnings
2020-04-15 21:01:35 +02:00
Markus Blatt
8816549f2f Try to set CMP0048 to NEW as we do not use VERSION 2020-04-15 14:17:53 +02:00
Markus Blatt
eb22f6cfd9 [CMake] Set PATH instead of LOCATION. 2020-04-15 14:17:53 +02:00
Markus Blatt
6707263385 DUNE does not need special treatment.
No need to set *_ROOT for it, which triggers a CMP0074 warning
as the policy settings do not survive find_package calls.
2020-04-15 14:17:53 +02:00
Markus Blatt
636ce45596 Set policy CMP0074 to NEW.
We have been using  <PackageName>_ROOT like it is intended now.
2020-04-15 14:17:53 +02:00
Markus Blatt
742d8943ca Move policy settings to OpmInit and into a macro OpmSetPolicies().
OpmInit.cmake is one of the first includes and most importantly before
the opm-*-prereqs.cmake files are include. The macro is needed to make
the policies set in all CMakefiles. OpmSetPolicies should be called in
the toplevel CMakeLists.txt file.

This fixes a lot of warnings experienced in downstream modules that
got triggered by the opm-*-prereqs.cmake files. At some calls the
policies were at other not.

On the other hand new warnings about soon to be deprecated policies
CMP0026 and CMP0048 appear at least for cmake version 3.13.4.
But that should be fixed in another PR.
2020-04-15 14:17:53 +02:00
Arne Morten Kvarving
2f2cbea424 changed: add option for using clang with libstdc++
when using clang, whether or not we should link to stdc++fs
cannot easily be detected. it depends on the c++ lib used
(libstdc++ vs libc++), as well as the versions of these.

to avoid messing up in general, this adds an option for forcing
linking to stdc++fs, even when using clang. it defaults to false
to not break existing build setups where it works. is required
for building on jenkins
2020-04-14 11:44:32 +02:00
Arne Morten Kvarving
2a9254e76d added: support for specifying configuration for test 2020-04-03 10:15:29 +02:00
Markus Blatt
c7e70da2c5 Do not call project another time in OpmLibMain
Each project should and does this in their own top level
CMakeLists.cmake at the very beginning anyway.
2020-04-02 19:44:32 +02:00
Joakim Hove
320f9b5510 Emed build timestamp also in UseVersion.cmake 2020-03-31 17:23:25 +02:00
Joakim Hove
fe1ef0a65f Generate BUILD_TIMESTAMP macro with build system 2020-03-30 15:11:48 +02:00
Robert Kloefkorn
8de70f9128 [bugfix][cmake] Fix FindParMETIS check by adding missing
include(CheckIncludeFile).
2020-03-10 15:33:29 +01:00
Arne Morten Kvarving
989d643140
Merge pull request #1509 from blattms/fix-g++-versioncheck-fs
Fix compiler version check for -lstdc++fs
2020-02-25 08:55:07 +01:00
Markus Blatt
31e6f316db Fix compiler version check for -lstdc++fs
There was a typo in the if condition which probably always
made it true. Linking to to -lstdc++fs is needed until
g++-9, see e.g. https://gitlab.kitware.com/cmake/cmake/issues/17834
2020-02-24 22:00:10 +01:00
Arne Morten Kvarving
f76daabbb4 changed: disable building of test suite if Boost::test is not found 2020-02-19 12:25:32 +01:00
Arne Morten Kvarving
2b5a21085c fixed: guess -std=c++17 flag if cmake version is too old
to aid compilation on rhel6
2020-02-17 11:30:26 +01:00
Arne Morten Kvarving
fb75bcd4e2 changed: use std::filesystem instead of boost::filesystem
since we still support g++-7, where filesystem is marked experimental,
we introduce a wrapper header and expose the namespace to use
as Opm::filesystem.

for gcc we unconditionally link with libstdc++fs in the python bindings.
the setup.py stuff links as c code, not c++ code, so it is not
automatically added on any gcc version. this might prove unportable
later.
2020-02-13 12:34:19 +01:00
Arne Morten Kvarving
44f2af0589 changed: do not mess with flags in config file
abi is ensured in other ways now
2020-02-10 11:45:06 +01:00
Arne Morten Kvarving
d8aae55837 changed: remove the CXX11Features module
instead use standard CMake mechanism to set cxx standard to 17
move some of the tests to a OpmCompilerChecks.cmake file
2020-02-10 11:36:56 +01:00
Arne Morten Kvarving
247b5685cc remove libecl from buildsystem, jenkins and packaging 2019-10-16 20:03:08 -05:00
Markus Blatt
a862c14873 Allow building a module with dependencies installed but source lying around.
If you set CMAKE_INSTALL_PREFIX, have the dependencies installed there, but
the source of them lying around in the parent directory of the build
directory, then the build will fail starting with opm-models because
we assume that ../opm-material is a build directory and set opm-material_DIR
to it. CMake will complain about not finding opm-material-config.cmake or
Opm-materialConfig.cmake. With this commit we will only set opm-material_DIR
if the directory contains a file CMakeCache.txt (which should be the case in
a configured build directory.

Directory outline of the failing situation is
- ${CMAKE_INSTALL_PREFIX} # where all dependencies are installed
- parent_dir
|____ opm-common #source dir
|____ opm-material #source dir
|____ ...
|____ build #build directory for current module (e.g. opm-modules)

Change is tested with sibling build

- build
|___ opm-common #build dir
|___ opm-material #build dir
|___ ...

and the dune version of it

- parent_dir
|___ opm-common # source dir
    |____ build # build dir opm-common

|___ opm-material # source dir
    |____ build # build dir opm-material
...
2019-10-16 12:38:51 +02:00
Arne Morten Kvarving
1edf46ffd1 changed: remove ADD_DISABLED_CTEST option
a disabled test is disabled. end of story.
2019-09-09 10:42:29 +02:00
Arne Morten Kvarving
41f18d718c changed: rename ewoms to opm-models 2019-08-23 08:29:28 +02:00
Arne Morten Kvarving
7c15d79a93 changed: run tests in parallel with the 'check' target 2019-08-13 12:35:12 +02:00
Arne Morten Kvarving
a1edb0a1f7 changed: simplify by using built-in support
use built-in support to obtain number of processor cores
instead of custom osx and linux code.
2019-08-13 11:33:43 +02:00
Arne Morten Kvarving
3e078e76b1 fix indenting 2019-07-09 14:39:11 +02:00
Arne Morten Kvarving
43c504593f added: static analysis for targets added using opm_add_test 2019-07-09 10:35:40 +02:00
Arne Morten Kvarving
3e576b6332 added: support object libraries in static analysis macro 2019-07-09 10:35:40 +02:00
Arne Morten Kvarving
748fd20e57 fixed: make sure path is absolute before attempting conversion to relative 2019-07-09 10:35:40 +02:00
Arne Morten Kvarving
8d59054112 fixed: make sure not to re-add static analysis tests 2019-07-09 09:49:16 +02:00
Atgeirr Flø Rasmussen
4de0a7e9e3 Turn on -Wextra and -Wshadow warning flags. 2019-06-25 11:18:47 +02:00
Andreas Lauser
f700053736 opm_add_test(): add condition to specify if a test ought to be compiled by default
this argument is optional and called *drumroll* `DEFAULT_ENABLE_IF`.
2019-03-07 12:44:28 +01:00
Arne Morten Kvarving
199b7d710a fixed: set property for correct test name 2018-11-07 11:33:31 +01:00
Arne Morten Kvarving
d60787188e fixed: simplify boost_dyn_test code and add to opm_add_test as well 2018-11-07 11:33:31 +01:00
Joakim Hove
f279c7e374 Fixed ALBERTA_FOUND to OFF when not found 2018-10-15 09:42:13 +02:00
Markus Blatt
22b38f1031 Also search for Alberta
We do not use it in OPM, but for whatever reason I was experiencing
linker errors (unresolved symbol) when compiling ebos with DUNE 2.6
and g++-8.2. dune-grid exports its alberta wrapper libraries in dune-grid_LIBRARIES. Previously this did not pose a problem. Somehow it does now. If
I strip the libraries from the linker line everything is fine but this
is not a good solution.

Therefore I have added a test for Alberta that is triggered by the test of
dune-grid.
2018-09-27 15:05:04 +02:00
Arne Morten Kvarving
fa85844a9b
Merge pull request #500 from akva2/bash_completion
added: cmake glue for adding bash tab completion for an installed product
2018-09-25 12:32:03 +02:00
Arne Morten Kvarving
564f064392 added: cmake glue for adding bash tab completion for an installed product 2018-09-25 12:31:11 +02:00