Commit Graph

3570 Commits

Author SHA1 Message Date
Roland Kaufmann
ccf4fcae12 Change from pass-by-value to pass-by-const-ref
The object is copied when put into the list, so there should be no
danger of dangling references.
2013-08-26 14:33:23 +02:00
Roland Kaufmann
542d607674 Remove dependency on Boost::Signals
The functionality has been replaced with equivalents from C++11.
2013-08-26 13:11:25 +02:00
Roland Kaufmann
e9bd8464b2 Replace old timestep completed event with new scheme 2013-08-26 13:08:49 +02:00
Roland Kaufmann
3156d0749a Add classes for event-handling
The new classes Event and EventSource can be used as a simple mechanism
for implementing event-based callbacks in the simulators.
2013-08-26 12:52:03 +02:00
Bård Skaflestad
889f8d7e49 Merge pull request #337 from rolk/337_boost
Fix prerequisite Boost components across modules
2013-08-23 15:37:19 -07:00
Roland Kaufmann
6aec9fc64b opm-autodiff needs filesystem component of Boost
Also, it really should be the same as the rest to make sure that we
pick up the right components when we look for the Boost library.
2013-08-23 23:24:47 +02:00
Bård Skaflestad
089e755735 Merge pull request #330 from rolk/330_underscore
Simplify creation of Fortran function wrappers
2013-08-23 11:43:48 -07:00
Roland Kaufmann
ae49042e91 Simplify creation of Fortran function wrappers
The old version invoked a Fortran compiler to figure out the bindings
necessary to link to a Fortran function. This creates a dependency on
having a Fortran compiler, even though the project may not have any
Fortran source it needs to compile!

Also, the Fortran compiler that is installed on the system may not be
the same as was used to compile the library anyway, so we are not even
sure that this is correct!

Furthermore, FindLAPACK operates on the assumption that names in that
library is suffixed with a single underscore, so if that is not correct,
we won't find any of the functions in that library anyway!

Thus, this patch enables us to assume that appending an underscore is
the right thing to do without using the compiler. This option is off by
default, but can be activated with USE_UNDERSCORING=ON (named after the
GFortran option).
2013-08-23 12:57:17 +02:00
Bård Skaflestad
7b882ceaca Merge pull request #328 from rolk/328_warn
Issue a CMake warning if client project is incompatible
2013-08-21 13:03:53 -07:00
Bård Skaflestad
6f4e663346 Merge pull request #325 from rolk/325_eigen
Make probe for Eigen3 part of the common build system
2013-08-21 09:46:18 -07:00
Roland Kaufmann
544be42166 Issue a CMake warning if client project is incompatible
This puts a test into the ${project}-config.cmake file which warns
if the client project is built with a variable which is incompatible
with the build of opm-core.

Consider this minimal project:

    cmake_minimum_required (VERSION 2.8)
    set (HAVE_MPI 1)
    find_package (opm-core)

If linked with `-Dopm-core_DIR=` path to an opm-core tree which is
build *without* MPI-support, this will issue a warning when building
the client project.

This doesn't catch all cases (if a variable isn't defined, we cannot
know if it is an omission or if it has intentionally been left blank),
but at least it catches some.
2013-08-21 18:41:29 +02:00
Bård Skaflestad
259ec164d4 Merge pull request #324 from rolk/324_alugrid
Only require METIS if ALUGrid is built for parallel
2013-08-21 09:26:16 -07:00
Bård Skaflestad
0bd1ae2ec5 Merge pull request #327 from rolk/327_disable
Don't search for disabled packages
2013-08-21 09:14:50 -07:00
Roland Kaufmann
d1020930db Don't search for disabled packages
Setting CMAKE_DISABLE_FIND_PACKAGE_xxx flag should make find_package
not doing anything, but this does not seem to work with older versions
of CMake. Anyway, we can test this flag and make sure that we don't
call find_package in that case.

