Commit Graph

593 Commits

Author SHA1 Message Date
Andreas Lauser
a2d4a32736 make the build system link to the "quadmath" library if it is supported
Thanks a lot to Roland Kaufmann for the support.
2013-08-16 23:55:31 +02:00
Andreas Lauser
cd6f18ed90 add a cmake check for the abi::__cxa_demangle() function
this was also forgotten. sorry...
2013-08-16 23:55:30 +02:00
Andreas Lauser
9f5ab8e257 add test for <type_traits> to FindCXX11Features.cmake
I fogot this one yesterday...
2013-08-16 23:55:30 +02:00
Andreas Lauser
694fc0c98a add and use CMake modules for valgrind client requests and quadruple precision math 2013-08-16 23:55:29 +02:00
Andreas Lauser
6ff3b56b49 also test for std::unique_ptr 2013-08-16 23:55:29 +02:00
Andreas Lauser
113238badb add a few config.h macros useful for dune-common 2013-08-16 23:55:28 +02:00
Andreas Lauser
999d198181 detect the presence of std::shared_ptr
since GCC 4.4 supports it, make it mandatory as well...
2013-08-16 23:55:27 +02:00
Roland Kaufmann
bddcff89f2 OPM Porsol now depends on OPM Material
In the new build scheme, the prerequisites of each module is declared
in this file as the canonical version, and everything else includes it.
2013-08-14 23:39:06 +02:00
Roland Kaufmann
264f3b0747 Fix bug in determining if directory is found
The parenthesis is to make it less ambiguous how the boolean expression
should be evaluated.
2013-08-14 23:39:06 +02:00
Roland Kaufmann
49801f2edf Make available version numbers for these modules 2013-08-14 23:39:06 +02:00
Roland Kaufmann
821a53bfbb Probe DUNE module version number from installation
Figure out where the closest dune.module is, and parse it for
information. The defines are added to config.h, so that our code
may behave differently for various versions available.

It actually works for opm-core 1.0 as well, but don't tell anyone;
we rather want people to use opm/core/version.h instead.

If a module has been backported and installed to a directory which
also contains the version number, e.g. /usr/include/dune-2.3, to
avoid clashing with an existing version in /usr/include, then this
part is now stripped from the include directory and added back to
the lib directory where we are looking for dune.module
2013-08-14 23:39:06 +02:00
Roland Kaufmann
81699b561a Provide hook to configure getting other's version
This hook together with the bundled convenience macro makes it
possible to add the version of another module to config.h using
code like this:

macro (config_hook)
  opm_need_version_of ("dune-common")
endmacro (config_hook)
2013-08-14 23:39:06 +02:00
Roland Kaufmann
de5d5ec7dc Create a set of config variables for implementation
The config variables in _CONFIG_IMPL_VARS are only written to config.h
and not the .pc or -config.cmake files. They can thus only be used by
the implementation files and not the headers. Use this set to avoid
exposing the variables to other projects, when it is likely that a
probe used by that other project may turn up a different result.
2013-08-14 23:39:06 +02:00
Roland Kaufmann
3d366d9cdf Only configure libtool for libraries that exist 2013-08-14 23:39:06 +02:00
Roland Kaufmann
8d3b0fed71 Only build before library target if there is any 2013-08-14 23:39:06 +02:00
Roland Kaufmann
022eb51c8b Allow PCH option to be on even if there is no library 2013-08-14 23:39:06 +02:00
Roland Kaufmann
becba8e93c Upgrade Findopm-material to use separate prerequisite list
This will now be included both by the find module and by the project
file itself.
2013-08-14 23:39:06 +02:00
Roland Kaufmann
6449b08094 Module mode CMake probe for opm-material 2013-08-14 23:39:06 +02:00
Andreas Lauser
a79fcc063a Build system: make it work for modules which do not need libraries 2013-08-14 23:39:05 +02:00
Roland Kaufmann
2ebfa92f4f Have distclean target keep up with build improvements
If you run `cmake --build . -- distclean` all generated files will
now be gone! This adds the files that have been introduced in later
improvements to the build system.
2013-08-14 23:39:05 +02:00
Roland Kaufmann
52a36f77fa Recognize Clang to be a GCC-compatible compiler
Clang aims to be compatible with GCC when it comes to command-line
parameters. Where we enable functionality based on the presence of
a GCC-compiler, we can use the same functionality with Clang.

