Commit Graph

177 Commits

Author SHA1 Message Date
Bård Skaflestad
fb9e09063c Merge pull request #193 from rolk/193_arch
Don't search in architecture-irrelevant directories
2013-03-13 03:41:29 -07:00
Roland Kaufmann
44a638dce3 Test strings on length before content
A substring can of course not be longer that the full string. Also fixes
problems with CMake-versions that doesn't handle out-of-range parameters
to the SUBSTRING sub-command.
2013-03-13 11:20:28 +01:00
Roland Kaufmann
ac861580d7 Don't search in architecture-irrelevant directories
If we are on a 64-bits machine, there is no point in searching lib32
and conversely. Quite the opposite, it can only end badly if a library
is actually found in the wrong architecture directory.
2013-03-13 10:38:27 +01:00
Roland Kaufmann
38bcff4e12 Allow subdir builds with dunecontrol
dunecontrol will check for a dune.module file to regard the directory
as containing the module. If we put this is a sub-dir of the source,
it will get confused, so we shouldn't. There shouldn't be any
conflicting use-cases, as one cannot have several modules in the sub-
directory of one source (!?).
2013-03-13 01:20:44 +01:00
Roland Kaufmann
54c89146d7 Enable CMake < 2.8.5 clients to report Git version 2013-03-13 01:02:03 +01:00
Roland Kaufmann
58dd4fd7b4 Include standard math runtime library when linking numerics 2013-03-13 00:01:41 +01:00
Roland Kaufmann
1e765a2f29 Don't probe for umfpack with cholmod unless latter is found 2013-03-12 12:22:57 +01:00
Roland Kaufmann
f6d44238b1 Simplify setting of flag that indicates shared object
Instead of having the name of the module set for each flag, use the
available standard option. Mixing shared objects and static libraries
in the same build is not a very realistic scenario anyway.

This enables us to call configure without actually having a particular
module; the script may then be used on a group level.
2013-03-07 21:28:17 +01:00
Bård Skaflestad
144be75cea Merge pull request #182 from rolk/181_opmgrid
Recreate grid selection macros from DUNE
2013-03-07 05:39:24 -08:00
Roland Kaufmann
e507e18eed Check for tuple support 2013-03-07 14:27:41 +01:00
Roland Kaufmann
9280a2d9ff Check for constexpr attribute 2013-03-07 14:25:24 +01:00
Roland Kaufmann
c7db7805d1 Recreate grid selection macros from DUNE
This duplicates functionality from the old autotools implementation
in case any user code needs it. It is not necessary to build the
OPM modules themselves.
2013-03-07 13:55:51 +01:00
Bård Skaflestad
316c691c81 Merge pull request #180 from rolk/180_compver
Diagnose compiler version in configuration output
2013-03-07 04:14:15 -08:00
Roland Kaufmann
c81bd58c3f Update regular expression to handle more variants
Older CentOS versions returns the version string on this format:

    gcc (aaa) x.y.z yyyymmdd (bbb)
2013-03-07 12:29:23 +01:00
Roland Kaufmann
bc4057a0d4 Provide function that identifies compiler to patch-level
Some distributions modify -dumpversion so that it only returns major
and minor numbers, not the patch level. This is usually OK for
determining features, but when debugging the output log, we really
want the full number.
2013-03-07 11:22:32 +01:00
Roland Kaufmann
a6a8170b50 Use keyword supported by older version of CMake
The CONFIG keyword to find_package () was introduced in 2.8.8 while
NO_MODULE works for the entire 2.8.x series.
2013-03-07 10:45:36 +01:00
Atgeirr Flø Rasmussen
66d1f396f8 Merge pull request #178 from rolk/178_openmp
Require explicit enabling of experimental OpenMP support
2013-03-07 00:17:50 -08:00
Roland Kaufmann
252d853147 Disable use of OpenMP by default
If support for OpenMP should be added, it must be specified by
setting an option. If not, then warnings for unknown pragmas are
disabled, so that the code can have #pragma omp witout getting
messages during build.
2013-03-07 00:17:46 +01:00
Roland Kaufmann
8946c17330 Determine that ERT is not found, faster
Instead of checking every pre-requisite and then determine if the
library is functional, quickly check if the library directories are
present, and if not bail out. The most common reason that ERT is
not usuable, is that it is installed, not that something else is
missing!
2013-03-06 22:18:21 +01:00
Roland Kaufmann
5658c8b624 Enable dunecontrol to use a build tree as module dir
dunecontrol looks for a dune.module to determine whether a directory
contains a module or not. By copying this file to the build tree, we
can use (out-of-source!) build trees in dunecontrol too.
2013-03-06 20:00:42 +01:00
Atgeirr Flø Rasmussen
89f8068685 Merge pull request #174 from rolk/173_havecached
Handle ERT not found condition gracefully
2013-03-06 05:37:11 -08:00
Roland Kaufmann
35353befb2 Handle ERT not found condition gracefully
If the files for ERT is not found, then the find module cheats and
indicates that it didn't compile either (since there are some later
tests for HAVE_ERT).

However, erraneously, it gave this variable the value 0, which tests
for false in the CMake code but not in the #ifdef checks in the C++
code. This error is cancelled in opm-core by the fact that it didn't
store it as a cache variable, but resurfaced in opm-polymer when it
probes the second time (as both opm-core as a dependency and
opm-polymer itself declare a dependency on ERT).

