Commit Graph

182 Commits

Author SHA1 Message Date
Markus Blatt
35f0f5f5be [cmake,bugfix] Corrects required version and make Eigen3 download work.
At least on Debian requiring version 3.1 of Eigen3 is not sufficient
according to issue #25 the minimum version is 3.1.2. This patch fixes
the required version. In addition it skips the REQUIRED option passed
to find_package(Eigen3) to make the git download work.

Fixes #25.
2014-01-15 13:15:13 +01:00
Andreas Lauser
633dd9c945 configure: fix all except one warning produced by shellcheck
thanks to @bska for pointing this tool out!
2013-11-25 18:33:26 +01:00
Andreas Lauser
d07b201656 fix syntax error in configure shell script
strangly enough, it seems to work like it was in some circumstances...
2013-11-25 13:29:45 +01:00
Roland Kaufmann
847d8fe924 Only add parent directories for actual variants
Otherwise we'll inadvertedly add the root directory and will probably
find the system implementation underneath there.
2013-11-25 11:38:24 +01:00
Roland Kaufmann
47eb8a0549 Only add build sub-directory if it is actually used
Otherwise the search will cascade down one level too many.
2013-11-25 11:38:23 +01:00
Roland Kaufmann
ce569c75d4 Search in build/ sub-dir if only suite root is given
If the package suite was given (e.g. DUNE_ROOT=/blum), then the code
set up the root for each individual package automatically (e.g.
DUNE_COMMON_ROOT=/blum/dune-common), but the path which was then
activated did not get the local build sub-directory (e.g. if we are
building opm-autodiff in /frub/opm-autodiff/build, then the local
build directory is "build/"), and thus this was not appended to the
library search path. The result was that the source was found (because
the root pointed to a valid source tree), but the library was not
(because it is "hidden" in the subdirectory).
2013-11-25 11:38:22 +01:00
Andreas Lauser
4c246092b6 include the latest review comments by Roland Kaufmann 2013-11-25 11:38:21 +01:00
Andreas Lauser
5e73968b57 configure script: add a stub implementation for the --config-cache argument
so far, it is only a flag which prevents the cache from being
deleted. To warn the user about a potential infinite loop, a warning
is printed if this flag was specified and some compiler or some compiler
flags were set by the user. This idea was proposed by Roland Kaufmann.
2013-11-25 11:38:15 +01:00
Andreas Lauser
ba4c7400ba configure script: also delete the cmake cache
This replicates the autotools behavior and was suggested by Roland
Kaufmann.
2013-11-25 11:38:14 +01:00
Andreas Lauser
2e9272384d build system: prevent endless loop when using dunecontrol
this seems to be a bug in cmake 2.8.10.2: if the user sets the
CMAKE_CXX_COMPILER variable for a build directory where this variable
has already been set, one gets an endless loop. This stings especially
if using the dunecontrol compatibility layer as the compiler flags are
unconditionally set via the CXX_FLAGS environment variable in the
options file. Running duncontrol on a module twice will thus trigger the
infinite loop if some compiler flags are set by the user.

The solution is relatively simple: Delete the CMakeFiles directory
before calling cmake. for the dunecontrol compatibility mode, we do
this in the configure script. For details about the cmake bug, see
http://www.cmake.org/Bug/view.php?id=14119
2013-11-25 11:38:13 +01:00
Joakim Hove
2405462a38 Changed the check_cxx_source_compiles() in Findopm-parser to look for Deck.hpp; Parser.hpp had uneccasary complicated interaction with cJSON 2013-11-25 11:38:12 +01:00
Andreas Lauser
c1d8d953c1 fix test for HAVE_QUAD on some instances of ubuntu 13.10
I haven't figured out why this happens, but on one of my computers
running kubuntu 13.10 g++ says the following if one tries to use
quadruple precision math:

/home/erne/src/ewoms/ewoms/common/quad.hh: In static member function ‘static quad std::numeric_limits<__float128>::min()’:
/home/erne/src/ewoms/ewoms/common/quad.hh:52:14: error: unable to find numeric literal operator ‘operator"" Q’
     { return FLT128_MIN; }

since this happens only on this machine and only with the c++ (but
not the C) compiler, i suppose that this is either an upgrade issue
with kubuntu or an issue with the ubuntu gcc stack. Strangely enough,
my other kubuntu machine does not have a problem with that...

