Commit Graph

388 Commits

Author SHA1 Message Date
Roland Kaufmann
d847e10d96 Do not warn if just def'ed HAVE_ vars are set to 1
Some configuration scripts probe and just set HAVE_FOO without any
values, whereas others set it explicitly to 1. If these two are mixed,
for instance that the same package is used by two of our prerequisites,
but in different manner, then we get compatibility warnings when we try
to run the configuration script, even though there is no real conflict.

dune-fem, dune-alugrid and dune-localfunctions have this problem (around
release 2018.04).

This patch special-code the test so if the old value was previously
either just defined or explicitly set to the value 1, a warning will not
be issued if then suddenly the other variant is used.
2018-09-21 13:49:39 +02:00
Joakim Hove
90459cac7e Add quotes to ensure string evaluation 2018-09-19 23:33:54 +02:00
Arne Morten Kvarving
4c6d4ee201
Merge pull request #498 from joakim-hove/komodo
Komodo: cmake config changes
2018-09-19 09:08:53 +02:00
Joakim Hove
906ff3f4b5 Add ability to CMAKE variable DIST_PREFIX before find_package(opm--) 2018-09-19 09:07:05 +02:00
Joakim Hove
238d3ddb58 Move CMAKE_MODULE_PATH manipulations before @OPM_PROJECT_EXTRA_CODE@ 2018-09-17 09:12:29 +02:00
Arne Morten Kvarving
d58001f608 improve lto support
need to use the wrappers for ar and ranlib, or static
libraries are problematic.
2018-09-14 10:29:59 +02:00
Alf Birger Rustad
0183fa884a Make compiling with OpenMP default. 2018-08-17 13:39:44 +02:00
Arne Morten Kvarving
0627a9f8ef added: strip test_ prefix from tests added with opm_add_test 2018-08-03 09:58:59 +02:00
Markus Blatt
4a5333887b Research for software if we search for COMPONENTS.
Otherwise we will never search for e.g. Boost multiple
times and the upmost module in the hierarchy will dictate
the components to be used. That does not work for downstream
modules.

Therefore with this change we check whether there is an argument
COMPONENTS passed to find_package and make sure there will be
another call to it if that is the case.
2018-07-13 16:10:32 +02:00
Markus Blatt
563c053d3a Set only ecl_LIBRARIES and nothing else for ecl. 2018-07-12 12:25:21 +02:00
Markus Blatt
cbd44ff67a Remove unneeded opm_common_processed variable.
As we now process the prerequisites in the package configuration file
one search for opm-common is fully sufficient.
2018-07-12 12:25:21 +02:00
Markus Blatt
32dabd6572 Handle prerequisites at the end of package configuration file.
The code in @opm-project_NAME@-prereqs uses macros from OpmPackage.cmake. At
the previous location that file was not yet included for the module opm-common
as this is done in the section @OPM_PROJECT_EXTRA_CODE@, which also sets
CMAKE_MODULE_PATH.
2018-07-12 12:24:43 +02:00
Markus Blatt
3fabf2aad3 Unify handling of package dependency.
There was one macro to do that and one inline code in another
macro. With these changes we always use the macro for this.
2018-07-12 10:45:08 +02:00
Markus Blatt
90cbad1163 Better mark extra code section in opm-project-config.cmake.in 2018-07-06 11:02:50 +02:00
Robert Kloefkorn
13d1ce4fbf [bugfix][Finddune-istl] Add HAVE_SUITESPARSE_UMFPACK for newer dune-istl
versions.
2018-07-02 15:56:03 +02:00
Roland Kaufmann
2356cc35e5 Improve status message when libtool is not present
Libtool uses libtool archive files (.la) to determine how to do a
platform-specific link. To generate these files, it is necessary to have
libtool installed on the system, since it will only accept files with
its own particular version number embedded. If libtool is not installed,
you probably don't need the libtool archive files either, so no .la is
generated. However, the status message sounded like libtool was probed
but not found, and that this was something that you should install.

