Compare commits

...

84 Commits

Author SHA1 Message Date
Arne Morten Kvarving
faab33a051 bump packaging version to 2017.04 final 2017-04-26 10:13:39 +02:00
Arne Morten Kvarving
513893eb59 bump version to 2017.04 2017-04-26 10:13:08 +02:00
Arne Morten Kvarving
62dc95e894 bump packaging versions to 2017.04 rc1 2017-04-18 09:40:39 +02:00
Andreas Lauser
8e11e44559 Change the version to 2017.04 2017-04-13 12:58:53 +02:00
Atgeirr Flø Rasmussen
5c62c6e96f Merge pull request #239 from dr-robertk/PR/add-some-more-warning-disable
added two gcc 6.3 related warning disable for 3rd party libs.
2017-04-10 14:49:24 +02:00
Robert Kloefkorn
d38658858d added two gcc 6.3 related warnings. 2017-04-10 13:44:54 +02:00
Atgeirr Flø Rasmussen
176d0b188e Merge pull request #194 from blattms/support-c++14-for-dune-2.5
dune 2.5 support
2017-04-07 21:02:12 +02:00
Atgeirr Flø Rasmussen
41c3eb7ff0 Merge pull request #235 from akva2/fix_path_intree_config_file_dc
fix path written to in-tree config file
2017-04-07 14:00:57 +02:00
Arne Morten Kvarving
8d8e612356 fix path written to in-tree config file 2017-04-07 11:20:37 +02:00
Atgeirr Flø Rasmussen
40bb3159ea Merge pull request #234 from nairr/terminal_output_problem_color
modify terminal output color for problem messages
2017-04-04 13:48:11 +02:00
Rohith Nair
be3f1ed59b edited formatting 2017-04-04 10:01:13 +02:00
Rohith Nair
2313ab4029 Changed terminal output color for problem messages to magenta from red 2017-04-04 09:55:46 +02:00
Joakim Hove
554b5ff1b6 Merge pull request #232 from joakim-hove/findert-use-eclgrid
Changed FindERT to create ecl_grid.
2017-03-27 14:56:44 +02:00
Joakim Hove
98959d4a08 Changed FindERT to create ecl_grid. 2017-03-20 11:30:28 +01:00
Atgeirr Flø Rasmussen
f9311b96f3 Merge pull request #231 from atgeirr/refine-simple-logging
Make setupSimpleDefaultLogging() more flexible.
2017-03-20 08:08:04 +01:00
Atgeirr Flø Rasmussen
26974f28ef Make implementation of stdoutIsTerminal() more robust. 2017-03-17 15:40:02 +01:00
Atgeirr Flø Rasmussen
e0105c6ccf Merge pull request #205 from GitPaean/adding_Wcast_qual_warning_flag
adding -Wcast-qual to disable_warnings.h
2017-03-17 15:35:49 +01:00
Atgeirr Flø Rasmussen
7462cc4b96 Only use color coding for simple log setup if terminal.
Note that isatty() might need to be replaced by isatty_() for Windows.
2017-03-17 08:46:50 +01:00
Atgeirr Flø Rasmussen
726496c0b6 Make setupSimpleDefaultLogging() more flexible.
Also added documentation for the function.
2017-03-16 12:56:34 +01:00
Andreas Lauser
f979d1942f Merge pull request #230 from akva2/travis_enable_bc
fixed: install bc on travis builder
2017-03-10 15:03:38 +01:00
Arne Morten Kvarving
59319936e0 fixed: install bc on travis builder
required by some scripts
2017-03-10 13:52:53 +01:00
Atgeirr Flø Rasmussen
afc5903dfa Merge pull request #229 from akva2/remove_libtool
remove libtool archive generation
2017-02-23 15:26:51 +01:00
Arne Morten Kvarving
481d416c22 remove libtool archive generation 2017-02-23 14:13:49 +01:00
Atgeirr Flø Rasmussen
1788ecc1f0 Merge pull request #226 from andlaus/move_valgrind_crs
move the infrastructure for valgrind client requests into the Opm namespace
2017-02-10 10:22:14 +01:00
Andreas Lauser
52c05e6525 move the infrastructure for valgrind client requests into the Opm namespace 2017-02-09 18:26:31 +01:00
Atgeirr Flø Rasmussen
7222b210c7 Merge pull request #225 from akva2/automate_data_updates
add script for automating data updates
2017-01-26 13:50:44 +01:00
Arne Morten Kvarving
dcdb444050 add script for automating data updates 2017-01-26 11:51:45 +01:00
Pål Grønås Drange
7843964163 Merge pull request #224 from pgdr/message-status-for-opm-data
status if opm-data found, not warning
2017-01-12 09:30:51 +01:00
Pål Grønås Drange
8984579e77 status if opm-data found, not warning 2017-01-09 19:04:10 +01:00
Atgeirr Flø Rasmussen
1854c37b5b Merge pull request #223 from bska/update-fdappl-requirements
Request Boost.Regex to Support FD-Application Acceptance Tests
2017-01-09 16:58:17 +01:00
Bård Skaflestad
57fa257642 Request Boost.Regex to Support FD-Application Acceptance Tests 2017-01-09 15:52:19 +01:00
Atgeirr Flø Rasmussen
46144e814a Merge pull request #222 from andlaus/minor_reorg
Minor reorg
2016-12-14 21:45:50 +01:00
Andreas Lauser
3d096a54ec move over the code for valgrind client requests from opm-material 2016-12-14 16:47:41 +01:00
Atgeirr Flø Rasmussen
70bec15988 Merge pull request #221 from andlaus/reset_locale
Provide a free function to reset the localization settings
2016-12-08 12:01:23 +01:00
Andreas Lauser
f17880579c Provide a free function to reset the localization settings
Under some circumstances, some environments seem to set a locale which
they do not install. In turn this leads to std::runtime_errror being
thrown by some parts of Boost (for some versions) which causes
unsolicited program aborts.

