Commit Graph

237 Commits

Author SHA1 Message Date
Bård Skaflestad
7d86ae5453 Revert " Add special variable for MultiArch-unaware components"
This reverts commit 1cadc5af6d.
2013-09-24 15:24:58 +02:00
Bård Skaflestad
9f411d6179 Revert " Use MultiArch-unaware path for dune.module"
This reverts commit 512d49c41a.
2013-09-24 15:24:48 +02:00
Tor Harald Sandve
512d49c41a Use MultiArch-unaware path for dune.module
As of 2013-09 the DUNE code that reads dune.module is not MultiArch-
aware. Thus, for a 64-bit platform it will look in lib/ on Debian and
lib64/ on RHEL.
2013-09-19 10:25:37 +02:00
Tor Harald Sandve
1cadc5af6d Add special variable for MultiArch-unaware components
Some components are not yet MultiArch-aware and installs to either
lib/ (Debian) or lib64/ (RHEL) on 64-bit platforms. If we need to
interface with these components, then it is nice to have such a
variable set together with the regular detection code.
2013-09-19 10:25:37 +02:00
Andreas Lauser
15ff9d8076 require opm-core from the opm-material module
this is required to use the exception code of opm-core in
opm-material. Also, the Dune prerequisites of opm-material can be
removed once PR #345 is merged into opm-core...
2013-09-11 13:16:53 +02:00
Andreas Lauser
c28f2bc0a0 C++-11 Features: add test for std::is_integral 2013-09-05 13:00:45 +02:00
Roland Kaufmann
5b954096fd Search after new Eigen3 versions in sibling dirs
If we have checked out a newer Eigen3 directory in a sibling directory
to ours, assume that this is because the system version is obsolete and
that we want to use this one instead.
2013-09-02 10:08:32 +02:00
Roland Kaufmann
3c678f06e4 If given build tree as Eigen3 root, find source
Eigen3 is a template-library, so we must compile the source code
directly together with ours instead of linking to a library.