This patch modifies the status message to make it more clear way libtool
was probed, and what the consequence of a missing libtool is (i.e. no
.la file for you).
2018-06-26 09:22:03 +02:00
Markus Blatt
c6536c0b2f Allow DUNE modules to locate the dune.module files during CMake run.
For this we need to set <dune-module>_PREFIX either to where the module
is installed to or the source directory for a build with uninstalled
modules.
2018-06-18 12:47:53 +02:00
Arne Morten Kvarving
e823b0a93e changed: replace opm-data with new opm-tests repository 2018-03-27 12:09:09 +02:00
Arne Morten Kvarving
726ccd7fd7 Import opm-parser 2018-03-05 10:30:29 +01:00
Markus Blatt
0e25c9f2e9 Always add ecl target to ecl_LIBRARIES.
Otherwise the flow binary does not know the correct
path to libecl in some situations.
2018-03-02 22:15:54 +01:00
Arne Morten Kvarving
cedb010a04 fixed: set the boost dynamic test define if boost::unit_test_framework
is a shared library

additional condition for opm-parser as it forces dyn boost test (not
strictly necessary but it highlights the different behaviour for now)
2018-02-15 07:21:35 +01:00
Arne Morten Kvarving
94f71b730d fixed: prefix created dir with PROJECT_BINARY_DIR to facilitate superbuild 2018-02-13 15:05:49 +01:00
Arne Morten Kvarving
c486e6ebd8 re-add fancy names 2018-02-13 14:10:18 +01:00
Arne Morten Kvarving
535d7df784 changed: add targets for tests even if BUILD_TESTING is off
we still want to be able to build them, just not by default.
ref 'make check' and 'make test-suite'.
2018-02-13 14:10:18 +01:00
Arne Morten Kvarving
c151e09aec changed: filter out some include paths which leads us down a path to bogus 2018-02-13 14:10:18 +01:00
Arne Morten Kvarving
e681b47de2 added: use exported targets 2018-02-13 14:10:18 +01:00
Arne Morten Kvarving
f7c288a3f4 changed: switch to the shared opm build system 2018-02-12 13:36:49 +01:00
Arne Morten Kvarving
3a447d8532 fixed: remove erroneous brace 2018-02-05 11:36:01 +01:00
Arne Morten Kvarving
b4e439fc19 fixed: really handle the _prepare target for tests 2018-01-30 11:51:18 +01:00
Arne Morten Kvarving
d76a15539e
Merge pull request #319 from blattms/slu_dune2.6_full
added: support building with superlu for dune 2.6 (complete version)
2018-01-30 10:38:38 +01:00
Atgeirr Flø Rasmussen
b46348f074
Merge pull request #321 from akva2/super_build
Some changes to facilitate building using a super project
2018-01-29 16:28:09 +01:00
Atgeirr Flø Rasmussen
c7b5799071
Merge pull request #320 from blattms/support-dune-uggrid
Support dune-uggrid (successor of UG).
2018-01-26 12:24:07 +01:00
Arne Morten Kvarving
bd316fa27f changed: do not require a "fancy name" for tests
earlier the assumption has been that all test executables have a test_ prefix
which was stripped off. now we just use the full name if the prefix is not
found.
2018-01-24 12:32:45 +01:00
Markus Blatt
3dff53ec16 [squash] fix typo in comment 2018-01-22 15:45:50 +01:00
Arne Morten Kvarving
5e0157f407 added: support building with superlu for dune 2.6 2018-01-22 15:29:44 +01:00
Arne Morten Kvarving
d0fa9ce9dc changed: remove hack for dunecontrol+autotools compatibility
all supported dune versions have cmake builds which should be used
2018-01-22 11:06:36 +01:00
Arne Morten Kvarving
a3a0f90811 check for the existence of a opmmodule_prepare target
if it exists, add this as a dependecy for satellites
2018-01-19 16:33:13 +01:00
Arne Morten Kvarving
2b8ee5a82d changed: check for existing target before importing
to aid use of a super project for opm
2018-01-19 14:35:58 +01:00
Arne Morten Kvarving
4e9f15dec3 changed: use ${project}. to aid use of a super-project for opm 2018-01-19 14:35:58 +01:00
Markus Blatt
3681fe0800 Support dune-uggrid (successor of UG). 2018-01-18 22:39:40 +01:00
Arne Morten Kvarving
4340691ff8 added: handle QuadMath support like MPI 2018-01-17 15:57:48 +01:00
Arne Morten Kvarving
de7f4e168d fixed: we need to do mpi disabling earlier
if not, prereqs do not see this file, and the option ends
up not being operational for prereqs looking for MPI.
2018-01-17 15:57:16 +01:00
Arne Morten Kvarving
8fc5283b05
Merge pull request #306 from blattms/fix-pr-304
Include <module>-prereqs.cmake in <module>-config.cmake to process all dependencies
2017-12-21 14:00:32 +01:00
Markus Blatt
4c0625aa8b Include <module>-prereqs.cmake in <module>-config.cmake for transitive search
Otherwise implicit dependencies are never search for. That was the case
for dune-geometry and dune-grid when configuring opm-core as these are only
transitively required via opm-grid.