Also includes a check for both upper- and same-case versions of found
flag, as some modules, most notably Boost, does not set the upper-case
version of their _FOUND flag; this tests for both.
2013-08-21 17:53:01 +02:00
Roland Kaufmann
953080a31e Add support for Eigen3 in Autotools compatibility layer 2013-08-20 20:46:13 +02:00
Roland Kaufmann
ee05e73c61 Require the newer 3.1 version of Eigen 2013-08-20 20:42:18 +02:00
Roland Kaufmann
db7cb6a5af Search common suffixes for include files
This allows us to set e.g. -DEIGEN3_ROOT=/usr/local, and have the
files actually be located in /usr/local/include/eigen3
2013-08-20 20:39:18 +02:00
Roland Kaufmann
fb1eed6226 Use standard code to handle not found case
Instead of setting EIGEN3_FOUND ourselves, rely on the standard method
to check arguments and raise an error if not found.
2013-08-20 20:39:04 +02:00
Roland Kaufmann
b8ba56de28 Allow mixed case name in variable (as for package)
Since the package is named Eigen3 (in mixed case), we should allow
for the variable to be named this way, too.
2013-08-20 20:38:52 +02:00
Roland Kaufmann
b848d37d2f Allow user to specify path to Eigen3 library
By setting EIGEN3_ROOT, we can point directly to the path of the
library checkout we want to use. No other searching will then take
place.

Notice that if you have found an Eigen3 installation in a previous
configure, it will not find a new version even if you introduce the
EIGEN3_ROOT variable!
2013-08-20 20:38:36 +02:00
Roland Kaufmann
c964d55817 Add Eigen3 CMake find module
Imported from cmake/FindEigen3.cmake in Eigen 3.1. It is licensed
under the 2-clause BSD, which should be compatible with GPL as long
as the build system is distributed as source.
2013-08-20 20:35:24 +02:00
Roland Kaufmann
ad68a14672 Only require METIS if ALUGrid is built for parallel
If we have a parallel ALUGrid, then we must also link with METIS. If
METIS is not available, then parallel ALUGrid should be disabled. If
we have a serial-only ALUGrid, then METIS is not required.
2013-08-20 20:18:10 +02:00
Bård Skaflestad
20241ebfd3 Merge pull request #323 from rolk/323_case
Allow found-variable to be named as package
2013-08-19 14:54:17 -07:00
Roland Kaufmann
ed2d6788c7 Allow found-variable to be named as package
Boost does not set the BOOST_FOUND variable to indicate that the
package is found (as it would if it had used the usual routine
find_package_handle_standard_args), but rather Boost_FOUND. This
patch tests for that condition, and print some more helpful debug
messages if a prerequisite is missing.
2013-08-19 20:38:15 +02:00
Bård Skaflestad
14b2d65319 Merge pull request #322 from rolk/322_req
Propagate "requiredness" to prerequisites depending on the package's level
2013-08-17 05:45:14 -07:00
Bård Skaflestad
ed3552cfb5 Merge pull request #319 from rolk/319_confvar
Trim unnecessary config.h defines from prerequisite list
2013-08-17 05:37:35 -07:00
Roland Kaufmann
d32e2d8047 Propagate REQUIRED and QUIET according to parent level
If an optional package require further packages, those packages should
not be marked as REQUIRED because CMake will then terminate the
configuration if it is not found (although it is transitively optional).

Conversely, we should be able to specify REQUIRED prerequisites for
REQUIRED packages and have a failure cascade up to termination.