This issue asside, it looks pretty weird if the e.g. the number format
is different than the that of the language used to print stuff by rest
of the simulation.
2016-12-07 14:04:32 +01:00
Arne Morten Kvarving
7b4bd58a82 Merge pull request #220 from akva2/fix_parallel_core_grid
fixed: mpi and dune-istl needs to be explicity in opm-grid now
2016-11-30 17:41:20 +01:00
Arne Morten Kvarving
aac2166cb8 fixed: mpi and dune-istl needs to be explicity in opm-grid now
previously opm-core guaranteed these
2016-11-30 15:55:24 +01:00
Arne Morten Kvarving
14efa7ed38 Merge pull request #218 from akva2/fix_test_program
fix test program
2016-11-30 00:46:12 +01:00
Arne Morten Kvarving
6f6801a5f2 look for opm/core/wells.h
opm/core/grid.h is no more
2016-11-29 23:57:16 +01:00
Arne Morten Kvarving
fa47d6a623 fix test program 2016-11-29 22:55:42 +01:00
Atgeirr Flø Rasmussen
29e12bfa79 Merge pull request #217 from akva2/update_downstreams_grid
update downstream list
2016-11-29 22:49:21 +01:00
Arne Morten Kvarving
d406e9f344 update travis build order 2016-11-29 22:07:41 +01:00
Arne Morten Kvarving
15583bdec6 update downstream list
opm-grid move in dependency graph
2016-11-29 21:36:07 +01:00
Atgeirr Flø Rasmussen
c15c3b6b9f Merge pull request #216 from atgeirr/revert-depencency-grid-core
Revert depencency grid core
2016-11-29 21:04:05 +01:00
Atgeirr Flø Rasmussen
bfeef48fbd Update test program to find opm-core.
Used classes were moved to opm-grid.
2016-11-29 13:19:56 +01:00
Atgeirr Flø Rasmussen
5a706c635e Merge branch 'PR/revert-dependency-grid-core' of https://github.com/dr-robertk/opm-common into dr-robertk-PR/revert-dependency-grid-core 2016-11-29 13:10:32 +01:00
Atgeirr Flø Rasmussen
bf656cd28f Merge pull request #213 from andlaus/move_Unused_hpp
move the Unused.hpp file from opm-material to here
2016-11-29 10:35:21 +01:00
Robert Kloefkorn
15f4d7e808 small change. 2016-11-24 13:24:42 +01:00
Robert Kloefkorn
264f621021 Revert dependencies of opm-core and opm-grid. opm-core is not dependent on
opm-grid.
2016-11-23 14:28:24 +01:00
Arne Morten Kvarving
35bd292fdf Merge pull request #214 from akva2/update_downstreams_ewoms
update downstream list
2016-11-22 16:03:51 +01:00
Andreas Lauser
5100db5694 move the Unused.hpp file from opm-material to here 2016-11-22 15:53:36 +01:00
Arne Morten Kvarving
fa3bba5510 update downstream list
ewoms moved in the tree
2016-11-22 15:21:35 +01:00
Atgeirr Flø Rasmussen
bbc8d23473 Merge pull request #210 from atgeirr/option-warnings-crossmodule
Make use of system includes for cross-module optional.
2016-11-21 13:22:32 +01:00
Atgeirr Flø Rasmussen
2ee1224917 Make use of system includes for cross-module optional. 2016-11-21 11:08:38 +01:00
Atgeirr Flø Rasmussen
2ddb6ac8c2 Merge pull request #162 from andlaus/frankenstein
[POC] added ewoms dependency to opm-simulators.
2016-11-18 15:49:35 +01:00
Robert Kloefkorn
825b96c1a3 added ewoms dependency to opm-simulators. 2016-11-17 17:41:42 +01:00
Andreas Lauser
8b3a4a6e23 Merge pull request #207 from blattms/fix-multiple-dune-version-request-hickups
Request dune module versions only in the most upstream opm module.
2016-11-17 17:38:26 +01:00
Markus Blatt
6608bc87e4 Request dune module versions only in the most upstream opm module.
Otherwise we are running into weired problems as downstream modules
refuse to set the version information correctly. This leads to
unset DUNE_MODULE_VERSION_{MINOR,MAJOR,REVISION} in config.h.

This only happened for dune-istl which was first requested by opm-core
but that module did not set the version information. Opm-grid requested
it, too. But this time this information was not correctly put into
opm-grid-config.cmake leading to erroneous checks like:

if (DEFINED DUNE_ISTL_VERSION_MAJOR AND NOT "${DUNE_ISTL_VERSION_MAJOR}" STREQUAL "")
        message (WARNING "Incompatible value \"${DUNE_ISTL_VERSION_MAJOR}\" of variable \"DUNE_ISTL_VERSION_MAJOR\"")
endif ()

Note there should have been a number instead of an empty string. The version
numbers were also undefined in config.h of opm-grid. Same picture for opm-simulators.

My assumption is that for these modules Finddune-istl.cmake was implicitly included
when searching for opm-core. That module sets the version in the parent scope only
which might cause this problem. I am not sure though.

With this commit the version is always added to CONFIG_VARS for the first most upstream
OPM module that requests a dune module. This fixes the issue at least for me on my system.

Also note that this problem did not occur in all configurations. I experienced breaking
builds with the installed dune module 2.4.1 of Debian backports while using dunecontrol.
The warnings about unmatching versions happened with uninstalled 2.3, too.
2016-11-17 17:01:33 +01:00
Atgeirr Flø Rasmussen
ec63c6b7fd Merge pull request #202 from atgeirr/warnings-fix
Silence warnings not from current module.
2016-11-16 10:14:46 +01:00
Atgeirr Flø Rasmussen
4398342048 Merge pull request #206 from joakim-hove/disable-ewoms-tests
Disable ewoms tests
2016-11-15 12:07:07 +01:00
Joakim Hove
c62f91154a Temporary measures to reduce build time on Travis.
- The tests are disabled when building ewoms.
 - opm-upscaling is not built.