With this commit we include <module>-prereqs.cmake in <module>-config.cmake
and thus trigger searches for all modules that this module depends on.

We also install the file now <module>-prereqs.cmake as we need it for
installed modules, too.
2017-12-21 12:52:33 +00:00
Arne Morten Kvarving
3a60e567bb fixed: this test code slipped through in 9737538708
sorry about that
2017-12-21 13:05:00 +01:00
Arne Morten Kvarving
9737538708 changed: get rid of find modules for opm modules
use pure config mode.

we no longer compile a test application for the libraries,
however checks have been tightened by making sure version of
all opm modules are the same.

this allows for putting prereqs directly in the module repositories
2017-12-20 11:12:01 +01:00
Atgeirr Flø Rasmussen
a346cf5e16
Merge pull request #285 from akva2/add_ndebug_option
added: option to not define NDEBUG for release builds
2017-11-28 07:30:42 +01:00
Atgeirr Flø Rasmussen
2204a160cf
Merge pull request #291 from akva2/fix_core_test_program
fixed: do not use ParameterGroup code in opm-core test program
2017-11-27 13:21:38 +01:00
Arne Morten Kvarving
af503d2c48 fixed: do not use ParameterGroup code in opm-core test program
it now sits in opm-common. yields confusing output as test
program compilation will succeed even if opm-common but not opm-core
is available
2017-11-24 12:44:03 +01:00
Andreas Lauser
2c6db2a109 remove the configure wrapper script
this used to provide autotools compatibility, but it has not been working for a while. Thus it is IMO better to remove it in order not to mislead people.
2017-11-24 10:37:40 +01:00
Arne Morten Kvarving
439aae72d2 added: option to not define NDEBUG for release builds 2017-11-13 12:16:23 +01:00
Markus Blatt
4a46e4a4cd Only set the library directories if module builds a library. 2017-11-08 14:58:38 +01:00
Arne Morten Kvarving
d0c1eb28e3
Merge pull request #281 from andlaus/opm-simulators_no_umfpack_required
don't mark UMFpack as required for opm-simulators
2017-10-30 11:05:32 +01:00
Atgeirr Flø Rasmussen
1709398e25 Remove RT lib dependency. 2017-10-27 10:09:25 +02:00
Atgeirr Flø Rasmussen
de70cdcb52 Library not needed nor found on macOS. 2017-10-26 11:08:10 +02:00
Atgeirr Flø Rasmussen
5519643aa4 Always set include-related CMake variables. 2017-10-26 10:51:18 +02:00
Andreas Lauser
fe7938d82a don't mark UMFpack as required for opm-simulators
before OPM/opm-simulators#1309 it was required, but this was not
enforced by the build system because the SuiteSparse tests are run by
the opm-core build system first and UMFpack is optional there.

thanks to [at]akva2 and [at]blattms for the heads-up.
2017-10-25 16:48:33 +02:00
Markus Blatt
8e58ea8567 Print package version and origin only for found modules. 2017-10-20 12:37:34 +02:00
Markus Blatt
c030dd865c Use module_DIR as the location in found status message. 2017-10-20 12:36:51 +02:00
Markus Blatt
63dd29ceb0 Use the module version that CMake exports directly.
Since all supported DUNE versions have a CMake based build system,
when can drop the magic and use the module version exported by CMake
directly.

