Commit Graph

3019 Commits

Author SHA1 Message Date
Roland Kaufmann
5f84bf718b Add library search directories to linker options
Some older packages, and notably those that are detected by PkgConfig,
only give library names and then a list of library search directories.

Add to link_directories here in order to support this configuration,
even though it is deprecated in newer versions of CMake.
2013-02-11 22:37:53 +01:00
Roland Kaufmann
42df5fdbd3 Config-mode CMake file
Users should be able to point their opm-core_DIR to the build tree of
this project and have their client programs pick up all the necessary
settings to use the library. The config mode file helps to bridge
variables from one build (of opm-core) to another (of client program).
2013-02-11 22:37:50 +01:00
Roland Kaufmann
871f6e90f1 Debug build by default
In this stage of development it is assumed that having a build that is
easy to debug from within an IDE has the most value for most users.

If any speed comparisons are to be done, be sure to configure with
-DCMAKE_BUILD_TYPE=Release
2013-02-11 22:36:49 +01:00
Roland Kaufmann
bc8a6a0027 Enable all warnings 2013-02-11 22:36:49 +01:00
Roland Kaufmann
f1111c73bb Turn on all warnings when compiling
Things that the compiler doesn't like is a source of bugs, so we strive
to compile with a full level of warning reporting.
2013-02-11 22:36:49 +01:00
Roland Kaufmann
8e9325659a Enable optimization 2013-02-11 22:36:49 +01:00
Roland Kaufmann
bed3921212 Turn on optimization flags based on build type 2013-02-11 22:36:49 +01:00
Roland Kaufmann
6c37e94056 Enable debugging support 2013-02-11 22:36:49 +01:00
Roland Kaufmann
f5c82a00b1 Compile with debug symbols and strip afterwards
Always include debug symbols in the build, and strip them to a separate
file after compiling. The GNU debugger will automatically pick up the
external debug symbols due to a link we put in the executable.

Having debug symbols do not affect the level of optimization in the GNU
toolchain.
2013-02-11 22:36:49 +01:00
Roland Kaufmann
0443b80cfc Include configuration file without directory spec.
If the program is built out-of-source-tree then the configuration file
(which is generated and not part of the source) will not be available
relative to the source code file.
2013-02-11 22:36:49 +01:00
Roland Kaufmann
d37e7740bd Remove test when the feature is not available 2013-02-11 22:36:49 +01:00
Roland Kaufmann
6aae2aeda4 Compile programs in the tests/ directory 2013-02-11 22:36:49 +01:00
Roland Kaufmann
2a653ab51a Link with DUNE if available 2013-02-11 22:36:48 +01:00
Roland Kaufmann
b057f4ccea Probe for DUNE libraries
Search for known headers and library files that indicates that DUNE is
available on the system, and setup compiler and linker variables.

Unfortunately, this module has hard-coded some knowledge of the
dependencies on other modules, and knowledge of which symbols that
should be defined. This information must be revised whenever a new
version of DUNE is released, because it is hard and error-prone to
infer this automatically.

As for the name of the modules, see the comment by mblatt at 2012-05-22
in the thread about CMake evaluation in the DUNE user forum:
<http://www.dune-project.org/flyspray/index.php?do=details&task_id=1000>
2013-02-11 22:36:48 +01:00
Roland Kaufmann
b435e1994e Link with SuperLU if available 2013-02-11 22:36:48 +01:00
Roland Kaufmann
5d54f2728b Include all necessary information to link in standard variables
Users shouldn't be required to add anything that the standard variables
in their own CMakeLists.
2013-02-11 22:36:48 +01:00
Roland Kaufmann
85a8ef5ead Provide binary value for HAVE_SUPERLU 2013-02-11 22:36:48 +01:00
Roland Kaufmann
a1141b56f7 Add define for SuperLU later than 2005
This is a prerequisite for using the find module, but some code
explicitly check this macro anyway.
2013-02-11 22:36:48 +01:00
Roland Kaufmann
779b02dda2 Search module for SuperLU library
Original downloaded from:
  <https://svn.dune-project.org/svn/dune-istl/branches/cmake/cmake/modules/FindSuperLU.cmake>

