Commit Graph

267 Commits

Author SHA1 Message Date
Roland Kaufmann
1a04ae5125 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-07-31 15:08:51 +02:00
Bård Skaflestad
0e42c0e20c Merge pull request #292 from rolk/292_fastbuild
Add possibility to skip building tests and examples
2013-07-31 05:45:47 -07:00
Bård Skaflestad
93afe5fbb6 Merge pull request #291 from rolk/291_ertdep
Probe again later if ERT isn't found now
2013-07-31 05:19:47 -07:00
Roland Kaufmann
0e8b8191a9 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-07-31 14:17:41 +02:00
Roland Kaufmann
b53ba15a84 Let the AutoTools script disable tests and samples also 2013-07-31 14:13:56 +02:00
Roland Kaufmann
1378114cec 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-07-31 14:03:53 +02:00
Roland Kaufmann
ea973849e0 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-07-31 13:58:06 +02:00
Roland Kaufmann
6f43c7587f 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-07-31 13:14:30 +02:00
Roland Kaufmann
764c3c8e60 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-07-31 12:58:12 +02:00
Roland Kaufmann
928a67b77f 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-07-31 12:04:07 +02:00
Roland Kaufmann
f3693e2282 Read the label from project info 2013-07-31 11:50:19 +02:00
Roland Kaufmann
2183a243cb 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-07-31 11:08:57 +02:00
Roland Kaufmann
6757860aac 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-07-31 11:05:53 +02:00
Andreas Lauser
9465560ae4 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 17:43:01 +02:00
Roland Kaufmann
5ae4d44e54 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
information in CMakeLists.txt

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-07-30 14:11:26 +02:00
Roland Kaufmann
3f4695794d 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-07-30 13:26:16 +02:00
Roland Kaufmann
56d3e1f8a4 Parse RHEL5 linker strings better 2013-07-05 13:18:53 +02:00
Roland Kaufmann
0696a21280 Print linker version to log 2013-07-05 12:45:39 +02:00
Roland Kaufmann
357db6c5e0 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-07-05 12:44:04 +02:00
Bård Skaflestad
143417e2b2 Merge pull request #272 from blattms/satellite-exclude-all
Change marker EXCLUDE_ALL to EXCLUDE_FROM_ALL in opm_compile_satellite
2013-07-05 02:24:58 -07:00
Markus Blatt
757973b713 Adjusts macro documentation to recent change. 2013-07-05 10:44:31 +02:00
Roland Kaufmann
91f96087b7 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-07-05 00:57:07 +02:00
Roland Kaufmann
a4767f754b 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-07-04 23:47:38 +02:00
Markus Blatt
f739c607f9 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-07-04 12:28:10 +02:00
Roland Kaufmann
2c8e068812 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-06-29 22:04:00 +02:00
Roland Kaufmann
f44cd35d81 Move configure script to cmake/Scripts/ directory
We want all changes to happen there; retain a small script that
simply forwards the action to the main script in that directory.
2013-06-26 00:05:02 +02:00
Roland Kaufmann
38bd5b0ad3 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-06-25 23:53:40 +02:00
Roland Kaufmann
bc9c8a7068 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-06-25 23:49:36 +02:00
Roland Kaufmann
fe6d7e8889 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-06-25 23:42:50 +02:00
Bård Skaflestad
2b4298f366 Merge pull request #261 from rolk/261_parse
Sideport of OPM/opm-material@48f6d4d to opm-core
2013-06-20 04:55:27 -07:00
Bård Skaflestad
e3577085c2 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-06-20 13:30:57 +02:00
Bård Skaflestad
79b180976f Merge pull request #260 from rolk/260_auto
Sideport of OPM/opm-material@7298744 to opm-core
2013-06-20 04:27:49 -07:00
Andreas Lauser
8f6df1ebf9 Test if the auto keyword is supported 2013-06-20 13:22:02 +02:00
Andreas Lauser
20fcad55c5 Fixed spelling mistake 2013-06-20 13:20:58 +02:00
Roland Kaufmann
4cd16438ea 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-06-15 22:11:14 +02:00
Roland Kaufmann
bfeac75fa9 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-06-13 23:19:27 +02:00
Roland Kaufmann
d6c2e52d63 Demote consequence of not having C++11 support
This module sets individual flags for each feature; there is not one
"CXX11Features_FOUND" flags which is set. Thus, when putting the
module as REQUIRED, the only consequence is that we cannot disable
searching for it.

Instead, we make it optional, meaning that the flags won't get set if
it isn't included and the dependent modules will adjust accordingly.
2013-05-22 20:50:59 +02:00
Atgeirr Flø Rasmussen
7ee481a601 Merge pull request #242 from rolk/242_callback
Let external objects observe individual timesteps in a simulation
2013-05-22 03:46:02 -07:00
Roland Kaufmann
56ff7975f0 Include possibility that uppercase is used 2013-05-16 13:26:33 +02:00
Roland Kaufmann
26475f448b Try singular name if plural not defined
In CMake "canon" (i.e. tutorial on Kitware's website) it is stated that
the _DIR suffix should be used for the directory of the library alone,
whereas _DIRS are entire list of paths necessary to compile (i.e.
dependencies are included).

Eigen3 only uses the singular form (since it doesn't have any
dependencies); it should really be copied to the plural form, but it may
be advantageous to have the find-module included unchanged, so we put in
an extra effort to find it here.
2013-05-16 10:58:24 +02:00
Roland Kaufmann
1ae1405c21 Notify callbacks when a timestep has completed
Client code can do additional processing for the output of each
timestep.
2013-05-14 11:36:13 +02:00
Roland Kaufmann
229cf6d134 Probe for library without using STL
If dune-grid has been compiled with _GLIBCXX_DEBUG, linking the test
program will fail since probing doesn't get the flags that are specified
for the main project, and thus configuration halts. Instead, we use a
smaller test program which doesn't need proper STL linkage to compile
and link.
2013-05-13 11:28:37 +02:00
Roland Kaufmann
49606fc925 Corrected mismatched if-else-endif arguments 2013-04-16 14:02:00 +02:00
Roland Kaufmann
f75090e876 Read /etc/system-release if others not parseable 2013-04-16 12:11:35 +02:00
Lars Vingli Odsæter
d2921faec8 Quote possibly empty variable to avoid error message
On RedHat 6.4 workstation the module doesn't find the necessary system
information, and gives an error message when the last parameter to the
string function is not present.
2013-04-16 12:01:57 +02:00
Atgeirr Flø Rasmussen
5e30cbccef Merge pull request #228 from rolk/228_arch
Report target architecture when configuring
2013-04-09 02:13:23 -07:00
Roland Kaufmann
28f5eabcbc Build release library by default
If you just download the source, compile and install, you get the
release library. Users who want to develop the code, must do setup
in their environment.
2013-04-09 11:03:07 +02:00
Atgeirr Flø Rasmussen
f5b5cee768 Merge pull request #225 from rolk/225_cxxflags
Let the user set compilation flags
2013-04-09 00:43:44 -07:00
Roland Kaufmann
5a17857d7b Report target architecture compiling for 2013-04-07 13:03:08 +02:00
Roland Kaufmann
878fe026f9 Minor refactoring to make code more readable 2013-04-07 00:46:58 +02:00