The magic used previously was broken when setting CMAKE_INSTALL_LIBDIR to
an absolute path.
2017-10-20 12:31:17 +02:00
Arne Morten Kvarving
f8cac9cf3f remove stale file 2017-10-19 13:46:01 +02:00
Kai Bao
e7b1172528 adding UMFpack to prerequisite of opm-simulators 2017-10-16 21:17:28 +02:00
Arne Morten Kvarving
e1f7da13d2 Merge pull request #273 from blattms/cmakify-sibling-search
Simplify dune/opm module search by relying on cmake package config files
2017-10-16 20:02:27 +02:00
Markus Blatt
6715ed6d48 Allow multiple find_package calls in config mode 2017-10-13 21:35:24 +02:00
Markus Blatt
5662f2a188 Allow second search for opm-common to get all its dependencies and defines.
As opm-common is search in the toplevel CMakeLists.txt of each module in
config mode and the dependencies and defines are only processed in
opm_find_package(opm-common), we allow a second search using module mode
to trigger opm_find_package.
2017-10-13 21:20:30 +02:00
Markus Blatt
db0a52ffdb Force module mode in search for dune and opm even if *_DIR is set.
Otherwise some defines and macros will not be set as this is done
in opm_find_package. This might also make sense for dunecontrol
which always will set *_DIR.
2017-10-13 21:19:11 +02:00
Markus Blatt
c7fc21e343 Stop setting COMPARE_(SUMMARY|ECL)_COMAND in Findopm-output.cmake.
Theses variables are already set in opm-output-config.cmake. Unfortunately,
theres is still a bug there which will be fixed by a PR in opm-output. After
that everything should work and have less guess work in it.
2017-10-11 14:37:21 +02:00
Markus Blatt
7a891baef7 Use correct default clone directory in sibling search for ecl.
Previously we assumed it to be ecl (like the project name).
That is not correct. With this commit we now use the correct
default clone directory, libecl, in the sibling search.
2017-10-10 12:44:22 +02:00
Markus Blatt
fc4bac6b7a Suppress message "finding .. using module mode" for OPM modules. 2017-10-10 12:42:49 +02:00
Markus Blatt
7c779697c7 Deactivate package cache and activate sibling search for ecl.
Even though people are telling that ecl is already found using
sibling search it turned out that this statement is false. It
was always found using the CMake package cache. When installing
this lead to the installed package using ecl from the build tree.
With this commit we first try to find ecl without the package cache
but maybe using sibling search. Building installed packages no works
by setting -DSIBLING_SEARCH=Off -DCMAKE_INSTALL_PREFIX=/install/path
2017-10-06 22:36:40 +02:00
Arne Morten Kvarving
e6e5491c74 add HAVE_SUITESPARSE_UMFPACK to opm-simulators config.h 2017-09-29 23:19:48 +02:00
Arne Morten Kvarving
48472bcf1a typo: SUITEPARSE -> SUITESPARSE 2017-09-29 21:13:10 +02:00
Arne Morten Kvarving
fd411cb1b7 Merge pull request #259 from blattms/fix-check-for-opm-grid-with-dune-2.5
Fix check for opm grid with dune 2.5
2017-09-29 20:21:40 +02:00
Markus Blatt
38e198d961 Always append CONFIG_VARS to ${module}_CONFIG_VARS.
It seems like this variable was not empty for e.g. dune-grid
and therefore we did not add some necessary defines before this
commit.
2017-09-29 11:02:14 +02:00
Arne Morten Kvarving
3283278090 Merge pull request #265 from akva2/add_another_alias
add another alias for UMFPACK
2017-09-27 08:44:06 +02:00
Markus Blatt
f5bf291f7d Simplify dune/opm module search by relying on cmake package configuration files.
We use ${module}_DIR to set the correct path when sibling search is activated.
The package configuration files set all the necessary variable and we save
us a lot of CMake magic.
2017-09-26 16:49:18 +02:00
Arne Morten Kvarving
9646753a10 changed: update opm-flowdiagnostics-applications prereqs
it is now ecl, not ERT
2017-09-26 13:48:03 +02:00
Arne Morten Kvarving
0ea57b9054 Merge pull request #268 from andlaus/compile-ONLY_COMPILE
also compile tests marked `ONLY_COMPILE` on `make test-suite`
2017-09-22 11:46:16 +02:00
Arne Morten Kvarving
8c9776688d add option to enable PETSc
disabled by default
2017-09-10 06:18:48 +02:00
Andreas Lauser
4b60de7248 also compile tests marked ONLY_COMPILE on make test-suite 2017-09-03 17:44:22 +02:00
Arne Morten Kvarving
e3ff47dd9f changed: add option to disable superlu
make this default to off.