It is now stored in a way that should be satisfactory to both
projects.
2013-03-06 13:31:04 +01:00
Roland Kaufmann
e75d69ef1d Use config mode if possible when finding packages 2013-03-05 22:29:20 +01:00
Roland Kaufmann
11bf7bf34e Propagate information about whether module was found quietly 2013-03-05 13:58:19 +01:00
Roland Kaufmann
e50c564425 Separate inclusion of OpenMP library into reusable module
Other projects (which does not have a direct dependency on ERT) require
OpenMP; we desire to reuse this functionality into those projects.
2013-03-05 13:52:52 +01:00
Roland Kaufmann
911bf9593f Do not duplicate handling of duplicate libraries
There were (at least) three implementations of the same macro; these
have been collected into a separate helper module. (Note that this
means that FindERT is now not completely stand-alone anymore).
2013-03-05 13:50:58 +01:00
Roland Kaufmann
f3b76ac8e3 Trim same amount from strings before comparing
If you specified options in an environment variable containing a blank
at the end, then this would not compare equal to the other candidate,
which was stripped, causing the first added argument to drop out! This
is usually the flag for C++11 compliance, causing binary incompatibility
2013-03-05 11:43:06 +01:00
Atgeirr Flø Rasmussen
0ac31dd871 Merge pull request #166 from rolk/166_upcase
Use uppercase consistently in configuration variable names
2013-03-05 00:49:33 -08:00
Atgeirr Flø Rasmussen
f44db76a72 Merge pull request #169 from rolk/169_havetest
Check that test prog. compiled before declared found
2013-03-05 00:40:40 -08:00
Roland Kaufmann
3febb086dc Check that test prog. compiled before declared found
The previous version did the test and setting of the config variable
right, but reported that the module was found only if the files were
located, independently of the result of the compile.
2013-03-04 23:41:41 +01:00
Roland Kaufmann
3c5a73e9c4 Reuse the uppercase variant across the entire function 2013-03-04 23:33:30 +01:00
Roland Kaufmann
3bc25d5dee Also clean the temporary config-var file 2013-03-04 23:11:52 +01:00
Roland Kaufmann
be9b33e687 Use uppercase for the shared-object variable as well 2013-03-04 21:58:36 +01:00
Roland Kaufmann
5f490648ab Allow common _ROOT suffix in addition to original _PREFIX 2013-03-04 21:30:23 +01:00
Roland Kaufmann
76786442ce Allow uppercase variant of package root also
Both the straight-forward mod-ule_ROOT variable and the more idiomatic
MOD_ULE_ROOT variant are allowed when specifying where to look for a
package.
2013-03-04 21:25:18 +01:00
Roland Kaufmann
4942763ddd Use temp file for config vars to avoid rebuild
When generating the config.h configuration file, write to a temporary
first and then rename afterward to avoid touching the file and thus
triggering a complete rebuild (of everything that includes config.h)
unnecessarily.
2013-03-04 14:00:06 +01:00
Roland Kaufmann
234be65229 Specify source files explicitly rather than with glob
Files which constitutes compilation units are now specified explicitly
in the file CMakeLists_files.cmake rather than identified through a
glob. If this file is updated, a reconfigure should be triggered.

This also enables us to specify exactly which headers that should be
distributed as part of the installation package, and which programs
that should be used for unit testing.
2013-03-04 12:25:20 +01:00
Roland Kaufmann
e3a9a40ae6 Find module for opm-polymer 2013-03-04 09:46:33 +01:00
Roland Kaufmann
11d5f9aa91 Find module for opm-upscaling 2013-03-04 09:46:33 +01:00
Roland Kaufmann
1c93c19bf9 Find module for opm-porsol 2013-03-04 09:46:33 +01:00
Roland Kaufmann
dda6155081 Find module for dune-cornerpoint 2013-03-04 09:46:33 +01:00
Roland Kaufmann
6a2323c34a Provide easy way to disable an entire directory 2013-03-04 09:46:33 +01:00
Roland Kaufmann
8b13ffee6b Only attempt to use precompiled headers that exists 2013-03-04 09:46:33 +01:00
Roland Kaufmann
a35e0d23e3 Probe with include dirs to ALL dependencies
It may be that the header in the test is dependent on some other header
in one of the dependencies.
2013-03-04 09:46:33 +01:00
Roland Kaufmann
7ef129d708 Allow optional packages in find-module package list 2013-03-04 09:46:33 +01:00
Roland Kaufmann
39880c255e Updated dependencies (most notably LibXML2 -> TinyXML) 2013-03-04 09:46:32 +01:00
Roland Kaufmann
dc3d94e985 Activate Fortran interface on demand
Not only if we need to compile Fortran code, but also if we need to call
some functions from a Fortran library from C code.
2013-03-04 09:46:32 +01:00
Roland Kaufmann
7871a48551 Make sure HAVE_FOO is defined if foo_FOUND in CMake 2013-03-04 09:46:32 +01:00
Roland Kaufmann
03ccc506bd Find modules for dune-geometry and dune-grid 2013-03-04 09:46:32 +01:00
Roland Kaufmann
d9980beef1 Guess where libraries are using full path
Because the probe is run from the project source tree(!)
2013-03-04 09:46:32 +01:00