This patch introduces a new variable CXX_COMPAT_GCC which is true if
the compiler handles the same options as GCC, and this variable is
subsequently used in tests instead of CMAKE_COMPILER_IS_GNUCXX (which
remains if we need to test if we really have GCC, e.g. for version)
2013-08-14 23:39:05 +02:00
Roland Kaufmann
1951f796af Enable support for Ninja build generator
Use the Ninja build generator if '--enable-ninja' is passed on the
command line to ./configure (or of course if -GNinja is passed
directly to CMake).
2013-08-14 23:39:05 +02:00
Roland Kaufmann
354158207d Provide a define for having OpenMP 2013-08-14 23:39:05 +02:00
Roland Kaufmann
8cb420bb7f Only make target if there is any source files
If there is no source files, we set a blank target to signal to the
other components of the build system that they shouldn't be looking
for a library.
2013-08-14 23:39:05 +02:00
Roland Kaufmann
60eb89eb57 Only include library if there is one 2013-08-14 23:39:05 +02:00
Roland Kaufmann
0b6d2f2607 Don't install debug syms for a library that isn't there 2013-08-14 23:39:05 +02:00
Roland Kaufmann
e713e5637d Separate build concerns for better maintainability
Introduce a main build file which uses modules in the cmake/ directory
for most of its bulk work, which agains retrieve information from files
in the root of the source tree (dune.module, CMakeLists_files.cmake) to
get information about the project.

Thus, the cmake/ directory is shared between all the projects down to
the last bit; only project-specific customizations go into the main file
in form of _hook macros (which are called in specific places).
2013-08-14 23:39:05 +02:00
Roland Kaufmann
f9c9b19c37 Add a label field to the project information
The difference between the version number (1.0) and the label (2013.03)
is: The version is time-independent but shows the level of compatibility,
see e.g. <http://www.semver.org>, whereas the label is a marketing tool
which describes the project progress.
2013-08-14 23:39:05 +02:00
Roland Kaufmann
1da33a6747 Put project-specific information in dune.module
This information was previously stored in the build system; now they
are all in one canonical place!
2013-08-14 23:39:05 +02:00
Roland Kaufmann
78118e21e3 Support compiling files that are in the attic
Since these files are not actively maintained, we don't assume that
the project actually has any, nor are they part of the default build.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
522acace31 Use new style of prerequisite declaration
The prerequisites are now declared in their own file, so it can be
included by the main system. There is thus only one canonical place
where the list of prerequisites exist.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
188925f3cd Provide CMake find module to locate opm-verteq 2013-08-14 23:39:04 +02:00
Roland Kaufmann
166033ce1f Further classify source files into languages
Other modules (notably the precompiled header one) may set properties
directly on the source file; we need to separate them into categories
for which language they belong to.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
6e2084cf15 Safe-guard against version mismatch
The version declared for the build system (in dune.module) is checked
against what is in the source (e.g. opm/core/version.h) and if these
don't match, then issue an author warning.

This will help us keep the two version numbers in sync., since it
becomes very obvious when we don't. The benefit for this is to not have
the build system start mucking with the code just to dump some static
information in there.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
7b96599c5b OPM Core uses C++11 features as of commit 562bcf2 2013-08-14 23:39:04 +02:00
Roland Kaufmann
ae53847e52 Use RUNPATH in installed library by default
When checking out from source code, the paths that were used to
configure the project should be carried on to the installed binary,
so the same libraries are used without much effort.

By using RUNPATH instead of (just) RPATH, it can be overridden with
LD_LIBRARY_PATH if the user so desires.
2013-08-14 23:39:04 +02:00
Roland Kaufmann
0bac3406dd Only display an error message if C++11 support is noted as REQUIRED 2013-08-14 23:39:04 +02:00
Roland Kaufmann
046a4e6048 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-08-14 23:39:04 +02:00
Roland Kaufmann
c52e62ce88 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-08-14 23:39:04 +02:00
Roland Kaufmann
51c31938b9 Let the AutoTools script disable tests and samples also 2013-08-14 23:39:04 +02:00
Roland Kaufmann
10bc6cd081 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-08-14 23:39:03 +02:00
Roland Kaufmann
7900b3bbfc 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-08-14 23:39:03 +02:00
Roland Kaufmann
48a0099190 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-08-14 23:39:03 +02:00
Roland Kaufmann
e8e310dfba 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-08-14 23:39:03 +02:00
Roland Kaufmann
be7b392690 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-08-14 23:39:03 +02:00
Roland Kaufmann
d16fbf463e Read the label from project info 2013-08-14 23:39:03 +02:00
Roland Kaufmann
76eaf3fc22 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-08-14 23:39:03 +02:00
Roland Kaufmann
6fa44b6f23 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-08-14 23:39:03 +02:00
Roland Kaufmann
7953a0cdad 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

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-08-14 23:39:03 +02:00
Roland Kaufmann
43b2929825 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-08-14 23:39:03 +02:00