2016-11-15 11:16:38 +01:00
Joakim Hove
00debb5e08 Use ON to silence external warnings. 2016-11-14 20:07:14 +01:00
Kai Bao
2724aae005 adding -Wcast-qual to disable_warnings.h 2016-11-14 18:05:41 +01:00
Arne Morten Kvarving
f48a647fc8 Merge pull request #204 from joakim-hove/travis-cleanup
Remove unused travis scripts
2016-11-14 09:49:34 +01:00
Joakim Hove
f6fb9d09c4 Removed unused travis scripts 2016-11-13 08:26:57 +01:00
Andreas Lauser
bb1040df70 Merge pull request #201 from andlaus/check_for_valgrind_in_opm-material
opm-material: actually check for valgrind
2016-11-08 11:42:35 +01:00
Andreas Lauser
05e1bd64a9 opm-material: actually check for valgrind
a config.h variable was already set but the actual test was not run
for opm-material.
2016-11-08 15:04:52 +01:00
Atgeirr Flø Rasmussen
5344392b99 Silence warnings not from current module. 2016-11-08 10:46:35 +01:00
Markus Blatt
ebe3457064 Correctly use -std=c++<version> instead of -std=<version> with older CMake. 2016-11-04 16:25:32 +01:00
Atgeirr Flø Rasmussen
1c5a17b6e8 Merge pull request #200 from atgeirr/bump-version
dune.module: change version to 2017.04-pre
2016-11-04 12:30:26 +01:00
Atgeirr Flø Rasmussen
596bafb2e7 dune.module: change version to 2017.04-pre 2016-11-04 12:26:59 +01:00
Markus Blatt
dbad03c62f Correctly request compiler flags for feature tests 2016-11-03 12:09:10 +01:00
Markus Blatt
2ce0810f68 Readded lost ) 2016-11-03 12:05:58 +01:00
Markus Blatt
69da5816d6 Make c++14 available for CMake >=3.1 and do not test c++0x 2016-11-03 12:00:11 +01:00
Arne Morten Kvarving
b4fd17e9a7 Merge pull request #199 from blattms/support-external-cjson
Support external cjson
2016-11-03 11:51:02 +01:00
Markus Blatt
bf31f7b4e9 Force a search for installed cJSON when looking for opm-parser.
If the version within opm-parser was used then the symbols are
in libopmjson anyway.
2016-11-02 21:24:40 +01:00
Markus Blatt
c7cf7d8144 Only search in PROJECT_SOURCE_DIR for cjson.
Otherwise will never find an installed version for downstream modules
as they will find the header in opm-parser but not library.
2016-11-02 21:22:58 +01:00
Markus Blatt
34ed49d765 Add external cJSON library to opm-parser_LIBRARIES. 2016-11-02 20:28:12 +01:00
Markus Blatt
b75f24afc2 Use external instead of opm/json for suffixes to search for cjson of opm-parser. 2016-11-02 19:46:41 +01:00
Arne Morten Kvarving
4696486879 Merge pull request #198 from akva2/jenkins_build_threads
added: allow building with multiple threads in jenkins scripts
2016-11-02 15:51:39 +01:00
Arne Morten Kvarving
e0a146708c added: allow building with multiple threads in jenkins scripts
use the BUILDTHREADS environment variable

convenient for local use
2016-11-02 15:46:30 +01:00
Markus Blatt
1352e89d4e Make dune-grid compile test more generic 2016-10-26 13:42:42 +00:00
Markus Blatt
b46d3df2f7 Find dune-grid 2.5 2016-10-26 13:19:40 +00:00
Markus Blatt
4d31c7efdc Activate -std=c++14 switch if compiler supports it.
This is needed to make OPM compile with 2.5. Otherwise dune-common
is not found because of missing std::decay_t support.
2016-10-25 09:41:29 +00:00
38 changed files with 662 additions and 115 deletions

View File

@@ -17,6 +17,7 @@ addons:
- libgmp3-dev
- libsuitesparse-dev
- libeigen3-dev
- bc
before_script:
- export CXX="g++-4.8" CC="gcc-4.8" FC="gfortran-4.8"

View File