If the build script gives us the location of a "built" Eigen3,
meaning a directory in which CMake has been run, locate the true
source directory from the cache entries.
2013-09-02 09:47:53 +02:00
Roland Kaufmann
f43d6e0019 Print version number in log together with location 2013-08-28 13:21:27 +02:00
Roland Kaufmann
84cc9f5f98 Always search for dune.module in no-arch lib-dir
The previous version may have ended up in lib64/ instead of lib/;
now we remove the arch-specific suffix from the path, and always
use the no-arch version.
2013-08-28 13:21:26 +02:00
Roland Kaufmann
a066aa519c Noarch lib-dir was only used in one wrong place
dune.module does not contain any paths to architecture-specific
binaries. It is therefore always installed in no-arch lib/ directory.
Thus, there is no need to have a variable for this, and there was
no other users of this variable either.
2013-08-28 13:21:26 +02:00
Roland Kaufmann
eb1086a2b8 Mimic Autotools way to specify non-standard Boost
If Boost is installed in say /usr/include/boost141 and
/usr/lib64/boost141, then there is no root you can specify to pick
them both up. However, whereas Autotools uses --with-boost and
--with-boost-libdir, FindBoost in CMake changes to using two different
variables: BOOST_INCLUDEDIR and BOOST_LIBRARYDIR. Using the header
directory for BOOST_ROOT will not work (in particularily not with
old CMake versions).
2013-08-28 13:21:25 +02:00
Roland Kaufmann
779e366f73 Special handling for some recognized env. vars.
CMake does not like that you specify the compiler with the environment
variables, instead preferring that you set them as cache variables.
This layer translate between the names of the the two.
2013-08-28 13:21:24 +02:00
Roland Kaufmann
82410bda3e Test ERT for a newer API level
We use an ERT version which needs to know whether at least this
function signature exists. The earlier implementation covers too
many versions.
2013-08-28 13:21:24 +02:00
Roland Kaufmann
ab8a507e49 Allow spec of not commonly rooted incl and lib dir
Header and library directory may be specified separately by using the
variables e.g. OPM_CORE_INCLUDE_DIR and OPM_CORE_LIB_DIR. These override
even the OPM_CORE_ROOT. This allows us to use a backported version which
uses versioned directory names.
2013-08-27 09:24:36 +02:00
Roland Kaufmann
8c71f4d75b Support installation in a versioned directory
If the option USE_VERSIONED_DIR is set to ON (default is OFF), then
most files are installed in a ${suite}-${label}/ subdirectory
(e.g. header files go in "/usr/include/opm-2013.03/"). This enables
us to easily install backports of newer versions on systems which
have a system package for an older one, without getting conflicts.
2013-08-27 09:24:35 +02:00
Roland Kaufmann
433d33e008 Remove bash4-isms from configuration script
Getting uppercase of a string can be done in a way that is compatible
with Bash 3.2. This creates a dependency on the `tr` utility, but I
reckon it will/can be available everywhere Bash 3.2 is.
2013-08-27 09:24:34 +02:00
Roland Kaufmann
5cc1f0a34c Use libc++ runtime if necessary for C++11 compliance
If we are using the Apple toolchain on MacOS X, we must use the
newer runtime and not the old GCC 4.2 fork, in order to get the
C++11 library features (such as std::shared_ptr).
2013-08-27 09:24:34 +02:00
Roland Kaufmann
e5d2b5994e Remove linker command from compiler command-line
There is no SuiteSparse headers or libraries in
/System/Library/Frameworks/Accelerate.framework on MacOS X, so adding
this directive won't contribute anything other than compiler warnings.
2013-08-27 09:24:33 +02:00
Roland Kaufmann
dcc917c2c4 Always keep debug bundle near executable on Mac OS X
There isn't a /usr/lib/debug directory as on Linux.
2013-08-27 09:24:32 +02:00
Roland Kaufmann
d43ff3c003 Strip debug symbols to separate file on MacOS X
The standard Xcode toolchain on MacOS X uses strip and dsymutil, not
objcopy as the GNU toolchain does.
2013-08-27 09:24:32 +02:00
Roland Kaufmann
fc040a44ed Refactor code to separate extensions from filename
The earlier code assumed that the version information always follows
the full file path; this code splits the path up into various parts
so that this may be changed.
2013-08-27 09:24:31 +02:00
Roland Kaufmann
cd771b7d3e Only install debug symbols if they are in separate file
If the strip utility is not present, debug symbols won't be in a
separate file and subsequently cannot be installed.
2013-08-27 09:24:30 +02:00
Roland Kaufmann
751296cf5f Report version of Mac OS X in configuration log
If we are building on Mac OS X, use the official operating system
version (e.g. 10.8) instead of the kernel version (e.g. 12.4).
2013-08-27 09:24:30 +02:00
Andreas Lauser
217db0dd31 avoid to make ALUGRID_PARALLEL_FOUND a list
because -- at least on one of my systems -- a list evaluates to false,
even if all entries are true...
2013-08-27 09:24:29 +02:00
Roland Kaufmann
3dbcb66a21 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-27 09:24:28 +02:00
Roland Kaufmann
1002b55a2f Remove dependency on Boost::Signals
The functionality has been replaced with equivalents from C++11.
2013-08-27 09:24:28 +02:00
Andreas Lauser
a9b287f472 cmake: fix the SuperLU test
for me, it was completely broken. (it worked fine if you did not want
to use it, though.) Now it (hopefully) follows the standard OPM
variable naming conventions, allows to use the internal SuperLU BLAS
library, and works fine if superLU is not installed on a system-wide
basis.

v2: cache the POST_2005 variable to make writing it to config.h more
    reliable (on my kubuntu 13.04 system it did not work without it)
v3: re-add a proper "post 2005" check from newer versions of the dune tests
2013-08-27 09:24:27 +02:00
Andreas Lauser
2a92529ff2 fix the test for the quadmath library
Seems like I forgot to include the "CheckCSourceCompiles" macro before
using it. Since it worked for me before, I'm wondering what made this
happen. Anyway, it should now work correctly in all cases.
2013-08-27 09:24:26 +02:00
Roland Kaufmann
972f8cdf0a Allow build tree of SuiteSparse to be used as root
With this changeset, the build tree of SuiteSparse can be used as the
root; the package does not have to be installed.
2013-08-27 09:24:26 +02:00
Andreas Lauser
ed5f17a471 add opm-material to the eWoms prerequisites
this is needed by the imminent switch of eWoms to the OPM build
system.
2013-08-27 09:24:25 +02:00
Roland Kaufmann
5d5e18c2ce Mark known feature variables as used
Some features, such as the Fortran wrappers, are enabled by options,
and it may be usable to have those set in a common definition file.

