Commit Graph

2603 Commits

Author SHA1 Message Date
Roland Kaufmann
88d635524c Search in Autotools variant of library directories too 2013-02-11 22:37:53 +01:00
Roland Kaufmann
275097ae34 Only add found libraries to test compilations
If the library is not found, we will now get a message that the test
program failed to link because of a missing symbol, instead of an error
message from CMake that we tried to add -NOTFOUND libraries.
2013-02-11 22:37:53 +01:00
Roland Kaufmann
78bb77d863 Only add to -std option to C++ flags
CMAKE_REQUIRED_FLAGS is intended to be added only to the compile for the
next probe, and inside an cmake_push_check_state/cmake_pop_check_state
guard. If we add it to the main flags (CMAKE_CXX_FLAGS), it will also be
added to subsequent checks, so it suffices.
2013-02-11 22:37:53 +01:00
Roland Kaufmann
507c122395 Also search include/ subdirectory for header files
If the package is installed at system standard location (such as
/usr or /usr/local), the headers will be located in the include
subdirectory and not under the root.
2013-02-11 22:37:53 +01:00
Roland Kaufmann
834163707d Provide find module to search for opm-core library
This find module is provided to help user programs locate an opm-core
library installation on their system; it is not used by opm-core itself.

Note that it has a direct dependency on the UseOpmFind and UseOpmPackage
helper modules; these must be in the CMAKE_MODULE_PATH also.
2013-02-11 22:37:53 +01:00
Roland Kaufmann
607231b9e0 Add found variables to another library's
Instead of adding a package's standard variables to the project, it may
be desirable to be able to specify the prefix of the variables to add
them to, so the macro find_and_append can also be used in find modules.
2013-02-11 22:37:53 +01:00
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
Atgeirr Flø Rasmussen
fab3ea9723 Merge pull request #93 from bska/ert-nondefault-location-build-fix
Fix build if ERT is installed in a non-default location
2012-11-08 23:31:48 -08:00
Atgeirr Flø Rasmussen
8af339d6be Merge pull request #92 from bska/signed-vs-unsigned-ert
Fix signed-vs-unsigned comparison warning
2012-11-08 23:30:45 -08:00
Bård Skaflestad
55263da177 Fix build if ERT is installed in non-default location
The existing description did not properly account for ERT (or, more
appropriately, the "libecl" part of ERT) being installed in a
non-default location (e.g., somewhere below ${HOME}).

As EclipseGridParser.hpp declares various ERT-dependent types and
functions if a build configuration supports ERT (activated by the
`--with-ert' configure option), we need a proper include path to
reference the ERT headers.  The fix is simple--just insert the
$(ERT_CPPFLAGS) into the already existing $(AM_CPPFLAGS).
2012-11-08 13:59:19 +01:00
Bård Skaflestad
44f54cb712 Fix signed-vs-unsigned comparison warning
The existing code compared the output of data->size(), which is a
std::vector<double>::size_type (typically std::size_t) and therefore an
unsigned integer type to the number 'grid.number_of_cells' which is a
(signed) 'int'.  This leads to an annoying warning when increasing the
warning level in GCC.

While here, also insert code to verify that the 'stride' is a positive
number lest the subsequent assignment loop reference (*data) elements
out of bounds.
2012-11-07 17:23:45 +01:00
Bård Skaflestad
eb4bf0a373 Merge pull request #91 from joakim-hove/writeEclActive
Write ecl active
2012-11-07 06:40:00 -08:00
Joakim Hove
43adfaeda5 Added start_date_ property to the SimulatorTimer class 2012-11-07 14:53:26 +01:00
Joakim Hove
a3efb49de2 Added comments + make sure to only export active cells in writeEclData 2012-11-07 13:31:46 +01:00