Commit Graph

3722 Commits

Author SHA1 Message Date
Roland Kaufmann
b78deb0982 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-25 10:49:09 +02:00
Roland Kaufmann
b6d7eb6364 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-25 09:49:42 +02:00
Roland Kaufmann
e41c56d0da Remove subdirectory from SuiteSparse include
SuiteSparse may or may not be installed in a suitesparse/ directory.

FindSuiteSparse will look in a suitesparse/ subdirectory when trying
to locate umfpack.h, but it will add the full directory to the compiler
command-line (e.g. `-I/usr/include/suitesparse`) and not that of the
parent. Since the parent is usually included too, it is not noticed
that it is advertedly using another include paths than its own.

However, if we have SuiteSparse installed in a non-system location,
using the subdirectory in the `#include` statement may now cause an
error, even though configuration actually found SuiteSparse!
2013-08-25 09:35:51 +02:00
Roland Kaufmann
e8ec217c52 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-25 09:26:21 +02:00
Roland Kaufmann
bb19cecf72 Always keep debug bundle near executable on Mac OS X
There isn't a /usr/lib/debug directory as on Linux.
2013-08-25 01:25:55 +02:00
Roland Kaufmann
74fdd3e25b 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-25 01:25:26 +02:00
Roland Kaufmann
8337669389 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-25 00:51:30 +02:00
Roland Kaufmann
f9551f9dc7 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-24 22:36:11 +02:00
Roland Kaufmann
cb111bc07b 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-24 22:26:42 +02:00
Andreas Lauser
b29d5ceb65 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-24 12:54:08 +02:00
Bård Skaflestad
f493d11720 Merge remote-tracking branch 'upstream/master' 2013-08-24 00:38:11 +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
Roland Kaufmann
0f8e9aad2a Alert package maintainer about versioned dir option
If someone is going to backport these packages, they may have an
interest in using versioned directories. These will most likely
attempt to set directories on the build command line, thus it is
most natural to insert a suggestion about this option there.
2013-08-23 22:46:12 +02:00
Roland Kaufmann
844705eb0c 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-23 22:40:25 +02:00
Roland Kaufmann
6deeb5dfa5 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-23 22:28:43 +02:00
Andreas Lauser
48ec4f0754 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-23 21:10:02 +02:00
Bård Skaflestad
3b5f12ecf2 Merge remote-tracking branch 'upstream/master' 2013-08-23 20:51:45 +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
acb8cef550 Merge remote-tracking branch 'upstream/master' 2013-08-21 22:33:33 +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
a4f51616da Merge remote-tracking branch 'upstream/master' 2013-08-21 18:54:07 +02: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
Andreas Lauser
64ff0aebd3 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-21 15:47:32 +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
a07ad48b1f Merge remote-tracking branch 'upstream/master' 2013-08-19 23:54:28 +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
65c90c07bd Merge remote-tracking branch 'upstream/master' 2013-08-17 14:45:40 +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
3d796768db Merge remote-tracking branch 'upstream/master' 2013-08-16 12:34:14 +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