However, as these features are included conditionally based on use,
their option variables may not exist in other projects, giving a CMake
warning for them.

Here we list such variables too. Reading them at the end corresponds
to the Autotools convention of ignoring unknown --enable-xxx options.
2013-08-27 09:24:24 +02:00
Andreas Lauser
fd781af125 cmake: do not quote variables for config.h anymore
v2: incorporate Roland's nitpicks (I hope)
v3: It was decided that it's better to change the default behavior
v4: make sure the CMake syntax is correct even if the value of the
    variable contains spaces (if it contains double quotes it's a
    different matter, but that's pretty much a corner case, IMHO)
v5: properly escape backslash and double quote characters in the cmake
    syntax
2013-08-27 09:24:23 +02:00
Roland Kaufmann
a64118cb81 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-27 09:24:22 +02:00
Roland Kaufmann
9d19b116d7 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 22:16:31 +02:00
Roland Kaufmann
aa07341edb 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-21 22:16:11 +02:00
Roland Kaufmann
92ea4c55a2 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 22:16:06 +02:00
Roland Kaufmann
fab7284717 Add support for Eigen3 in Autotools compatibility layer 2013-08-20 20:48:24 +02:00
Roland Kaufmann
dec561bb44 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 21:36:59 +02:00
Roland Kaufmann
3ff19f011a 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-19 20:01:25 +02:00
Roland Kaufmann
ae727487f5 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-19 20:01:25 +02:00
Roland Kaufmann
b3947b0ff3 OPM-Material module must have DUNE Common and DUNE ISTL 2013-08-19 20:01:24 +02:00
Roland Kaufmann
c3249a256a 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-19 20:01:23 +02:00
Roland Kaufmann
1b953dce5f 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-19 20:01:23 +02:00
Roland Kaufmann
fa32d2a03e 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-19 20:01:22 +02:00
Roland Kaufmann
6537f63307 Require the newer 3.1 version of Eigen 2013-08-17 00:04:05 +02:00
Roland Kaufmann
dcc972f128 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-16 23:55:44 +02:00
Roland Kaufmann
e4a345a648 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-16 23:55:43 +02:00
Roland Kaufmann
0f841e1bdf 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-16 23:55:42 +02:00
Andreas Lauser
15631d2ab1 FindALUGrid.cmake: incorperate Roland's comments to PR 317 2013-08-16 23:55:42 +02:00
Andreas Lauser
eed47decf2 tweak the configure script
we should recognize the --with-{alugrid,metis} options...
2013-08-16 23:55:41 +02:00
Andreas Lauser
044e07be58 make the FindALUGrid module compatible with the OPM build system 2013-08-16 23:55:40 +02:00
Andreas Lauser
00c5fb427c add cmake module to detect ewoms 2013-08-16 23:55:40 +02:00
Andreas Lauser
00344dc20f 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-16 23:55:39 +02:00
Andreas Lauser
b5c27dbe7d 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-16 23:55:38 +02:00
Andreas Lauser
9ef6a91bb5 add cmake modules to find ALUGrid and METIS 2013-08-16 23:55:37 +02:00
Andreas Lauser
1ae9e7cb89 CMake: add module for dune-localfunctions 2013-08-16 23:55:37 +02:00
Roland Kaufmann
2789809858 Publicly depend on version of dune-grid
The interface of the class PersistentContainer changed between DUNE
2.2 and DUNE 2.3 in an incompatible way, so we need to present
different versions of the class depending on the version of DUNE linked
with. This changeset adds the version variables for dune-grid to the
list of publicly necessary #defines that must go into using
dune-cornerpoint.

Notice that this will cause the definition of DUNE_GRID_VERSION_XXX
to be added to the flags list of dune-cornerpoint. This can be seen as
either a bug or a feature. If you try to link first dune-cornerpoint to
one version and then to another version of DUNE later, there is a very
good chance that you'll end up with problems anyway.
2013-08-16 23:55:36 +02:00
Roland Kaufmann
8ec655e321 Remove support for AGMG from the build system
AGMG is now under a closed-source license, meaning that results
obtained with this solver is not freely reproducible by others.
Its use is therefore discouraged.

As of version 2.3, the DUNE AMG parts are competitive, so there
is a free and open alternative.
2013-08-16 23:55:35 +02:00
Roland Kaufmann
56b910e2ce Use parallel version if and only if MPI is installed 2013-08-16 23:55:34 +02:00
Roland Kaufmann
7e992a2894 Enable use of parallel version of MUMPS
If we have enabled MPI, then we must call MPI_Init and MPI_Finalize
in the program anyway so we may as well use the parallel version of
MUMPS.
2013-08-16 23:55:34 +02:00
Roland Kaufmann
30a7e953a7 Use system-provided MUMPS library for AGMG
This require us to compile in a small glue module which maps the
name of the internal routine to the system routine.
2013-08-16 23:55:33 +02:00
Roland Kaufmann
ff9da40f32 Make opm-core pick up AGMG through the standard list 2013-08-16 23:55:32 +02:00
Roland Kaufmann
6b5ce2e5a5 Allow packages to add source code to the project
By returning a ${package}_SOURCES variable with the names of the code,
it will be propagated to ${project}_SOURCES and subsequently compiled
into the library.

AGMG (Algebraic Multigrid) uses this functionality.
2013-08-16 23:55:32 +02:00
Andreas Lauser
a2d4a32736 make the build system link to the "quadmath" library if it is supported
Thanks a lot to Roland Kaufmann for the support.
2013-08-16 23:55:31 +02:00
Andreas Lauser
cd6f18ed90 add a cmake check for the abi::__cxa_demangle() function
this was also forgotten. sorry...
2013-08-16 23:55:30 +02:00
Andreas Lauser
9f5ab8e257 add test for <type_traits> to FindCXX11Features.cmake
I fogot this one yesterday...
2013-08-16 23:55:30 +02:00
Andreas Lauser
694fc0c98a add and use CMake modules for valgrind client requests and quadruple precision math 2013-08-16 23:55:29 +02:00
Andreas Lauser
6ff3b56b49 also test for std::unique_ptr 2013-08-16 23:55:29 +02:00
Andreas Lauser
113238badb add a few config.h macros useful for dune-common 2013-08-16 23:55:28 +02:00
Andreas Lauser
999d198181 detect the presence of std::shared_ptr
since GCC 4.4 supports it, make it mandatory as well...
2013-08-16 23:55:27 +02:00
Roland Kaufmann
bddcff89f2 OPM Porsol now depends on OPM Material
In the new build scheme, the prerequisites of each module is declared
in this file as the canonical version, and everything else includes it.
2013-08-14 23:39:06 +02:00
Roland Kaufmann
264f3b0747 Fix bug in determining if directory is found
The parenthesis is to make it less ambiguous how the boolean expression
should be evaluated.
2013-08-14 23:39:06 +02:00
Roland Kaufmann
49801f2edf Make available version numbers for these modules 2013-08-14 23:39:06 +02:00
Roland Kaufmann
821a53bfbb Probe DUNE module version number from installation
Figure out where the closest dune.module is, and parse it for
information. The defines are added to config.h, so that our code
may behave differently for various versions available.

It actually works for opm-core 1.0 as well, but don't tell anyone;
we rather want people to use opm/core/version.h instead.

If a module has been backported and installed to a directory which
also contains the version number, e.g. /usr/include/dune-2.3, to
avoid clashing with an existing version in /usr/include, then this
part is now stripped from the include directory and added back to
the lib directory where we are looking for dune.module
2013-08-14 23:39:06 +02:00
Roland Kaufmann
81699b561a Provide hook to configure getting other's version
This hook together with the bundled convenience macro makes it
possible to add the version of another module to config.h using
code like this:

macro (config_hook)
  opm_need_version_of ("dune-common")
endmacro (config_hook)
2013-08-14 23:39:06 +02:00
Roland Kaufmann
de5d5ec7dc Create a set of config variables for implementation
The config variables in _CONFIG_IMPL_VARS are only written to config.h
and not the .pc or -config.cmake files. They can thus only be used by
the implementation files and not the headers. Use this set to avoid
exposing the variables to other projects, when it is likely that a
probe used by that other project may turn up a different result.
2013-08-14 23:39:06 +02:00
Roland Kaufmann
3d366d9cdf Only configure libtool for libraries that exist 2013-08-14 23:39:06 +02:00
Roland Kaufmann
8d3b0fed71 Only build before library target if there is any 2013-08-14 23:39:06 +02:00
Roland Kaufmann
022eb51c8b Allow PCH option to be on even if there is no library 2013-08-14 23:39:06 +02:00
Roland Kaufmann
becba8e93c Upgrade Findopm-material to use separate prerequisite list
This will now be included both by the find module and by the project
file itself.
2013-08-14 23:39:06 +02:00
Roland Kaufmann
6449b08094 Module mode CMake probe for opm-material 2013-08-14 23:39:06 +02:00
Andreas Lauser
a79fcc063a Build system: make it work for modules which do not need libraries 2013-08-14 23:39:05 +02:00
Roland Kaufmann
2ebfa92f4f Have distclean target keep up with build improvements
If you run `cmake --build . -- distclean` all generated files will
now be gone! This adds the files that have been introduced in later
improvements to the build system.
2013-08-14 23:39:05 +02:00
Roland Kaufmann
52a36f77fa Recognize Clang to be a GCC-compatible compiler
Clang aims to be compatible with GCC when it comes to command-line
parameters. Where we enable functionality based on the presence of
a GCC-compiler, we can use the same functionality with Clang.

This patch introduces a new variable CXX_COMPAT_GCC which is true if
the compiler handles the same options as GCC, and this variable is
subsequently used in tests instead of CMAKE_COMPILER_IS_GNUCXX (which
remains if we need to test if we really have GCC, e.g. for version)
2013-08-14 23:39:05 +02:00
Roland Kaufmann
1951f796af Enable support for Ninja build generator
Use the Ninja build generator if '--enable-ninja' is passed on the
command line to ./configure (or of course if -GNinja is passed
directly to CMake).
2013-08-14 23:39:05 +02:00
Roland Kaufmann
354158207d Provide a define for having OpenMP 2013-08-14 23:39:05 +02:00
Roland Kaufmann
8cb420bb7f Only make target if there is any source files
If there is no source files, we set a blank target to signal to the
other components of the build system that they shouldn't be looking
for a library.
2013-08-14 23:39:05 +02:00
Roland Kaufmann
60eb89eb57 Only include library if there is one 2013-08-14 23:39:05 +02:00
Roland Kaufmann
0b6d2f2607 Don't install debug syms for a library that isn't there 2013-08-14 23:39:05 +02:00
Roland Kaufmann
78118e21e3 Support compiling files that are in the attic
Since these files are not actively maintained, we don't assume that
the project actually has any, nor are they part of the default build.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
522acace31 Use new style of prerequisite declaration
The prerequisites are now declared in their own file, so it can be
included by the main system. There is thus only one canonical place
where the list of prerequisites exist.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
188925f3cd Provide CMake find module to locate opm-verteq 2013-08-14 23:39:04 +02:00
Roland Kaufmann
166033ce1f Further classify source files into languages
Other modules (notably the precompiled header one) may set properties
directly on the source file; we need to separate them into categories
for which language they belong to.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
6e2084cf15 Safe-guard against version mismatch
The version declared for the build system (in dune.module) is checked
against what is in the source (e.g. opm/core/version.h) and if these
don't match, then issue an author warning.

This will help us keep the two version numbers in sync., since it
becomes very obvious when we don't. The benefit for this is to not have
the build system start mucking with the code just to dump some static
information in there.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
7b96599c5b OPM Core uses C++11 features as of commit 562bcf2 2013-08-14 23:39:04 +02:00
Roland Kaufmann
ae53847e52 Use RUNPATH in installed library by default
When checking out from source code, the paths that were used to
configure the project should be carried on to the installed binary,
so the same libraries are used without much effort.

By using RUNPATH instead of (just) RPATH, it can be overridden with
LD_LIBRARY_PATH if the user so desires.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
0bac3406dd Only display an error message if C++11 support is noted as REQUIRED 2013-08-14 23:39:04 +02:00
Roland Kaufmann
046a4e6048 Make project buildable also without Git
If Git is not found, revert to just dumping the label into the code.
(We currently have no way of getting the SHA into the tarball).
2013-08-14 23:39:04 +02:00
Roland Kaufmann
c52e62ce88 Probe again later if ERT isn't found now
If we write a blank value into the cache, we tell CMake that ERT isn't
found and it won't check again. If we delete it from the cache in case
we didn't find the directories, then CMake will run the find module
again the next time we configure. Just probing for directories is cheap
so this is no problem. This allows us to install ERT, do a reconfigure
and it will then be picked up by the build system.

If we find ERT and it doesn't compile properly, a blank value will still
be written, and it won't try again the next time, so you must wipe the
cache if you *upgrade* ERT into a newer and more compatible version.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
51c31938b9 Let the AutoTools script disable tests and samples also 2013-08-14 23:39:04 +02:00
Roland Kaufmann
10bc6cd081 Add a switch for examples similar to the one for tests
Running tests during development at least has a purpose, but compiling
all the samples *every* time is just an annoyance.
2013-08-14 23:39:03 +02:00
Roland Kaufmann
7900b3bbfc Disable testing if BUILD_TESTING is switched off
This is an "official" switch for disable testing; our own code which
adds tests should adhere to it. (It is added by CTest)
2013-08-14 23:39:03 +02:00
Roland Kaufmann
48a0099190 Don't update version info in Debug mode
It gets tiresome to rebuild the project everytime one makes changes to
any of the unit tests. We don't likely publish results based on the
debug code anyway, so tracking the version number there is not such a
pressing issue.
2013-08-14 23:39:03 +02:00
Roland Kaufmann
e8e310dfba Make sure that version info is updated before building code
Otherwise, the library may be declared "done" before the version number
process have had any change to touch files it depends upon. This ensures
that the version number is correct before we start building the library.
2013-08-14 23:39:03 +02:00
Roland Kaufmann
be7b392690 Write version information into header file
Akin to config.h, we write project-version.h whenever the VCS sha hash
of the project changes. This file can then be included to embed this
into the project. Since this changes more frequently, we choose another
file than config.h. Care is also taken to not rewrite the header if the
information doesn't change, but the project is rebuilt.
2013-08-14 23:39:03 +02:00
Roland Kaufmann
d16fbf463e Read the label from project info 2013-08-14 23:39:03 +02:00
Roland Kaufmann
76eaf3fc22 Strings must contain ONLY numbers to be integers
The old pattern matched if there was an integer (digit) in the string;
it would have to be all non-digits to be quoted.
2013-08-14 23:39:03 +02:00
Roland Kaufmann
6fa44b6f23 Make sure CMake is re-run if dune.module changes
Version number in this module is included in the name of the library;
if we make changes to dune.module, it should do a complete reconfigure.
2013-08-14 23:39:03 +02:00
Roland Kaufmann
7953a0cdad Read project properties from dune.module
We cannot generate dune.module because that file is read by dunecontrol
before the build starts. It therefore make sense to let it be the
original and let the build system read it instead of duplicating the

This module is a adaption of Andreas Lauser's OpmParseDuneModule
in opm-material, modified to handle the more sparse info provided by
the other modules as well.
2013-08-14 23:39:03 +02:00
Roland Kaufmann
43b2929825 Eliminate _MODULE_DIR variable
It is only used in one place, where it can easily be replaced by its
expansion. The reason for removing it is that it depends on the name
of the project, and I intend to read this using a routine it the very
directory it is including, hence the need for a different approach.
2013-08-14 23:39:03 +02:00
Roland Kaufmann
f856de9817 Parse RHEL5 linker strings better 2013-08-14 23:39:02 +02:00
Roland Kaufmann
44764454a2 Print linker version to log 2013-08-14 23:39:02 +02:00
Roland Kaufmann
b72ebed8c2 Add function to detect linker version
The linker that is used (ld vs. gold for instance) is often hidden
when using the compiler as a front-end (to include the correct
runtime libraries).

These functions enables us to probe the linker version and reports
its finding in the log.
2013-08-14 23:39:02 +02:00
Markus Blatt
cc0631cd65 Adjusts macro documentation to recent change. 2013-08-14 23:39:02 +02:00
Roland Kaufmann
adb57cdd6c Include file list from top-level instead of module-level
Increase the visibility of the source file name include by no longer
putting it in a module, but rather by including it in CMakeLists.txt
2013-08-14 23:39:02 +02:00
Roland Kaufmann
6dae7cf379 Don't include prerequisites here; do it more explicitly
Developers that are working to familiarize themselves with OPM will
probably start out in CMakeLists.txt to figure out where the project
declare its dependencies, thus the list should be referred to from
there instead of inside one of the sub-modules.
2013-08-14 23:39:02 +02:00
Markus Blatt
b2006496c6 Change marker EXCLUDE_ALL to EXCLUDE_FROM_ALL in opm_compile_satellite
Previously, when passing EXCLUDE_ALL to opm_compile_satellite this
resulted a cmake error:

CMake Error at cmake/Modules/UseDebugSymbols.cmake:71 (get_target_property):
  Cannot find source file:

    EXCLUDE_ALL

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx
Call Stack (most recent call first):
  cmake/Modules/OpmSatellites.cmake:77 (strip_debug_symbols)
  CMakeLists.txt:176 (opm_compile_satellites)
2013-08-14 23:39:02 +02:00
Roland Kaufmann
1196201046 Remove the project parameter for the customization hook
The hooks are meant to be project specific, and should therefore
either know their own name or at least have access to a variable with
that name in it.
2013-08-14 23:39:02 +02:00
Roland Kaufmann
b0c5549e30 Common code for building OPM library modules
Most of the OPM libraries follow the same template; this include file
contains all the common code.
2013-08-14 23:39:02 +02:00
Roland Kaufmann
4b305a0822 Get prerequisites from a separate "header" file
Note that the variable containing the dependencies must be expanded
inside quotes; otherwise the list will spill into the argument list!
2013-08-14 23:39:02 +02:00
Roland Kaufmann
25ae6d5cb7 Notify callbacks when a timestep has completed
Client code can do additional processing for the output of each
timestep.
2013-08-14 23:39:02 +02:00
Roland Kaufmann
e5d5c40875 List prerequisites for modules in a separate file
This file can be included both in the project itself, and also in the
find module for the library, so that the list of dependencies can be
maintained in only one place.
2013-08-14 23:39:01 +02:00
Bård Skaflestad
56db862baf Add CMake backwards compatibility for version < 2.8.3
Add features that aren't available in early versions of the 2.8.x
release series, enabling use of 2.8.0 if needed (e.g. Ubuntu 10.04)
2013-08-14 23:39:01 +02:00
Roland Kaufmann
9ee29561c8 Recognize lib dirs that may be used later
This let you specify a bunch of directory names on the command line
to *all* packages, without getting annoying warnings that they are
defined but not used.
2013-08-14 23:02:40 +02:00
Roland Kaufmann
7bf82f96b2 Disable link-time, whole program optimization
When using LTO, the linker calls back to the compiler to figure out
where a certain symbol is defined. However, in many versions there
is apparently a bug that is triggered if a template in inlined in
both a used library and in the main program, but with different
versions of the compiler. The Boost exception class is particular
prone for this.

Thus, we disable the -lto from the development builds by default;
if anyone wants to test of the behaviour of their own compiler, they
must now explicitly turn on this flag.
2013-08-14 22:59:55 +02:00
Andreas Lauser
bec3d5db2c make the c++-2011 feature set of GCC 4.4 mandatory
we now produce an error even if the module in question does not
actually use some of these features.
2013-07-30 21:12:23 +02:00
Andreas Lauser
e6cf509ea9 check for the C++-2011 'auto' keyword.
It seems like the corresponding FindCXX11Features.cmake file
was not updated for this module.
2013-07-30 21:12:23 +02:00
Andreas Lauser
23088686a6 autodiff: make it compatible with dunecontrol
the 'configure' script was missing...
2013-07-30 21:12:23 +02:00
Roland Kaufmann
6b9d1e2da5 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-06-25 14:54:22 +02:00
Roland Kaufmann
eef87e48ad 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-06-25 14:49:11 +02:00
Roland Kaufmann
05e516bb4a 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-06-25 14:49:11 +02:00
Roland Kaufmann
b446ac99e2 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-06-25 14:49:11 +02:00
Atgeirr Flø Rasmussen
6a2b21e04b Refine OpmFind according to Roland Kaufmann's suggestions.
This enables us to restore FindEigen3.cmake to its original
state (as copied from Eigen sources).
2013-05-16 14:18:59 +02:00
Atgeirr Flø Rasmussen
d59363d681 Now Eigen is found properly. 2013-05-16 10:49:05 +02:00
Atgeirr Flø Rasmussen
db95420b98 Add FindEigen3 cmake module. Currently unused. 2013-05-16 10:28:25 +02:00
Bård Skaflestad
116f39e8ab Import CMake support from OPM-Core 2013-05-15 10:24:52 +02:00