Renamed to all capitals in name so that the name of the package is
consistent with the variables it returns.
2013-02-11 22:36:48 +01:00
Roland Kaufmann
f5c9f97c83 Link with UMFPACK in SuiteSparse if available 2013-02-11 22:36:48 +01:00
Roland Kaufmann
751c721c55 Probe for SuiteSparse libraries
Search for modules in this library in the same style as Boost; by
specifying a list of components. If all on the list is present, then
a list of libraries to link with, is returned.
2013-02-11 22:36:48 +01:00
Roland Kaufmann
5876ab7f30 Check for dynamic linking of Boost::Test library
BOOST_TEST_DYN_LINK must be defined if you are *building* Boost::Test as
a shared object, and the client programs must also include this option
when they use the header files, to link to it correctly.
2013-02-11 22:36:48 +01:00
Roland Kaufmann
370b8580d1 Link with C++ Boost library 2013-02-11 22:36:48 +01:00
Roland Kaufmann
21c4194b7c Link against XML parser library 2013-02-11 22:36:48 +01:00
Roland Kaufmann
b47d0de4c6 Link against BLAS+LAPACK numerical libraries
The tests for these packages are part of the standard CMake installation
so there is no config modules for them here.
2013-02-11 22:36:48 +01:00
Roland Kaufmann
1af93bd757 Use generic boilerplate macro to include packages 2013-02-11 22:36:47 +01:00
Roland Kaufmann
4dd3f9ec96 Append standard variables to project after finding package
Normally a package returns a set of standard variables such as
Xxx_INCLUDE_DIRS. Adding this to a list that is collected for the
project amounts to a bunch of boilerplate which can rather be
encapsulated in a macro.
2013-02-11 22:36:47 +01:00
Roland Kaufmann
644fc9f5cf Don't repeat option if already present 2013-02-11 22:36:47 +01:00
Roland Kaufmann
a4cf98055d Add options without repeating them on the command-line 2013-02-11 22:36:47 +01:00
Roland Kaufmann
9a1b24c621 Compile with C++0x/11 if available
We want to compile with the -std=c++0x since DUNE uses this settings and
we need to use the same ABI as that one if we are going to link with it.

Find module is a copy of the one in cmake/modules in (the cmake branch of)
dune-common.
2013-02-11 22:36:47 +01:00
Roland Kaufmann
ddd9728f5e Added library version 2013-02-11 22:36:47 +01:00
Roland Kaufmann
6021359643 Remove files which are not part of the official library
Some files are distributed with the source, but does not end up in the
final shared object. These files are captured by the glob, so we have
to remove them afterwards. (There are fewer of these files than
explicitly list all files that should be included in the build).
2013-02-11 22:36:47 +01:00
Roland Kaufmann
400715656b Put results of platform checks in configuration header
Various features in the code base will be enabled depending on the
values written by the build system in here.
2013-02-11 22:36:47 +01:00
Roland Kaufmann
eee961a527 Define function to write a list of variables to config.h
A fundamental problem with the configure_file() command is CMake is that
the author of the template file config.h.in must know which variables
all modules need to have defined, and this is not easily communicated.

The idea behind this function is: Each Find-module can return a list of
variables that it has filled with probed values, and that should be
written to config.h, which is again included by the header file of this
module.

Each project thus defines its own config.h file, which is common between
all module's headers.
2013-02-11 22:36:47 +01:00
Roland Kaufmann
ec4c39c0d0 Ignore files generated by the CMake scripts 2013-02-11 22:36:47 +01:00
Roland Kaufmann
f675894df3 Barebones CMake configuration file 2013-02-11 22:36:47 +01:00
Roland Kaufmann
9f5eff19a2 Remove remnants of old attempt to support CMake 2013-02-11 22:36:47 +01:00
Bård Skaflestad
4d6eca1847 Merge pull request #135 from atgeirr/doc-improvements
Doc and comment improvements
2013-02-06 01:26:29 -08:00
Atgeirr Flø Rasmussen
ab5183f1c3 Merge pull request #140 from bska/ert-cleanup
Ert cleanup
2013-02-05 23:44:36 -08:00
Atgeirr Flø Rasmussen
a80141092d Minor mod: removed text about low-level interfaces. 2013-02-06 08:42:02 +01:00
Atgeirr Flø Rasmussen
974cf9c33f Merge pull request #138 from bska/release-cleanup
Correct a number of latent issues in `tarjan.c`
2013-02-05 23:38:25 -08:00
Bård Skaflestad
9d2191dd37 Catch up to changing location of ERT headers. 2013-02-05 15:20:12 +01:00
Bård Skaflestad
c245a0ae7a Catch up to ERT library reorganisation
Specifically, changing locations of headers and library renaming

    libgeometry.a -> libert_geometry.a
2013-02-05 15:19:36 +01:00
Bård Skaflestad
fb482740d4 Catch up to changing location of ERT headers 2013-02-05 15:18:17 +01:00
Arne Morten Kvarving
af388bb81c Update import of ERT-Eclipse headers to new location 2013-02-05 15:07:35 +01:00
Bård Skaflestad
edeb9d7551 Replace an assignment with intended equality test
This corrects a latent error that has been present since the inception
of this module.
2013-02-01 16:30:45 +01:00
Bård Skaflestad
089988aa16 Eliminate redundant explicit type conversion.
The pointers in question are already type 'int *'.  There is no need to
explicitly convert them to that type too.
2013-02-01 16:25:46 +01:00
Bård Skaflestad
cf922e73ce Eliminate release-mode build warning.
The 'cbottom' variable is only used within an assert().  Don't define
the variable in release (i.e., "NDEBUG") mode.
2013-02-01 16:15:35 +01:00
Bård Skaflestad
8f6be16ac3 Use portable method of zeroing vector of ints.
The memset() technique is only applicable to platforms for which
numerical zero is represented by all bits zero.
2013-02-01 16:06:39 +01:00
Atgeirr Flø Rasmussen
1ca82a7e9f Merge pull request #136 from bska/release-cleanup
Avoid clobbering existing tests for SuperLU
2013-01-31 00:20:37 -08:00