Commit Graph

449 Commits

Author SHA1 Message Date
Roland Kaufmann
ee7f4242b5 Only add linker option if it is not really there
This code is run unconditionally each time we do a reconfigure; if the
option is added at each time, they will accumulate (needlessly) on the
command-line, making it harder to inspect the log.
2013-12-10 21:01:22 +01:00
Roland Kaufmann
a9e71c0d84 Provide CMake find module for opm-autodiff
If the module root is not explicitly specified, the loading of its
configuration is delegated to a find module, which does a heuristic
search in known/surrounding directories. Most OPM modules use the
common logic in OpmPackage; this patch configures the search
specifically for opm-autodiff.
2013-12-06 23:31:57 +01:00
Roland Kaufmann
a62e2f4770 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-12-06 23:26:57 +01:00
Roland Kaufmann
7d75c4f058 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-12-06 23:26:37 +01:00
Andreas Lauser
59e234b4d9 configure: fix all except one warning produced by shellcheck
thanks to @bska for pointing this tool out!
2013-11-25 14:51:59 +01:00
Bård Skaflestad
1467a16a34 Merge pull request #439 from andlaus/fix_configure_syntax_error
fix syntax error in configure shell script
2013-11-25 03:52:30 -08:00
Bård Skaflestad
6c56cff450 Merge pull request #436 from rolk/436_searchdir
Search in build/ sub-dir if only suite root is given
2013-11-25 02:29:41 -08:00
Andreas Lauser
c1fc5c53c6 fix syntax error in configure shell script
strangly enough, it seems to work like it was in some circumstances...
2013-11-22 18:39:49 +01:00
Roland Kaufmann
3c3e14daed Merge pull request #430 from andlaus/fix_infinite_configure
build system: prevent endless loop when using dunecontrol
2013-11-21 03:07:34 -08:00
Roland Kaufmann
9e54d276bd 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-18 13:19:58 +01:00
Roland Kaufmann
6d433017a4 Only add build sub-directory if it is actually used
Otherwise the search will cascade down one level too many.
2013-11-18 13:19:18 +01:00
Roland Kaufmann
4379ee8da6 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-18 11:21:06 +01:00
Andreas Lauser
58122cc2f5 include the latest review comments by Roland Kaufmann 2013-11-15 13:14:50 +01:00
Joakim Hove
dc27dc1adf Changed the check_cxx_source_compiles() in Findopm-parser to look for Deck.hpp; Parser.hpp had uneccasary complicated interaction with cJSON 2013-11-14 10:20:05 +01:00
Andreas Lauser
4c1f238fb3 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-13 15:21:39 +01:00
Andreas Lauser
6b037027c3 configure script: also delete the cmake cache
This replicates the autotools behavior and was suggested by Roland
Kaufmann.
2013-11-13 11:46:27 +01:00
Andreas Lauser
2f36aa10fa 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-11 17:04:23 +01:00
Andreas Lauser
c7703c0949 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-09 17:04:46 +01:00
Roland Kaufmann
55bfa65b30 Merge pull request #418 from joakim-hove/cmake-find-opm-parser
Add cmake capabailities to locate opm-parser and cJSON
2013-11-04 23:50:38 -08:00
Bård Skaflestad
ca9b5e1bee Merge pull request #416 from rolk/416_lib
Allow to search for multiple libraries in package
2013-11-04 10:24:29 -08:00
Joakim Hove
443a867c76 Updated modules to find Opm-parser 2013-10-30 14:17:36 +01:00
Joakim Hove
59fb0f04a2 Updated modules for Findcjson and Findopm-parser 2013-10-30 14:17:36 +01:00
Joakim Hove
ae7ba90c09 Added opm-parser-prereqs.cmake 2013-10-30 14:17:35 +01:00
Joakim Hove
2c2174da68 Added CMake find modules opm-parser and cjson 2013-10-30 14:17:35 +01:00
Roland Kaufmann
d847fe0d4f 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-10-30 14:17:35 +01:00
Roland Kaufmann
d10508b760 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-10-23 09:22:33 +02:00
Roland Kaufmann
9e39e04c47 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-10-22 11:39:14 +02:00
Bård Skaflestad
84f442bfd1 Merge pull request #413 from rolk/413_inst
Install header-only pkgconfig file to generic lib/
2013-10-21 04:13:48 -07:00
Roland Kaufmann
ac042e426f 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-17 09:39:59 +02:00
Roland Kaufmann
41be11ebd8 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-10-16 11:43:02 +02:00
Roland Kaufmann
f0b2f82069 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-10 19:53:16 +02:00
Roland Kaufmann
315f42104e 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 14:54:39 +02:00
Roland Kaufmann
cbece4a5ec 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 14:46:07 +02:00
Roland Kaufmann
6644e9a1b9 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-04 13:28:31 +02:00
Roland Kaufmann
02165cd9d2 Merge pull request #391 from bska/find-opm-material
[Build System] Catch up to opm-material reorganisation.
2013-09-25 01:31:34 -07:00
Bård Skaflestad
74605d984e 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-09-24 16:47:15 +02:00
Andreas Lauser
e256a233f0 Findewoms.cmake: fix typo
it's 'start.hh', not 'start.h'...
2013-09-24 15:49:50 +02:00
Andreas Lauser
0af1d9322f 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 11:49:30 +02:00
Andreas Lauser
06f0b302ca add opm-core to the ewoms prerequisites 2013-09-24 11:46:55 +02:00
Roland Kaufmann
73d991adb4 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-20 13:17:38 +02:00
Atgeirr Flø Rasmussen
dd3c69032d Merge pull request #372 from rolk/372_spill
Update the CMake cache to reflect current settings
2013-09-20 01:51:06 -07:00
Roland Kaufmann
b09dd0894b Improve detection of dune.module
Remove lib/.libs/ and lib64/ as well as lib/ to find the prefix for the
installation root.
2013-09-20 09:37:33 +02:00
Roland Kaufmann
e661d18554 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-20 09:37:33 +02:00
Roland Kaufmann
f83b734e3e 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-18 14:07:57 +02:00
Roland Kaufmann
e9d0216577 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-18 14:07:57 +02:00
Roland Kaufmann
d801668c1c 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-18 14:07:57 +02:00
Roland Kaufmann
9aca9bd746 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-17 23:24:59 +02:00
Roland Kaufmann
c4bb95ed55 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-17 23:05:52 +02:00
Roland Kaufmann
16c2f694a8 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-17 22:18:55 +02:00
Bård Skaflestad
4765286e75 Merge pull request #367 from rolk/367_ssparse
Fix search for SuiteSparse/UMFPACK when path is explicitly given
2013-09-12 01:32:31 -07:00