@@ -12,7 +12,7 @@ endmacro (dir_hook)
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "set(OPM_MACROS_ROOT ${CMAKE_INSTALL_PREFIX}/share/opm)
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)")
set(OPM_PROJECT_EXTRA_CODE_INTREE "set(OPM_MACROS_ROOT ${OPM_COMMON_ROOT})
set(OPM_PROJECT_EXTRA_CODE_INTREE "set(OPM_MACROS_ROOT ${OPM_MACROS_ROOT})
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)")
# project information is in dune.module. Read this file and set variables.

View File

@@ -54,6 +54,9 @@ list (APPEND PROGRAM_SOURCE_FILES
list( APPEND PUBLIC_HEADER_FILES
opm/common/ErrorMacros.hpp
opm/common/Exceptions.hpp
opm/common/ResetLocale.hpp
opm/common/Unused.hpp
opm/common/Valgrind.hpp
opm/common/data/SimulationDataContainer.hpp
opm/common/OpmLog/CounterLog.hpp
opm/common/OpmLog/EclipsePRTLog.hpp

View File

@@ -33,23 +33,34 @@ include(CheckIncludeFileCXX)
# macro to only add option once
include(AddOptions)
if(CMAKE_VERSION VERSION_LESS 3.1)
if(NOT MSVC)
# try to use compiler flag -std=c++11
CHECK_CXX_ACCEPTS_FLAG("-std=c++11" CXX_FLAG_CXX11)
if(CXX_FLAG_CXX11)
add_options (CXX ALL_BUILDS "-std=c++11")
set(CXX_STD0X_FLAGS "-std=c++11")
else()
# try to use compiler flag -std=c++0x for older compilers
CHECK_CXX_ACCEPTS_FLAG("-std=c++0x" CXX_FLAG_CXX0X)
if(CXX_FLAG_CXX0X)
add_options (CXX ALL_BUILDS "-std=c++0x")
set(CXX_STD0X_FLAGS "-std=c++0x")
endif(CXX_FLAG_CXX0X)
endif(CXX_FLAG_CXX11)
endif(NOT MSVC)
# Force CXX Standard cross platfrom for CMakeVersion >=3.1
set(CMAKE_CXX_EXTENSIONS OFF)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
if(NOT MSVC)
foreach(_flag "14" "11")
set(_FLAG "CXX_FLAG_CXX${_flag}")
string(TOUPPER ${_FLAG} _FLAG)
# try to use compiler flag -std=c++${_flag}
CHECK_CXX_ACCEPTS_FLAG("-std=c++${_flag}" ${_FLAG})
if(${_FLAG})
if(CMAKE_VERSION VERSION_LESS 3.1)
add_options (CXX ALL_BUILDS "-std=c++${_flag}")
endif()
set(CXX_STD0X_FLAGS "-std=c++${_flag}")
#Use vriables for CMake > 3.1 set the standard with no extensions
set(CMAKE_CXX_STANDARD ${_flag})
break()
endif()
endforeach()
endif(NOT MSVC)
endif()
if(CMAKE_VERSION VERSION_LESS 3.1)
# if we are building with an Apple toolchain in MacOS X,
# we cannot use the old GCC 4.2 fork, but must use the
# new runtime library
@@ -58,8 +69,8 @@ if(CMAKE_VERSION VERSION_LESS 3.1)
if (APPLE AND (_comp_id MATCHES "CLANG"))
CHECK_CXX_ACCEPTS_FLAG ("-stdlib=libc++" CXX_FLAG_STDLIB_LIBCXX)
if (CXX_FLAG_STDLIB_LIBCXX)
add_options (CXX ALL_BUILDS "-stdlib=libc++")
set (CXX_STDLIB_FLAGS "-stdlib=libc++")
add_options (CXX ALL_BUILDS "-stdlib=libc++")
set (CXX_STDLIB_FLAGS "-stdlib=libc++")
endif (CXX_FLAG_STDLIB_LIBCXX)
endif (APPLE AND (_comp_id MATCHES "CLANG"))
@@ -69,13 +80,9 @@ if(CMAKE_VERSION VERSION_LESS 3.1)
else (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
set (CXX_SPACE)
endif (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
else()
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
# Workaround bug in cmake:
# cxx standard flags are not applied in CheckCXXSourceCompiles
if (CMAKE_CXX_STANDARD EQUAL 14)
@@ -85,6 +92,7 @@ else()
endif()
endif()
# perform tests
include(CheckCXXSourceCompiles)

View File

@@ -242,9 +242,10 @@ if (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND
set (CMAKE_REQUIRED_INCLUDES ${ERT_INCLUDE_DIR})
set (CMAKE_REQUIRED_LIBRARIES ${ERT_LIBRARIES})
check_cxx_source_compiles (
"#include <ert/ecl/EclKW.hpp>
"#include <ert/ecl/ecl_grid.h>
int main ( ) {
ERT::EclKW< int > kw( ecl_kw_alloc( \"SATNUM\", 0, ECL_INT_TYPE ) );
ecl_grid_type * grid = ecl_grid_alloc_rectangular( 10,10,10,1,1,1, NULL);
ecl_grid_free( grid );
return 0;
}" HAVE_ERT)
cmake_pop_check_state ()

View File

@@ -20,8 +20,8 @@ endif (CJSON_ROOT)
find_path (CJSON_INCLUDE_DIR
NAMES "cjson/cJSON.h"
HINTS "${CJSON_ROOT}"
PATHS "${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/../opm-parser"
PATH_SUFFIXES "include" "opm/json"
PATHS "${PROJECT_SOURCE_DIR}"
PATH_SUFFIXES "include" "external"
DOC "Path to cjson library header files"
${_no_default_path} )

View File

@@ -41,7 +41,7 @@ find_opm_package (
"#include <dune/grid/onedgrid.hh>
int main (void) {
Dune::OneDGrid grid(1, 0., 1.);
return grid.lbegin<0>(0) == grid.lend<0>(0);
return grid.size(0);
}
"
# config variables

View File

@@ -21,7 +21,7 @@ find_opm_package (
"${opm-core_DEPS}"
# header to search for
"opm/core/grid.h"
"opm/core/wells.h"
# library to search for
"opmcore"
@@ -30,12 +30,13 @@ find_opm_package (
""
# test program
"#include <opm/core/grid.h>
int main (void) {
struct UnstructuredGrid *g;
g = create_grid_empty ();
destroy_grid (g);
return 0;
"
#include <opm/core/utility/parameters/ParameterGroup.hpp>
int main()
{
Opm::parameter::ParameterGroup parameters;
parameters.insertParameter(\"number\", \"7\");
return 0;
}
"
# config variables

View File

@@ -17,8 +17,8 @@ endif()
if (EXISTS "${_opm_data_root}/norne/NORNE_ATW2013.DATA")
set( HAVE_OPM_DATA True )
set( OPM_DATA_ROOT ${_opm_data_root} )
message( "-- Setting OPM_DATA_ROOT: ${OPM_DATA_ROOT}")
message(STATUS "Setting OPM_DATA_ROOT: ${OPM_DATA_ROOT}")
else()
set( HAVE_OPM_DATA False )
message( "opm-data not found - integration tests using opm-data will be skipped.")
endif()
message(WARNING "opm-data not found - integration tests using opm-data will be skipped.")
endif()

View File

@@ -137,6 +137,21 @@ if (ERT_FOUND AND Boost_FOUND AND
${Boost_LIBRARIES}
${ERT_LIBRARIES})
# We might be using an external cJSON library
# but we have to unset the OPM_PARSER_ROOT stuff to find it
# (other NO_DEFAULT_PATH will be set).
set(_OPM_PARSER_ROOT_bak ${OPM_PARSER_ROOT})
set(OPM_PARSER_ROOT "")
find_package(cjson)
set(OPM_PARSER_ROOT ${OPM_PARSER_ROOT_bak})
if (CJSON_FOUND)
# If we do we need to add it to the libs.
set (opm-parser_LIBRARIES
${opm-parser_LIBRARIES}
${CJSON_LIBRARY})
endif (CJSON_FOUND)
# see if we can compile a minimum example
# CMake logical test doesn't handle lists (sic)
include (CMakePushCheckState)

View File

@@ -13,11 +13,19 @@ macro (opm_compile opm)
# all public header files are together with the source. prepend our own
# source path to the one of the dependencies so that our version of any
# ambigious paths are used.
set (${opm}_INCLUDE_DIR "${PROJECT_SOURCE_DIR}")
set (${opm}_INCLUDE_DIRS ${${opm}_INCLUDE_DIR} ${${opm}_INCLUDE_DIRS})
option(SILENCE_CROSSMODULE_WARNINGS "Disable warnings from cross-module includes" OFF)
if (SILENCE_CROSSMODULE_WARNINGS)
include_directories("${PROJECT_SOURCE_DIR}")
include_directories (SYSTEM ${${opm}_INCLUDE_DIRS})
else()
set (${opm}_INCLUDE_DIR "${PROJECT_SOURCE_DIR}")
set (${opm}_INCLUDE_DIRS ${${opm}_INCLUDE_DIR} ${${opm}_INCLUDE_DIRS})
include_directories (${${opm}_INCLUDE_DIRS})
endif()
# create this library, if there are any compilation units
include_directories (${${opm}_INCLUDE_DIRS})
link_directories (${${opm}_LIBRARY_DIRS})
add_definitions (${${opm}_DEFINITIONS})
set (${opm}_VERSION "${${opm}_VERSION_MAJOR}.${${opm}_VERSION_MINOR}")

View File

@@ -285,10 +285,6 @@ opm_doc (${project} ${doxy_dir})
# provide compatibility with using this build in dunecontrol
include (DuneCompat)
include (LibtoolArchives)
if (${project}_TARGET)
configure_la (${project} ${${project}_TARGET} ${project}_LIBTOOL_ARCHIVE)
endif ()
### clean in-source builds ###
include (OpmDistClean)

View File

@@ -35,6 +35,7 @@ set (ewoms_DEPS
"dune-fem"
"opm-parser"
"opm-grid"
"opm-core"
# librt (on some systems necessary for clock_gettime())
"librt REQUIRED"
# valgrind client requests

View File

@@ -3,7 +3,7 @@
# defines that must be present in config.h for our headers
set (opm-common_CONFIG_VAR
)
"HAS_ATTRIBUTE_UNUSED")
# dependencies
set (opm-common_DEPS

View File

@@ -8,6 +8,9 @@ set (opm-core_CONFIG_VAR
HAVE_DUNE_ISTL
HAVE_MPI
HAVE_PETSC
DUNE_ISTL_VERSION_MAJOR
DUNE_ISTL_VERSION_MINOR
DUNE_ISTL_VERSION_REVISION
)
# dependencies
@@ -42,5 +45,8 @@ set (opm-core_DEPS
"opm-parser REQUIRED"
# the code which implements the material laws
"opm-material REQUIRED"
# the code which implements the output routines
"opm-output REQUIRED"
# the code which implements grids
"opm-grid REQUIRED"
)

View File

@@ -12,7 +12,7 @@ set (opm-flowdiagnostics-applications_DEPS
# compile with C++0x/11 support if available
"CXX11Features REQUIRED"
"Boost 1.44.0
COMPONENTS filesystem system unit_test_framework REQUIRED"
COMPONENTS filesystem regex system unit_test_framework REQUIRED"
"ERT REQUIRED"
# prerequisite OPM modules
"opm-common REQUIRED;

View File

@@ -9,9 +9,8 @@ set (opm-grid_CONFIG_VAR
DUNE_COMMON_VERSION_MAJOR
DUNE_COMMON_VERSION_MINOR
DUNE_COMMON_VERSION_REVISION
DUNE_ISTL_VERSION_MAJOR
DUNE_ISTL_VERSION_MINOR
DUNE_ISTL_VERSION_REVISION
HAVE_DUNE_ISTL
HAVE_MPI
HAVE_ZOLTAN
)
@@ -24,13 +23,11 @@ set (opm-grid_DEPS
# various runtime library enhancements
"Boost 1.44.0
COMPONENTS date_time filesystem system unit_test_framework REQUIRED"
# DUNE dependency
"dune-common REQUIRED;
dune-grid REQUIRED;
dune-geometry REQUIRED
dune-istl"
# OPM dependency
"opm-common REQUIRED;
opm-core REQUIRED"
"MPI"
"dune-common"
"dune-grid REQUIRED"
"dune-istl"
"opm-common REQUIRED"
"opm-parser REQUIRED"
"ZOLTAN"
)

View File

@@ -20,4 +20,6 @@ set (opm-material_DEPS
"opm-common REQUIRED"
# DUNE dependency
"dune-common REQUIRED"
# valgrind client requests
"Valgrind"
)

View File

@@ -5,6 +5,10 @@
set (opm-simulators_CONFIG_VAR
HAVE_OPM_GRID
HAVE_PTHREAD
HAVE_EWOMS
DUNE_ISTL_VERSION_MAJOR
DUNE_ISTL_VERSION_MINOR
DUNE_ISTL_VERSION_REVISION
)
# dependencies
@@ -20,12 +24,13 @@ set (opm-simulators_DEPS
"dune-common REQUIRED;
dune-istl REQUIRED"
"ERTPython"
# OPM dependency
# OPM dependency
"opm-common REQUIRED;
opm-parser REQUIRED;
opm-core REQUIRED;
opm-output REQUIRED;
opm-grid"
opm-parser REQUIRED;
opm-grid REQUIRED;
opm-core REQUIRED;
opm-output REQUIRED;
ewoms REQUIRED"
# Eigen
"Eigen3 3.2.0"
)

View File

@@ -26,7 +26,7 @@ set (opm-upscaling_DEPS
dune-geometry REQUIRED;
dune-grid REQUIRED;
opm-common REQUIRED;
opm-grid REQUIRED;
opm-core REQUIRED;
opm-grid REQUIRED;
opm-output REQUIRED"
)

2
debian/changelog vendored
View File

@@ -1,4 +1,4 @@
opm-common (2015.10-1~trusty) trusty; urgency=medium
opm-common (2017.04-rfinal-1~xenial) xenial; urgency=medium
* New release

View File

@@ -5,8 +5,8 @@
Module: opm-common
Description: Open Porous Media Initiative shared infrastructure
Version: 2016.10-pre
Label: 2016.10-pre
Version: 2017.04
Label: 2017.04
Maintainer: opm@opm-project.org
MaintainerName: OPM community
Url: http://opm-project.org

View File

@@ -83,7 +83,12 @@ function build_module {
test $? -eq 0 || exit 1
if test $2 -eq 1
then
cmake --build .
if [ ! -z $BUILDTHREADS ]
then
cmake --build . -- -j$BUILDTHREADS
else
cmake --build .
fi
test $? -eq 0 || exit 2
ctest -T Test --no-compress-output
@@ -96,7 +101,12 @@ function build_module {
sed -e "s/classname=\"TestSuite\"/classname=\"${configuration}\"/g" testoutput.xml > $WORKSPACE/$configuration/testoutput.xml
fi
else
cmake --build . --target install
if [ ! -z $BUILDTHREADS ]
then
cmake --build . --target install -- -j$BUILDTHREADS
else
cmake --build . --target install
fi
fi
}
@@ -173,7 +183,13 @@ function build_downstreams {
# Installation for downstream
pushd .
cd $WORKSPACE/$configuration/build-$downstream
cmake --build . --target install
if [ ! -z $BUILDTHREADS ]
then
cmake --build . --target install -- -j$BUILDTHREADS
else
cmake --build . --target install
fi
popd
egrep_cmd="$egrep_cmd $WORKSPACE/$configuration/build-$downstream/testoutput.xml"
done

View File

@@ -12,11 +12,12 @@ downstreams=(ert
opm-parser
opm-output
opm-material
opm-core
opm-grid
opm-core
ewoms
opm-simulators
opm-upscaling
ewoms)
)
declare -A downstreamRev
downstreamRev[ert]=master
@@ -25,9 +26,9 @@ downstreamRev[opm-material]=master
downstreamRev[opm-core]=master
downstreamRev[opm-grid]=master
downstreamRev[opm-output]=master
downstreamRev[ewoms]=master
downstreamRev[opm-simulators]=master
downstreamRev[opm-upscaling]=master
downstreamRev[ewoms]=master
parseRevisions
printHeader opm-common

58
jenkins/update-opm-data.sh Executable file
View File

@@ -0,0 +1,58 @@
#!/bin/bash
MAIN_REPO=$1 # The repo the update was triggered from
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
declare -a upstreams # Everything is considered an upstream to aid code reuse
upstreams=(ert
opm-common
opm-parser
opm-output
opm-material
opm-grid
opm-core
ewoms
opm-simulators
opm-upscaling
)
declare -A upstreamRev
upstreamRev[ert]=master
upstreamRev[opm-common]=master
upstreamRev[opm-parser]=master
upstreamRev[opm-material]=master
upstreamRev[opm-core]=master
upstreamRev[opm-grid]=master
upstreamRev[opm-output]=master
upstreamRev[ewoms]=master
upstreamRev[opm-simulators]=master
upstreamRev[opm-upscaling]=master
# Setup revision tables
parseRevisions
upstreamRev[$MAIN_REPO]=$sha1
# Create branch name
BRANCH_NAME="update"
for repo in ${upstreams[*]}
do
if [ "${upstreamRev[$repo]}" != "master" ]
then
rev=${upstreamRev[$repo]}
prnumber=${rev//[!0-9]/}
BRANCH_NAME="${BRANCH_NAME}_${repo}_$prnumber"
test -n "$REASON" && REASON+=" "
REASON+="https://github.com/OPM/$repo/pull/$prnumber\n"
fi
done
# Do the commit
export REASON
export BRANCH_NAME
$WORKSPACE/deps/opm-simulators/tests/update_reference_data.sh $OPM_DATA_ROOT
# Finally open the pull request
cd $OPM_DATA_ROOT
git remote add jenkins4opm git@github.com:jenkins4opm/opm-data
git-open-pull -u jenkins4opm --base-account OPM --base-repo opm-data -r /tmp/cmsg $BRANCH_NAME

View File

@@ -85,8 +85,9 @@ namespace Log {
return message; // No color coding, not even the code for default color.
case MessageType::Warning:
return AnsiTerminalColors::blue_strong + message + AnsiTerminalColors::none;
case MessageType::Error:
case MessageType::Problem:
return AnsiTerminalColors::magenta_strong + message + AnsiTerminalColors::none;
case MessageType::Error:
case MessageType::Bug:
return AnsiTerminalColors::red_strong + message + AnsiTerminalColors::none;
default:

View File

@@ -49,6 +49,8 @@ namespace Log {
const std::string yellow_strong = "\033[33;1m";
const std::string blue = "\033[34m";
const std::string blue_strong = "\033[34;1m";
const std::string magenta = "\033[35m";
const std::string magenta_strong = "\033[35;1m";
const std::string default_color = "\033[39m";
}

View File

@@ -21,9 +21,27 @@
#include <opm/common/OpmLog/Logger.hpp>
#include <opm/common/OpmLog/StreamLog.hpp>
#include <iostream>
#include <errno.h> // For errno
#include <stdio.h> // For fileno() and stdout
#include <unistd.h> // For isatty()
namespace Opm {
namespace {
bool stdoutIsTerminal()
{
const int errno_save = errno; // For playing nice with C error handling.
const int file_descriptor = fileno(stdout);
if (file_descriptor == -1) {
// stdout is an invalid stream
errno = errno_save;
return false;
} else {
return isatty(file_descriptor);
}
}
}
std::shared_ptr<Logger> OpmLog::getLogger() {
if (!m_logger)
@@ -176,12 +194,14 @@ namespace Opm {
void OpmLog::setupSimpleDefaultLogging(const bool use_prefix)
void OpmLog::setupSimpleDefaultLogging(const bool use_prefix,
const bool use_color_coding,
const int message_limit)
{
std::shared_ptr<StreamLog> streamLog = std::make_shared<StreamLog>(std::cout, Log::DefaultMessageTypes);
OpmLog::addBackend( "SimpleDefaultLog", streamLog);
streamLog->setMessageLimiter(std::make_shared<MessageLimiter>(10));
streamLog->setMessageFormatter(std::make_shared<SimpleMessageFormatter>(use_prefix, true));
streamLog->setMessageLimiter(std::make_shared<MessageLimiter>(message_limit));
streamLog->setMessageFormatter(std::make_shared<SimpleMessageFormatter>(use_prefix, use_color_coding && stdoutIsTerminal()));
}
/******************************************************************/

View File

@@ -64,7 +64,16 @@ public:
static void removeAllBackends();
static bool enabledMessageType( int64_t messageType );
static void addMessageType( int64_t messageType , const std::string& prefix);
static void setupSimpleDefaultLogging(const bool use_prefix);
/// Create a basic logging setup that will send all log messages to standard output.
///
/// By default category prefixes will be printed (i.e. Error: or
/// Warning:), color coding will be used, and a maximum of 10
/// messages with the same tag will be printed. These settings can
/// be controlled by the function parameters.
static void setupSimpleDefaultLogging(const bool use_prefix = true,
const bool use_color_coding = true,
const int message_limit = 10);
template <class BackendType>
static std::shared_ptr<BackendType> getBackend(const std::string& name) {

View File

@@ -0,0 +1,62 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file
* \brief Provides a free function to reset the localization settings
*
* Under some circumstances, some environments seem to set a locale which they do not
* install. In turn this leads to std::runtime_errror being thrown by some parts of Boost
* (for some versions) which causes unsolicited program aborts.
*
* This issue asside, it looks pretty weird if the e.g. the number format is inconsistent
* with the language used by rest of the simulation.
*/
#ifndef OPM_RESET_LOCALE_HH
#define OPM_RESET_LOCALE_HH
#include <stdlib.h>
namespace Opm {
inline void resetLocale()
{
#ifndef WIN32
// this probably only works for POSIX compatible operating systems. for all others,
// unsetting a few environment variables should not hurt, though.
unsetenv("LC_ALL");
unsetenv("LANG");
unsetenv("LANGUAGE");
unsetenv("LC_ADDRESS");
unsetenv("LC_COLLATE");
unsetenv("LC_CTYPE");
unsetenv("LC_IDENTIFICATION");
unsetenv("LC_MEASUREMENT");
unsetenv("LC_MESSAGES");
unsetenv("LC_MONETARY");
unsetenv("LC_NAME");
unsetenv("LC_NUMERIC");
unsetenv("LC_PAPER");
unsetenv("LC_TELEPHONE");
unsetenv("LC_TIME");
#endif // !WIN32
}
} // namespace Opm
#endif

43
opm/common/Unused.hpp Normal file
View File

@@ -0,0 +1,43 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
/*!
* \file
* \brief Provides the OPM_UNUSED macro
*
* This macro can be used to mark variables as "potentially unused" which suppresses some
* bogus compiler warnings. If the compiler does not support this, the macro is a no-op.
*/
#ifndef OPM_UNUSED_HH
#define OPM_UNUSED_HH
#ifndef HAS_ATTRIBUTE_UNUSED
#define OPM_UNUSED
#else
#define OPM_UNUSED __attribute__((unused))
#endif
#ifdef NDEBUG
#define OPM_DEBUG_UNUSED
#define OPM_OPTIM_UNUSED OPM_UNUSED
#else
#define OPM_DEBUG_UNUSED OPM_UNUSED
#define OPM_OPTIM_UNUSED
#endif
#endif

311
opm/common/Valgrind.hpp Normal file
View File

@@ -0,0 +1,311 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
/*!
* \file
* \brief Some templates to wrap the valgrind client request macros
*/
#ifndef OPM_VALGRIND_HPP
#define OPM_VALGRIND_HPP
#include <opm/common/Unused.hpp>
#if HAVE_VALGRIND
#include <valgrind/memcheck.h>
#endif
#if HAVE_VALGRIND
#define OPM_VALGRIND_OPTIM_UNUSED OPM_OPTIM_UNUSED
#else
#define OPM_VALGRIND_OPTIM_UNUSED OPM_UNUSED
#endif
namespace Opm {
namespace Valgrind {
/*!
* \ingroup Valgrind
* \brief Returns whether the program is running under Valgrind or not.
*/
inline bool IsRunning()
{
#if !defined NDEBUG && HAVE_VALGRIND
return RUNNING_ON_VALGRIND;
#else
return false;
#endif
}
/*!
* \ingroup Valgrind
* \brief Make valgrind complain if any of the memory occupied by an object
* is undefined.
*
* Please note that this does not check whether the destinations of an
* object's pointers or references are defined. Also, for performance
* reasons the compiler might insert "padding bytes" between within
* the objects which leads to false positives.
*
* Example:
*
* \code
* int i;
* Valgrind::CheckDefined(i); // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which ought to be checked
*
* \param value the object which valgrind should check
*
* \return true iff there are no undefined bytes in the memory
* occupied by the object.
*/
template <class T>
inline bool CheckDefined(const T& value OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
auto tmp = VALGRIND_CHECK_MEM_IS_DEFINED(&value, sizeof(T));
return tmp == 0;
#else
return true;
#endif
}
/*!
* \ingroup Valgrind
* \brief Make valgrind complain if any of the memory occupied by an object
* is not addressable.
*
* Example:
*
* \code
* int* i = NULL;
* Valgrind::CheckAddressable(*i); // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which ought to be checked
*
* \param value the object which valgrind should check
*
* \return true iff there are no unadressable bytes in the memory
* occupied by the object.
*/
template <class T>
inline bool CheckAddressable(const T& value OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
auto tmp = VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&value, sizeof(T));
return tmp == 0;
#else
return true;
#endif
}
/*!
* \ingroup Valgrind
* \brief Make valgrind complain if any of the the memory occupied
* by a C-style array objects is undefined.
*
* Please note that this does not check whether the destinations of an
* object's pointers or references are defined. Also, for performance
* reasons the compiler might insert "padding bytes" between within
* the objects which leads to false positives.
*
* Example:
*
* \code
* int i[2];
* Valgrind::CheckDefined(i, 2); // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which ought to be checked
*
* \param value Pointer to the first object of the array.
* \param size The size of the array in number of objects
*
* \return true iff there are no undefined bytes in the memory
* occupied by the array.
*/
template <class T>
inline bool CheckDefined(const T* value OPM_VALGRIND_OPTIM_UNUSED, int size OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
auto tmp = VALGRIND_CHECK_MEM_IS_DEFINED(value, size*sizeof(T));
return tmp == 0;
#else
return true;
#endif
}
/*!
* \ingroup Valgrind
* \brief Make the memory on which an object resides undefined in
* valgrind runs.
*
* Example:
*
* \code
* int i = 0;
* Valgrind::SetUndefined(i);
* Valgrind::CheckDefined(i); // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which ought to be set to undefined
*
* \param value The object which's memory valgrind should be told is undefined
*/
template <class T>
inline void SetUndefined(const T &value OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_UNDEFINED(&value, sizeof(T));
#endif
}
/*!
* \ingroup Valgrind
* \brief Make the memory on which an array of object resides
* undefined in valgrind runs.
*
* Example:
*
* \code
* int i[3] = {0, 1, 3};
* Valgrind::SetUndefined(&i[1], 2);
* Valgrind::CheckDefined(i, 3); // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which ought to be set to undefined
*
* \param value Pointer to the first object of the array.
* \param size The size of the array in number of objects
*/
template <class T>
inline void SetUndefined(const T* value OPM_VALGRIND_OPTIM_UNUSED, int size OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_UNDEFINED(value, size*sizeof(T));
#endif
}
/*!
* \ingroup Valgrind
* \brief Make the memory on which an object resides defined.
*
* Example:
*
* \code
* int i;
* Valgrind::SetDefined(i);
* Valgrind::CheckDefined(i); // Valgrind does not complain!
* \endcode
*
* \tparam T The type of the object which valgrind should consider as defined
*
* \param value The object which's memory valgrind should consider as defined
*/
template <class T>
inline void SetDefined(const T& value OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_DEFINED(&value, sizeof(T));
#endif
}
/*!
* \ingroup Valgrind
* \brief Make the memory on which a C-style array of objects resides
* defined.
*
* Example:
*
* \code
* int i[3];
* Valgrind::SetDefined(i, 3);
* Valgrind::CheckDefined(i, 3); // Valgrind does not complain!
* \endcode
*
* \tparam T The type of the object which valgrind should consider as defined
*
* \param value Pointer to the first object of the array.
* \param n The size of the array in number of objects
*/
template <class T>
inline void SetDefined(const T *value OPM_VALGRIND_OPTIM_UNUSED, int n OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_DEFINED(value, n*sizeof(T));
#endif
}
/*!
* \ingroup Valgrind
* \brief Make valgrind complain if an object's memory is accessed.
*
* Example:
*
* \code
* int i = 1;
* Valgrind::SetNoAccess(i);
* int j = i; // Valgrind complains!
* \endcode
*
* \tparam T The type of the object which valgrind should complain if accessed
*
* \param value The object which's memory valgrind should complain if accessed
*/
template <class T>
inline void SetNoAccess(const T &value OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_NOACCESS(&value, sizeof(T));
#endif
}
/*!
* \ingroup Valgrind
* \brief Make valgrind complain if the memory of a C-style array of
* objects is accessed.
*
* Example:
*
* \code
* int i[3] = {0, 1, 2};
* Valgrind::SetNoAccess(i, 2);
* int j = i[1]; // Valgrind complains!
* \endcode
*
* \param value Pointer to the first object of the array.
* \param size The size of the array in number of objects
*/
template <class T>
inline void SetNoAccess(const T *value OPM_VALGRIND_OPTIM_UNUSED, int size OPM_VALGRIND_OPTIM_UNUSED)
{
#if !defined NDEBUG && HAVE_VALGRIND
VALGRIND_MAKE_MEM_NOACCESS(value, size*sizeof(T));
#endif
}
}} // namespace Valgrind, Opm
#endif

View File

@@ -73,6 +73,9 @@
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#pragma GCC diagnostic ignored "-Wcast-align"
#pragma GCC diagnostic ignored "-Wcast-qual"
#pragma GCC diagnostic ignored "-Wignored-attributes"
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#endif // COMPATIBLE_COMPILER
#endif // SILENCE_EXTERNAL_WARNINGS

View File

@@ -2,10 +2,10 @@
# spec file for package opm-common
#
%define tag rc4
%define tag final
Name: opm-common
Version: 2015.10
Version: 2017.04
Release: 0
Summary: Open Porous Media - common helpers and buildsystem
License: GPL-3.0

View File

@@ -1,8 +0,0 @@
#!/usr/bin/env bash
set -e
pushd . > /dev/null
opm-common/travis/build-opm-common.sh
cd opm-common/build
ctest --output-on-failure
popd > /dev/null

View File

@@ -1,7 +1,7 @@
#!/bin/bash
set -e
build_order=(opm-common opm-parser opm-material opm-output opm-core opm-grid ewoms opm-simulators opm-upscaling)
build_order=(opm-common opm-parser opm-material opm-output opm-grid opm-core ewoms opm-simulators)
# This shell script should be started with the name of a module as
# only only command line argument. It will start by building all
@@ -30,7 +30,7 @@ function upstream_build {
echo "Building: ${project}"
mkdir -p ${project}/build
pushd ${project}/build > /dev/null
cmake ../ -DENABLE_PYTHON=ON -DBUILD_TESTING=OFF -DSILENCE_EXTERNAL_WARNINGS=True -DUSE_QUADMATH=OFF -DADD_DISABLED_CTESTS=OFF
cmake ../ -DENABLE_PYTHON=ON -DBUILD_TESTING=OFF -DSILENCE_EXTERNAL_WARNINGS=ON -DUSE_QUADMATH=OFF -DADD_DISABLED_CTESTS=OFF
make
popd > /dev/null
}
@@ -44,9 +44,14 @@ function downstream_build_and_test {
# The build commands cmake, make and ctest must be given as
# separate commands and not chained with &&. If chaining with &&
# is used the 'set -e' does not exit on first error.
cmake ../ -DENABLE_PYTHON=ON -DBUILD_TESTING=ON -DSILENCE_EXTERNAL_WARNINGS=True -DUSE_QUADMATH=OFF -DADD_DISABLED_CTESTS=OFF
make
ctest --output-on-failure
if [ "$project" == "ewoms" ]; then
cmake ../ -DENABLE_PYTHON=ON -DBUILD_TESTING=OFF -DSILENCE_EXTERNAL_WARNINGS=ON -DUSE_QUADMATH=OFF -DADD_DISABLED_CTESTS=OFF
make
else
cmake ../ -DENABLE_PYTHON=ON -DBUILD_TESTING=ON -DSILENCE_EXTERNAL_WARNINGS=ON -DUSE_QUADMATH=OFF -DADD_DISABLED_CTESTS=OFF
make
ctest --output-on-failure
fi
popd > /dev/null
}

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bash
set -e
pushd . > /dev/null
cd opm-common
mkdir build
cd build
cmake ../ -DBUILD_SHARED_LIBS=ON
make
popd > /dev/null

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bash
set -e
pushd . > /dev/null
cd opm-common
mkdir build
cd build
cmake ../
make
popd > /dev/null