In any case also testing for assignability of constants and using the
C++ compiler for the quadmath test won't hurt...
2013-11-25 11:38:11 +01:00
Joakim Hove
40b6aadc98 Updated modules to find Opm-parser 2013-11-05 09:55:43 +01:00
Joakim Hove
a99277efdf Updated modules for Findcjson and Findopm-parser 2013-11-05 09:55:42 +01:00
Joakim Hove
eab166feea Added opm-parser-prereqs.cmake 2013-11-05 09:55:41 +01:00
Joakim Hove
aefaaf6e91 Added CMake find modules opm-parser and cjson 2013-11-05 09:55:41 +01:00
Roland Kaufmann
7e024a2cce Allow to search for multiple libraries in package
Some packages are split up in several library files, where each of them
doesn't have their own CMake find-module. So we cannot put this list in
the prerequisites. Unlike the headers, where we just add the directory,
all the libraries must be explicitly named on the link line. Thus, we
should allow to specify more than one name in the lib parameter.

The first name specified is designated as the "primary" library and is
assigned to the _LIBRARY variable; the others occur in _LIBRARIES as if
they were prerequisites.

Note that the build system cannot replicate this setup itself; it always
assumes that we are building (at most) one library from the source
files.
2013-11-05 09:55:39 +01:00
Roland Kaufmann
cb89621813 Only add option for shared libraries once
The way the test was done previously, it was added for *every* option
after `--enable-shared`, not only that one.
2013-11-05 09:55:38 +01:00
Roland Kaufmann
c06a79f30b Specify dir. layout and stylesheets in common templates
These options should be common to all OPM modules to get the same look
for the generated documentation.
2013-11-05 09:55:36 +01:00
Roland Kaufmann
615b88b345 Install header-only pkgconfig file to generic lib/
The previous version assumed that we had libraries, and thus always
installs the .pc file in the multi-arch library directory. However,
we now have modules which does not have a library, but whose header
files still need to be located. Since the lib/ directory is usually
in the pkgconfig search path, it is natural to put them there.
2013-10-21 15:25:22 +02:00
Roland Kaufmann
9338810b6e Allow static linking for SuiteSparse to be forced
If -DSUITESPARSE_USE_STATIC=ON, then the build system will only look for
static versions of the libraries that are part of SuiteSparse, even if
dynamic/shared versions are present on the system. Thus, the default of
preferring dynamic libraries can be overridden.

SuiteSparse is rarely built ourselves, but still uncommon enough to not
be present on computing clusters.

This patch allows us to install the libraries on a workstation, for
instance from package suitesparse-devel and link to it statically
without having to maintain our own build tree.
2013-10-11 14:40:57 +02:00
Roland Kaufmann
5a2e633f9d Pass BUILDNAME and SITE options along to CTest/CDash
By passing these options through ./configure, one can use dunecontrol
to build a complete stack and still get a customized description in
CDash (such as when building in a cluster or VM where the actual machine
name does not matter, or when you want to add key options to the name
shown) without having to run a second configuration just to set those
in the cache.

Also fixes a bug where --with-cmake would skip any further option
specified after it.
2013-10-08 17:44:06 +02:00
Roland Kaufmann
f786b832c0 Enable MPI if path is given
Assume that ./configure --with-mpi= also implies --enable-mpi; if you
absolutely want to specify path without enabling (?!) then you can do
--with-mpi=... --disable-mpi (in that order).

This patch look for anything after the equal sign of the --with
parameter and only set the variable _MPI_PREFIX_PATH if that is given;
it always toggle USE_MPI.
2013-10-07 15:49:51 +02:00
Roland Kaufmann
ff3ba2dbb9 Use dSYM bundles as debugging containers (on MacOS X)
gdb on MacOS X does not seem to be very fond of "flat" dSYM files, but
it can read the bundle variant fine. Thus we change that to enable
debugging across several tools.
2013-10-06 18:04:57 +02:00
Bård Skaflestad
e578f47d8a Catch up to opm-material reorganisation.
Specifically, file <opm/material/constants.hh> was renamed to
<opm/material/Constants.hpp> and this renaming must be reflected in
the CMake probes for opm-material.
2013-10-06 18:04:56 +02:00
Andreas Lauser
0dfb58bc52 Findewoms.cmake: fix typo
it's 'start.hh', not 'start.h'...
2013-10-06 18:04:55 +02:00
Andreas Lauser
cf38685acd remove the dune-istl from the list of opm-material prerequisites
the only reason dune-istl was required was that the spline class used
ISTL's tridiagonal matrix. Since the spline class moved into the core
(along with a more capable tridiagonal matrix), ISTL is no longer
required by opm-material.
2013-09-24 15:39:50 +02:00
Andreas Lauser
4e3d76a090 add opm-core to the ewoms prerequisites 2013-09-24 15:39:49 +02:00
Roland Kaufmann
9b2cf047e5 Search for dune.module in private installations
When doing a private install of DUNE libraries, the dune.module file
is put in the lib/ directory, regardless of architecture.

