Commit Graph

412 Commits

Author SHA1 Message Date
Roland Kaufmann
c34a5700eb Search for directory containing build scripts
Currently only the source tree is "searched", but the template could
be expanded to look in another/more locations (or be specified
explicitly on the command-line with a --with-opm-macros= option)
2013-08-16 23:55:44 +02:00
Roland Kaufmann
dcc972f128 Allow source location to be overridden
By default the configure script assumes that the source is located
relative to the script itself. By allowing this to be overridden, the
script can be shared by other projects, each passing their own location
as an extra parameter.
2013-08-16 23:55:44 +02:00
Roland Kaufmann
e4a345a648 Use OPM_MACROS_ROOT to locate build scripts
By using a separate variable for this we can easily grep for where
the build system depends on its own location, and also change the
policy regarding this later.

Note that there is no opm-macros module; this is a "psuedo"-module
which links to an additional one (currently, the one we're in)
2013-08-16 23:55:43 +02:00
Roland Kaufmann
0f841e1bdf Allow adding project-specific install targets
If a project needs to install something that is very specific and not
in the general build, it can use this hook to setup additional targets.
2013-08-16 23:55:42 +02:00
Andreas Lauser
15631d2ab1 FindALUGrid.cmake: incorperate Roland's comments to PR 317 2013-08-16 23:55:42 +02:00
Andreas Lauser
eed47decf2 tweak the configure script
we should recognize the --with-{alugrid,metis} options...
2013-08-16 23:55:41 +02:00
Andreas Lauser
044e07be58 make the FindALUGrid module compatible with the OPM build system 2013-08-16 23:55:40 +02:00
Andreas Lauser
00c5fb427c add cmake module to detect ewoms 2013-08-16 23:55:40 +02:00
Andreas Lauser
00344dc20f Add HAVE_CXA_DEMANGE config.h variable to Finddune-common.cmake
This will make Dune::classname usable on Dune master. (the 2.2 release
should be fine even without it.)
2013-08-16 23:55:39 +02:00
Andreas Lauser
b5c27dbe7d Finddune-grid.cmake: test for ALUGrid and METIS
ALUGrid is needed to avoid unresolved symbols if dune-grid was
compiled with it. METIS is used by the parallel version of
ALUGrid. (Although it is not open source...)
2013-08-16 23:55:38 +02:00
Andreas Lauser
9ef6a91bb5 add cmake modules to find ALUGrid and METIS 2013-08-16 23:55:37 +02:00
Andreas Lauser
1ae9e7cb89 CMake: add module for dune-localfunctions 2013-08-16 23:55:37 +02:00
Roland Kaufmann
2789809858 Publicly depend on version of dune-grid
The interface of the class PersistentContainer changed between DUNE
2.2 and DUNE 2.3 in an incompatible way, so we need to present
different versions of the class depending on the version of DUNE linked
with. This changeset adds the version variables for dune-grid to the
list of publicly necessary #defines that must go into using
dune-cornerpoint.

Notice that this will cause the definition of DUNE_GRID_VERSION_XXX
to be added to the flags list of dune-cornerpoint. This can be seen as
either a bug or a feature. If you try to link first dune-cornerpoint to
one version and then to another version of DUNE later, there is a very
good chance that you'll end up with problems anyway.
2013-08-16 23:55:36 +02:00
Roland Kaufmann
8ec655e321 Remove support for AGMG from the build system
AGMG is now under a closed-source license, meaning that results
obtained with this solver is not freely reproducible by others.
Its use is therefore discouraged.

As of version 2.3, the DUNE AMG parts are competitive, so there
is a free and open alternative.
2013-08-16 23:55:35 +02:00
Roland Kaufmann
56b910e2ce Use parallel version if and only if MPI is installed 2013-08-16 23:55:34 +02:00
Roland Kaufmann
7e992a2894 Enable use of parallel version of MUMPS
If we have enabled MPI, then we must call MPI_Init and MPI_Finalize
in the program anyway so we may as well use the parallel version of
MUMPS.
2013-08-16 23:55:34 +02:00
Roland Kaufmann
30a7e953a7 Use system-provided MUMPS library for AGMG
This require us to compile in a small glue module which maps the
name of the internal routine to the system routine.
2013-08-16 23:55:33 +02:00
Roland Kaufmann
ff9da40f32 Make opm-core pick up AGMG through the standard list 2013-08-16 23:55:32 +02:00
Roland Kaufmann
6b5ce2e5a5 Allow packages to add source code to the project
By returning a ${package}_SOURCES variable with the names of the code,
it will be propagated to ${project}_SOURCES and subsequently compiled
into the library.

AGMG (Algebraic Multigrid) uses this functionality.
2013-08-16 23:55:32 +02:00
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