additionally, check that the found superlu version
is compatible with the dune-istl version in use.
in particular superlu5 is not compatible with dune-istl 2.4
2017-08-21 16:49:47 +02:00
Arne Morten Kvarving
0a9bae6587 add another alias for UMFPACK
used by dune 2.5
2017-08-16 12:25:20 +02:00
Markus Blatt
f8841cea15 Search for same header as used in compile test of Findopm-grid.cmake 2017-06-21 13:23:05 +00:00
Markus Blatt
3dd214ba34 Include geometry version in config.h.
This is needed with DUNE 2.5 as otherwise the includes of
geometry headers are for older DUNE versions.
2017-06-21 13:15:12 +00:00
Markus Blatt
ef5f730786 Make check for opm-grid work with DUNE 2.5.
Previously, we checked for header CpGrid.hpp which finally
tried to include the non-existent generic geometry headers
as the checks for dune-geometry versions do not work during
 a CMake run.
With this patch we search for the header GlobalIdMapper.hpp which
does not use any version checks and therefore works for every DUNE
version.
2017-06-21 13:15:12 +00:00
Jørgen Kvalsvik
62c2b15c29 Don't exit early when checking dynamic boost 2017-06-15 14:39:27 +02:00
Jørgen Kvalsvik
5df5c59c27 Add find_package(Boost) in Findopm-parser 2017-06-15 10:04:35 +02:00
Markus Blatt
5c731bf2ce Stop marking non-stored variables as advanced. 2017-06-13 11:09:11 +02:00
Markus Blatt
bea6eb9240 Removed dead code. 2017-06-13 10:21:54 +02:00
Markus Blatt
5500dcfe8b Pass sibling dirs HINTS to find_package calls for opm-parser.
These take precendence over the package registry where we have no control
on which entry will be used. The registry is only the last resort.

On some Linux version the most recently created package registry key will
be used. Please not that an entry is only created for a build try that is
not already in the registry. If there is already key, then not even the
modification date of the key will be updated. This default behaviour might
lead to strange mixes of build configurations.
2017-06-12 21:13:58 +02:00
Arne Morten Kvarving
51208ac4f5 add static analysis support 2017-06-09 15:46:21 +02:00
Arne Morten Kvarving
cdbcb74e5e add static analysis support to buildsystem 2017-06-02 10:38:54 +02:00
Jørgen Kvalsvik
fbec9b1e0d Findopm-parser tries CONFIG mode first
CONFIG mode is usually a fallback when Find* modules are not found, but
opm-parser is now mainly meant to be used with config mode, so it's the
first thing being tried. If that fails, continue with the old logic.

Some legacy requires HAVE_ERT being set somewhere, so this logic is
injected here.
2017-05-31 21:51:35 +02:00
Jørgen Kvalsvik
2b342ce3f0 ERT -> ecl 2017-05-31 14:54:19 +02:00
Markus Blatt
cd4c0f54fb Allow using external static libraries with BUILD_SHARED_LIBS=ON
Previously, this failed if one dependency was a static library compiled
without -fPIC. This is is the case for library libsuitesparseconfig on
Debian which has no dynamic alternative. The error messages read e.g.

```
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libsuitesparseconfig.a(SuiteSparse_config.o): relocation R_X86_64_PC32 against undefined symbol `malloc@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
```

With this patch we change the target_link_libraries call when using
BUILD_SHARED_LIBS=ON. We only pass the dynamic libraries as PUBLIC such
that they will get linked to the library. The static ones are passed as
INTERFACE libraries. This means that they will be automatically linked
to executables which link to the main library. Currently this transitive
linking will only work in the same module as we do not correctly export
libraries. But our build system explicitly links the others ones anyway.
2017-05-18 20:37:31 +02:00
Alf B. Rustad
6332d56c2c Change release build optimization from -O2 to -O3 2017-05-16 11:17:19 +02:00
Arne Morten Kvarving
e86d9b8b73 fix opm-core test
namespace has been removed
2017-04-28 15:32:18 +02:00
Arne Morten Kvarving
7d7dd7e582 remove tinyxml from opm-core requirements 2017-04-28 11:19:43 +02:00
Joakim Hove
d1a3e4a872 Change ert -> libecl
- The travis build will use Statoi/libecl
 - The FindERT cmake module has been updated to look for both ert/ and
   libecl/
2017-04-18 20:32:02 +02:00
Atgeirr Flø Rasmussen
176d0b188e Merge pull request #194 from blattms/support-c++14-for-dune-2.5
dune 2.5 support
2017-04-07 21:02:12 +02:00