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).
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.
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.
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!
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.
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.
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.
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.
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.
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)
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.
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.
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)
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...)
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.
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.
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).