This patch searches the lib/ directory as a catch-all after having
searched the platform-specific directories. This should minimize the
chance of hitting an accidentally unrelated dune.module.
2013-09-24 15:39:48 +02:00
Roland Kaufmann
48a7dc58b3 Honor the CMAKE_NOT_USING_CONFIG_FLAGS settings
If this is set, then everything is lumped into CMAKE_CXX_FLAGS since
that is the only one that is going to be used when building anyway.
2013-09-24 15:39:48 +02:00
Roland Kaufmann
c4b5cdedad Clear default flags in an (im)proper way
The CMAKE_NOT_USING_CONFIG_FLAGS option is really only settable by a
user that doesn't want _DEBUG or _RELEASE flags to not have effect.
If we want other flags than the platform default, we must do hairy
things like clearing them from the cache (overriding the user's
seletion if it was the same as the platform default).
2013-09-24 15:39:47 +02:00
Roland Kaufmann
b13f9d251b Fix logic bug and make language explicit
The operator precedence in CMake can be surprising, so add parenthesis
to make in unambigious. Also, make it more explicit from which language
we get the default options. (They are all set from the settings given
for C++; why would have different optimization options for C and C++?)
2013-09-24 15:39:46 +02:00
Roland Kaufmann
b6c5d3572d Update the CMake cache to reflect current settings
During configuration some of the values for CMake properties (compiler
flags etc.) may be changed either by the user (through command line
parameters or option files), or by the configuration script itself
(setting more aggressive options or detailed debugging for instance).

This change writes many of the relevant values back into the cache so
they are available for introspection (using e.g. ccmake) or when the
rerunning the configuration without specifying all options.
2013-09-24 15:39:46 +02:00
Roland Kaufmann
93bfbecb3b Improve detection of dune.module
Remove lib/.libs/ and lib64/ as well as lib/ to find the prefix for the
installation root.
2013-09-24 15:39:45 +02:00
Roland Kaufmann
66907b7c42 Improve troubleshooting for missing dune.module
If the library is found, but dune.module is not, we really should give
an error because the #ifdefs in the code will not work as intended.

Print the locations where we expect the library to appear to the console
for better tracking.
2013-09-24 15:39:44 +02:00
Roland Kaufmann
94e6b26642 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-24 15:39:44 +02:00
Roland Kaufmann
fd34cde5ad 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-24 15:39:43 +02:00
Roland Kaufmann
d11a8bc5ac Allow use of uppercase version of the _ROOT var
The convention is to use uppercase names, in particular our own
./configure script uses this, so we should at least allow it here
(in addition to the old way for backward compatibility)
2013-09-24 15:39:43 +02:00
Roland Kaufmann
d00cff8549 Don't set a default search path; use CMake's default
If we set a default search path ourself, then this will be used if we
specify a SuiteSparse_ROOT with error! Instead, we should just leave
our SuiteSparse_SEARCH_PATH variable empty and then let CMake fill in
its defaults. If there is a directory specified on the other hand
(indicating that we want exactly that location), only use that and
turn all the default paths completely off.
2013-09-24 15:39:42 +02:00
Roland Kaufmann
39a98783af Test variables instead of contents
If you test the contents of a variable, this is not necessarily true
in CMake (since the contents here is a path, and not a variable name;
the default test is "does this variable exist", not "is this a non-
empty string" like in shell script)
2013-09-24 15:39:41 +02:00
Roland Kaufmann
90723230b0 Detect OS version when running on RHEL/CentOS 5.x
These versions only have /etc/redhat-release, not any of the newer
files.
2013-09-24 15:39:41 +02:00
Roland Kaufmann
a41b5e140e Test for executable and preserve erroneous path for messages
If an alternate compiler is specified, then check if this is actually
executable before assigning it so that we don't end up with specifying
an empty name to CMake. If the path does not exist, it will be preserved
so that CMake will complain with an easily identifiable error message.
2013-09-24 15:39:39 +02:00
Markus Blatt
efc7fab49c Change which test for cmake28 to use command -v. 2013-09-24 15:39:39 +02:00
Markus Blatt
3db8443c8c substituted which with command -v. 2013-09-24 15:39:38 +02:00
Markus Blatt
23499b7616 Extracts the full compiler path and feeds it to cmake.
Previously, specifying the compiler name with a variable
to configure ("configure CC=gcc") lead to CMake complaining
that <builddir>/$CC was not a valid path. This patch fixes
this by extracting the full path with "which <compiler>".
Should fix issue #355.
2013-09-24 15:39:37 +02:00
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