This changeset allows us to specify REQUIRED or not in the list of
prerequisites, and have OpmPackage sort of whether it should be honored
or not.
2013-08-16 22:13:04 +02:00
Roland Kaufmann
2363a70d46 Only search for a package again if not found
If it is already found, most packages sets a flag that makes it exit
immediately anyway. We usually cannot rerun find_package to get another
combinations of modules. Here we check the flag before we start looking
for the package to avoid the endless stream of messages.
2013-08-16 21:56:08 +02:00
Roland Kaufmann
788dd5e485 OPM-Material module must have DUNE Common and DUNE ISTL 2013-08-16 21:48:28 +02:00
Roland Kaufmann
527b20ebf2 Set standard variables for package after probing
Standard variables must be set in order for the package to be picked
up with the OpmFind/OpmPackage dance.
2013-08-16 21:47:51 +02:00
Bård Skaflestad
cf07c2d8ed Merge pull request #320 from rolk/320_build
Put in hooks to change build directory later
2013-08-16 03:31:02 -07:00
Bård Skaflestad
849e2618a4 Merge pull request #317 from andlaus/cmake_improvements
Cmake improvements
2013-08-16 03:29:46 -07:00
Andreas Lauser
6eb962fa10 FindALUGrid.cmake: incorperate Roland's comments to PR 317 2013-08-15 12:41:50 +02:00
Roland Kaufmann
d15e657cac Search for directory containing build scripts
Currently only the source tree is "searched", but the template could
be expanded to look in another/more locations (or be specified
explicitly on the command-line with a --with-opm-macros= option)
2013-08-15 09:50:26 +02:00
Roland Kaufmann
f3d1f6ab11 Allow source location to be overridden
By default the configure script assumes that the source is located
relative to the script itself. By allowing this to be overridden, the
script can be shared by other projects, each passing their own location
as an extra parameter.
2013-08-15 00:03:21 +02:00
Roland Kaufmann
e14cb185ad Add a small bootstrapper to locate build system
Currently this bootstrapper only finds the macros that are located
in the cmake/ tree in this project. Projects that don't carry their
own build system can specify search locations here.
2013-08-15 00:03:17 +02:00
Roland Kaufmann
3df0f06f45 Use OPM_MACROS_ROOT to locate build scripts
By using a separate variable for this we can easily grep for where
the build system depends on its own location, and also change the
policy regarding this later.

Note that there is no opm-macros module; this is a "psuedo"-module
which links to an additional one (currently, the one we're in)
2013-08-14 21:26:28 +02:00
Roland Kaufmann
1922201a31 Show how to install CMake macros together with code
Currently this is disabled because no other project needs them (they
have their own copy in the source tree)
2013-08-14 21:19:41 +02:00
Roland Kaufmann
1e46bdaaa8 Allow adding project-specific install targets
If a project needs to install something that is very specific and not
in the general build, it can use this hook to setup additional targets.
2013-08-14 21:16:55 +02:00
Andreas Lauser
c928891e8e tweak the configure script
we should recognize the --with-{alugrid,metis} options...
2013-08-14 20:51:36 +02:00
Andreas Lauser
5d1353901e make the FindALUGrid module compatible with the OPM build system 2013-08-14 20:51:22 +02:00
Andreas Lauser
55786cd290 add cmake module to detect ewoms 2013-08-14 20:51:22 +02:00
Andreas Lauser
d57f97b78d Add HAVE_CXA_DEMANGE config.h variable to Finddune-common.cmake
This will make Dune::classname usable on Dune master. (the 2.2 release
should be fine even without it.)
2013-08-14 20:51:22 +02:00
Andreas Lauser
8c2d544581 Finddune-grid.cmake: test for ALUGrid and METIS
ALUGrid is needed to avoid unresolved symbols if dune-grid was
compiled with it. METIS is used by the parallel version of
ALUGrid. (Although it is not open source...)
2013-08-14 20:51:22 +02:00
Andreas Lauser
845bac2c7d add cmake modules to find ALUGrid and METIS 2013-08-14 20:51:22 +02:00
Andreas Lauser
982344c1a2 CMake: add module for dune-localfunctions 2013-08-14 20:51:22 +02:00
Roland Kaufmann
8e4225fbb9 Add defines that are used in compilation modules
This define is used in a opm/*.c* file, but only there, and should
therefore be in config.h, but not added to the list that only clients
must also provide.
2013-08-14 20:49:52 +02:00
Roland Kaufmann
0ace127e8c Trim unnecessarily required config vars
The modules declare which configuration variables they need to have
present in config.h, not only their own but also defined in projects
using them.

However, a lot of these variables are not actually used in the headers!

This changeset removes all HAVE_XXX variables which is not present in
any opm/*.h* file in these projects, and thus there is no need for the
client to specify.

Note that only the variables used by the module *itself* should be
listed; the build system will setup the complete list from the
prerequisites.
2013-08-14 20:40:22 +02:00
Roland Kaufmann
ea1afba738 Put HAVE_DYNAMIC_BOOST_TEST in config.h for tests only
This define is used by the unit tests; there is no reason why it should
be on the list that must be provided by other projects that use our
headers (the other projects don't use our tests).
2013-08-14 20:28:16 +02:00
Bård Skaflestad
65e0b36724 Merge pull request #318 from rolk/318_gridver
Publicly depend on version of dune-grid
2013-08-14 05:30:45 -07:00