Compare commits
87
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef0b41419e | ||
|
|
f8cac9cf3f | ||
|
|
c784931db8 | ||
|
|
e7b1172528 | ||
|
|
e1f7da13d2 | ||
|
|
6715ed6d48 | ||
|
|
5662f2a188 | ||
|
|
db0a52ffdb | ||
|
|
c7fc21e343 | ||
|
|
7a891baef7 | ||
|
|
fc4bac6b7a | ||
|
|
352b5a371d | ||
|
|
2edffb8e61 | ||
|
|
29d3df8e58 | ||
|
|
2c74f75231 | ||
|
|
7c779697c7 | ||
|
|
e6e5491c74 | ||
|
|
48472bcf1a | ||
|
|
fd411cb1b7 | ||
|
|
38e198d961 | ||
|
|
3283278090 | ||
|
|
151e6e55e4 | ||
|
|
f5bf291f7d | ||
|
|
9646753a10 | ||
|
|
9ca5b7d37b | ||
|
|
73d978d6c5 | ||
|
|
0ea57b9054 | ||
|
|
2f872e82b3 | ||
|
|
8c9776688d | ||
|
|
4b60de7248 | ||
|
|
67a8d5b553 | ||
|
|
e3ff47dd9f | ||
|
|
0a9bae6587 | ||
|
|
15aba45d53 | ||
|
|
da654bde90 | ||
|
|
19aaeff10a | ||
|
|
f3be13c5af | ||
|
|
579a648ebc | ||
|
|
08b659fe11 | ||
|
|
531fb27ba1 | ||
|
|
0024fd9052 | ||
|
|
f8841cea15 | ||
|
|
3dd214ba34 | ||
|
|
ef5f730786 | ||
|
|
65b4a7cc96 | ||
|
|
62c2b15c29 | ||
|
|
5df5c59c27 | ||
|
|
98728e91f7 | ||
|
|
5c731bf2ce | ||
|
|
bea6eb9240 | ||
|
|
5500dcfe8b | ||
|
|
8502fdd324 | ||
|
|
073e0c809c | ||
|
|
9e88a3d4e7 | ||
|
|
d997b26bf9 | ||
|
|
b9dde75a4d | ||
|
|
19ca0e291b | ||
|
|
2c00b418b5 | ||
|
|
b7302a5ace | ||
|
|
89b84ccde4 | ||
|
|
d361bd8766 | ||
|
|
9602be7ca0 | ||
|
|
f147dd9589 | ||
|
|
eaf09f34c3 | ||
|
|
ed50891e5f | ||
|
|
cdbcb74e5e | ||
|
|
6d2194edc2 | ||
|
|
fbec9b1e0d | ||
|
|
2b342ce3f0 | ||
|
|
2aedb2407f | ||
|
|
fa3a6a1b13 | ||
|
|
cd4c0f54fb | ||
|
|
a7402e5720 | ||
|
|
6332d56c2c | ||
|
|
e6c4d4f0d0 | ||
|
|
530791ede3 | ||
|
|
f8ef8dbe07 | ||
|
|
cb46a93dca | ||
|
|
ec96d6e9c9 | ||
|
|
e86d9b8b73 | ||
|
|
0a7a9f65a3 | ||
|
|
7d7dd7e582 | ||
|
|
cf06e2c00b | ||
|
|
8aa6894a88 | ||
|
|
1be92935b0 | ||
|
|
d1a3e4a872 | ||
|
|
0dc982c005 |
@@ -8,6 +8,7 @@ addons:
|
|||||||
sources:
|
sources:
|
||||||
- boost-latest
|
- boost-latest
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
|
- george-edison55-precise-backports
|
||||||
packages:
|
packages:
|
||||||
- libboost1.55-all-dev
|
- libboost1.55-all-dev
|
||||||
- gcc-4.8
|
- gcc-4.8
|
||||||
@@ -18,6 +19,13 @@ addons:
|
|||||||
- libsuitesparse-dev
|
- libsuitesparse-dev
|
||||||
- libeigen3-dev
|
- libeigen3-dev
|
||||||
- bc
|
- bc
|
||||||
|
- cmake
|
||||||
|
- cmake-data
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- TRAVIS_CI=1
|
||||||
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- export CXX="g++-4.8" CC="gcc-4.8" FC="gfortran-4.8"
|
- export CXX="g++-4.8" CC="gcc-4.8" FC="gfortran-4.8"
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Find clang-check.
|
||||||
|
#
|
||||||
|
# This module defines:
|
||||||
|
# CLANGCHECK_PROGRAM, the clang-check executable.
|
||||||
|
# CLANGHCECK_FOUND, If false, do not try to use cppcheck.
|
||||||
|
#
|
||||||
|
find_program(CLANGCHECK_PROGRAM NAMES clang-check clang-check-3.8)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(ClangCheck DEFAULT_MSG CLANGCHECK_PROGRAM)
|
||||||
|
|
||||||
|
mark_as_advanced(CLANGCHECK_PROGRAM)
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Find CppCheck.
|
||||||
|
#
|
||||||
|
# This module defines:
|
||||||
|
# CPPCHECK_PROGRAM, the cppcheck executable.
|
||||||
|
# CPPCHECK_FOUND, If false, do not try to use cppcheck.
|
||||||
|
#
|
||||||
|
find_program(CPPCHECK_PROGRAM NAMES cppcheck)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(CppCheck DEFAULT_MSG CPPCHECK_PROGRAM)
|
||||||
|
|
||||||
|
mark_as_advanced(CPPCHECK_PROGRAM)
|
||||||
+30
-12
@@ -33,7 +33,7 @@ endif (ERT_ROOT)
|
|||||||
find_path (ERT_ECL_INCLUDE_DIR
|
find_path (ERT_ECL_INCLUDE_DIR
|
||||||
NAMES "ert/ecl/ecl_util.h"
|
NAMES "ert/ecl/ecl_util.h"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
PATH_SUFFIXES "libecl/include/" "include"
|
PATH_SUFFIXES "libecl/include/" "include"
|
||||||
DOC "Path to ERT Eclipse library header files"
|
DOC "Path to ERT Eclipse library header files"
|
||||||
${_no_default_path}
|
${_no_default_path}
|
||||||
@@ -41,7 +41,7 @@ find_path (ERT_ECL_INCLUDE_DIR
|
|||||||
find_path (ERT_ECL_WELL_INCLUDE_DIR
|
find_path (ERT_ECL_WELL_INCLUDE_DIR
|
||||||
NAMES "ert/ecl_well/well_const.h"
|
NAMES "ert/ecl_well/well_const.h"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
PATH_SUFFIXES "libecl_well/include/" "include"
|
PATH_SUFFIXES "libecl_well/include/" "include"
|
||||||
DOC "Path to ERT Eclipse library header files"
|
DOC "Path to ERT Eclipse library header files"
|
||||||
${_no_default_path}
|
${_no_default_path}
|
||||||
@@ -49,7 +49,7 @@ find_path (ERT_ECL_WELL_INCLUDE_DIR
|
|||||||
find_path (ERT_ECLXX_INCLUDE_DIR
|
find_path (ERT_ECLXX_INCLUDE_DIR
|
||||||
NAMES "ert/ecl/EclKW.hpp"
|
NAMES "ert/ecl/EclKW.hpp"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
PATH_SUFFIXES "libeclxx/include/" "include"
|
PATH_SUFFIXES "libeclxx/include/" "include"
|
||||||
DOC "Path to ERT Eclipse C++ library header files"
|
DOC "Path to ERT Eclipse C++ library header files"
|
||||||
${_no_default_path}
|
${_no_default_path}
|
||||||
@@ -57,7 +57,7 @@ find_path (ERT_ECLXX_INCLUDE_DIR
|
|||||||
find_path (ERT_UTIL_INCLUDE_DIR
|
find_path (ERT_UTIL_INCLUDE_DIR
|
||||||
NAMES "ert/util/stringlist.h"
|
NAMES "ert/util/stringlist.h"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
PATH_SUFFIXES "libert_util/include/" "include"
|
PATH_SUFFIXES "libert_util/include/" "include"
|
||||||
DOC "Path to ERT Eclipse library header files"
|
DOC "Path to ERT Eclipse library header files"
|
||||||
${_no_default_path}
|
${_no_default_path}
|
||||||
@@ -65,7 +65,7 @@ find_path (ERT_UTIL_INCLUDE_DIR
|
|||||||
find_path (ERT_UTILXX_INCLUDE_DIR
|
find_path (ERT_UTILXX_INCLUDE_DIR
|
||||||
NAMES "ert/util/ert_unique_ptr.hpp"
|
NAMES "ert/util/ert_unique_ptr.hpp"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
PATH_SUFFIXES "libert_utilxx/include/" "include"
|
PATH_SUFFIXES "libert_utilxx/include/" "include"
|
||||||
DOC "Path to ERT Eclipse C++ library header files"
|
DOC "Path to ERT Eclipse C++ library header files"
|
||||||
${_no_default_path}
|
${_no_default_path}
|
||||||
@@ -73,7 +73,7 @@ find_path (ERT_UTILXX_INCLUDE_DIR
|
|||||||
find_path (ERT_GEN_INCLUDE_DIR
|
find_path (ERT_GEN_INCLUDE_DIR
|
||||||
NAMES "ert/util/int_vector.h"
|
NAMES "ert/util/int_vector.h"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
PATHS "${PROJECT_SOURCE_DIR}/../libecl" "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
PATH_SUFFIXES "libert_util/include"
|
PATH_SUFFIXES "libert_util/include"
|
||||||
"include" "build/libert_util/include" "build/libert_util/include"
|
"include" "build/libert_util/include" "build/libert_util/include"
|
||||||
DOC "Path to ERT generated library header files"
|
DOC "Path to ERT generated library header files"
|
||||||
@@ -88,7 +88,10 @@ endif (CMAKE_SIZEOF_VOID_P)
|
|||||||
find_library (ERT_LIBRARY_ECL
|
find_library (ERT_LIBRARY_ECL
|
||||||
NAMES "ecl"
|
NAMES "ecl"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert"
|
||||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
@@ -98,7 +101,10 @@ find_library (ERT_LIBRARY_ECL
|
|||||||
find_library (ERT_LIBRARY_ECLXX
|
find_library (ERT_LIBRARY_ECLXX
|
||||||
NAMES "eclxx"
|
NAMES "eclxx"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert"
|
||||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
@@ -108,7 +114,10 @@ find_library (ERT_LIBRARY_ECLXX
|
|||||||
find_library (ERT_LIBRARY_ECL_WELL
|
find_library (ERT_LIBRARY_ECL_WELL
|
||||||
NAMES "ecl_well"
|
NAMES "ecl_well"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert"
|
||||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
@@ -118,7 +127,10 @@ find_library (ERT_LIBRARY_ECL_WELL
|
|||||||
find_library (ERT_LIBRARY_GEOMETRY
|
find_library (ERT_LIBRARY_GEOMETRY
|
||||||
NAMES "ert_geometry"
|
NAMES "ert_geometry"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert"
|
||||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
@@ -128,7 +140,10 @@ find_library (ERT_LIBRARY_GEOMETRY
|
|||||||
find_library (ERT_LIBRARY_UTIL
|
find_library (ERT_LIBRARY_UTIL
|
||||||
NAMES "ert_util"
|
NAMES "ert_util"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert"
|
||||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
@@ -138,7 +153,10 @@ find_library (ERT_LIBRARY_UTIL
|
|||||||
find_library (ERT_LIBRARY_UTILXX
|
find_library (ERT_LIBRARY_UTILXX
|
||||||
NAMES "ert_utilxx"
|
NAMES "ert_utilxx"
|
||||||
HINTS "${ERT_ROOT}"
|
HINTS "${ERT_ROOT}"
|
||||||
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
PATHS "${PROJECT_BINARY_DIR}/../libecl"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../libecl/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../libecl-build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert"
|
||||||
"${PROJECT_SOURCE_DIR}/../ert/build"
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
"${PROJECT_BINARY_DIR}/../ert-build"
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
|
|||||||
@@ -16,6 +16,11 @@
|
|||||||
|
|
||||||
# find out the size of a pointer. this is required to only search for
|
# find out the size of a pointer. this is required to only search for
|
||||||
# libraries in the directories relevant for the architecture
|
# libraries in the directories relevant for the architecture
|
||||||
|
|
||||||
|
if(NOT USE_PETSC)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (CMAKE_SIZEOF_VOID_P)
|
if (CMAKE_SIZEOF_VOID_P)
|
||||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||||
endif (CMAKE_SIZEOF_VOID_P)
|
endif (CMAKE_SIZEOF_VOID_P)
|
||||||
|
|||||||
@@ -15,6 +15,10 @@
|
|||||||
# SUPERLU_LIBRARIES Name to the SuperLU library.
|
# SUPERLU_LIBRARIES Name to the SuperLU library.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
if(NOT USE_SUPERLU)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
include(CheckIncludeFiles)
|
include(CheckIncludeFiles)
|
||||||
include(CMakePushCheckState)
|
include(CMakePushCheckState)
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
@@ -118,6 +122,19 @@ int main(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}"
|
}"
|
||||||
SUPERLU_POST_2005_VERSION)
|
SUPERLU_POST_2005_VERSION)
|
||||||
|
|
||||||
|
# check whether version is at least 5.0
|
||||||
|
CHECK_C_SOURCE_COMPILES("
|
||||||
|
typedef int int_t;
|
||||||
|
#include <supermatrix.h>
|
||||||
|
#include <slu_util.h>
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
GlobalLU_t glu;
|
||||||
|
return 0;
|
||||||
|
}"
|
||||||
|
SUPERLU_MIN_VERSION_5)
|
||||||
|
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
|
|
||||||
if(SUPERLU_MIN_VERSION_4_3)
|
if(SUPERLU_MIN_VERSION_4_3)
|
||||||
@@ -128,6 +145,17 @@ else()
|
|||||||
"Human readable string containing SuperLU version information.")
|
"Human readable string containing SuperLU version information.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(SUPERLU_MIN_VERSION_5)
|
||||||
|
include(UseDuneVer)
|
||||||
|
find_dune_version("dune" "istl")
|
||||||
|
set(DUNE_ISTL_VERSION ${DUNE_ISTL_VERSION_MAJOR}.${DUNE_ISTL_VERSION_MINOR}.${DUNE_ISTL_VERSION_REVISION})
|
||||||
|
if(DUNE_ISTL_VERSION VERSION_LESS 2.5)
|
||||||
|
message(STATUS "SuperLU requested, but version found not compatible with dune-istl ${DUNE_ISTL_VERSION}")
|
||||||
|
set(SUPERLU_LIBRARY "")
|
||||||
|
set(SUPERLU_INCLUDE_DIR "")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# behave like a CMake module is supposed to behave
|
# behave like a CMake module is supposed to behave
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(
|
find_package_handle_standard_args(
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
# - Find TinyXML library
|
|
||||||
#
|
|
||||||
# Defines the following variables:
|
|
||||||
# TinyXML_INCLUDE_DIRS Directory of header files
|
|
||||||
# TinyXML_LIBRARIES Directory of shared object files
|
|
||||||
# TinyXML_DEFINITIONS Defines that must be set to compile
|
|
||||||
|
|
||||||
# Copyright (C) 2012 Uni Research AS
|
|
||||||
# This code is licensed under The GNU General Public License v3.0
|
|
||||||
|
|
||||||
# use the generic find routine
|
|
||||||
include (OpmPackage)
|
|
||||||
find_opm_package (
|
|
||||||
# module name
|
|
||||||
"TinyXML"
|
|
||||||
|
|
||||||
# dependencies
|
|
||||||
""
|
|
||||||
|
|
||||||
# header to search for
|
|
||||||
"tinyxml.h"
|
|
||||||
|
|
||||||
# library to search for
|
|
||||||
"tinyxml"
|
|
||||||
|
|
||||||
# defines to be added to compilations
|
|
||||||
""
|
|
||||||
|
|
||||||
# test program
|
|
||||||
"#include <tinyxml.h>
|
|
||||||
int main (void) {
|
|
||||||
TiXmlDocument doc;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
"
|
|
||||||
# config variables
|
|
||||||
"")
|
|
||||||
@@ -34,7 +34,7 @@ find_opm_package (
|
|||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
Opm::parameter::ParameterGroup parameters;
|
Opm::ParameterGroup parameters;
|
||||||
parameters.insertParameter(\"number\", \"7\");
|
parameters.insertParameter(\"number\", \"7\");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ find_opm_package (
|
|||||||
"${opm-grid_DEPS}"
|
"${opm-grid_DEPS}"
|
||||||
|
|
||||||
# header to search for
|
# header to search for
|
||||||
"dune/grid/CpGrid.hpp"
|
"dune/grid/cpgrid/GlobalIdMapping.hpp"
|
||||||
|
|
||||||
# library to search for
|
# library to search for
|
||||||
"opmgrid"
|
"opmgrid"
|
||||||
@@ -29,9 +29,9 @@ find_opm_package (
|
|||||||
"HAVE_OPM_GRID"
|
"HAVE_OPM_GRID"
|
||||||
|
|
||||||
# test program
|
# test program
|
||||||
"#include <dune/grid/CpGrid.hpp>
|
"#include <dune/grid/cpgrid/GlobalIdMapping.hpp>
|
||||||
int main (void) {
|
int main (void) {
|
||||||
Dune::CpGrid g;
|
Dune::cpgrid::GlobalIdMapping g;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -42,14 +42,3 @@ include (UseDynamicBoost)
|
|||||||
#debug_find_vars ("opm-output")
|
#debug_find_vars ("opm-output")
|
||||||
|
|
||||||
|
|
||||||
if(OPM_OUTPUT_FOUND)
|
|
||||||
get_filename_component(opm-output_PREFIX_DIR ${opm-output_LIBRARY} PATH)
|
|
||||||
find_program(COMPARE_SUMMARY_COMMAND compareSummary
|
|
||||||
PATHS ${opm-output_PREFIX_DIR}/../bin
|
|
||||||
${opm-output_PREFIX_DIR}/../../bin)
|
|
||||||
find_program(COMPARE_ECL_COMMAND compareECL
|
|
||||||
PATHS ${opm-output_PREFIX_DIR}/../bin
|
|
||||||
${opm-output_PREFIX_DIR}/../../bin)
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,13 +18,6 @@ else ()
|
|||||||
set (OPM_PARSER_QUIET "")
|
set (OPM_PARSER_QUIET "")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# use lowercase versions of the variables if those are set
|
|
||||||
if (opm-parser_ROOT)
|
|
||||||
set (OPM_PARSER_ROOT ${opm-parser_ROOT})
|
|
||||||
endif ()
|
|
||||||
if (opm_ROOT)
|
|
||||||
set (OPM_ROOT ${opm_ROOT})
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# inherit "suite" root if not specifically set for this library
|
# inherit "suite" root if not specifically set for this library
|
||||||
if ((NOT OPM_PARSER_ROOT) AND OPM_ROOT)
|
if ((NOT OPM_PARSER_ROOT) AND OPM_ROOT)
|
||||||
@@ -50,135 +43,24 @@ else ()
|
|||||||
"${PROJECT_BINARY_DIR}/../../opm-parser/${BUILD_DIR_SUFFIX}")
|
"${PROJECT_BINARY_DIR}/../../opm-parser/${BUILD_DIR_SUFFIX}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# use this header as signature
|
|
||||||
find_path (OPM_PARSER_INCLUDE_DIR
|
|
||||||
NAMES "opm/parser/eclipse/Parser/Parser.hpp"
|
|
||||||
HINTS "${OPM_PARSER_ROOT}"
|
|
||||||
PATHS ${_opm_parser_source}
|
|
||||||
PATH_SUFFIXES "include"
|
|
||||||
DOC "Path to OPM parser header files"
|
|
||||||
${_no_default_path} )
|
|
||||||
|
|
||||||
find_path (OPM_PARSER_GEN_INCLUDE_DIR
|
find_package(opm-parser CONFIG HINTS ${_opm_parser_build})
|
||||||
NAMES "opm/parser/eclipse/Parser/ParserKeywords.hpp"
|
if (opm-parser_FOUND)
|
||||||
HINTS "${OPM_PARSER_ROOT}"
|
find_package(ecl REQUIRED)
|
||||||
PATHS ${_opm_parser_build}
|
find_package(Boost 1.44.0
|
||||||
PATH_SUFFIXES "generated-source/include" "include"
|
COMPONENTS regex filesystem system date_time
|
||||||
DOC "Path to OPM parser generated header files"
|
REQUIRED)
|
||||||
${_no_default_path} )
|
set(HAVE_OPM_PARSER 1)
|
||||||
|
# setting HAVE_ERT is a mega hack here, but some downstreams require it.
|
||||||
|
# Eventually projets should move on to properly handle dependencies and
|
||||||
|
# configurations, and Findopm-parser be deprecated
|
||||||
|
set(HAVE_ERT 1)
|
||||||
|
set(opm-parser_CONFIG_VARS HAVE_OPM_PARSER HAVE_REGEX HAVE_ERT)
|
||||||
|
set(opm-parser_LIBRARIES opmparser)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(opm-parser
|
||||||
# backup: if we didn't find any headers there, but a CMakeCache.txt,
|
DEFAULT_MSG
|
||||||
# then it is probably a build directory; read the CMake cache of
|
opm-parser_LIBRARIES HAVE_OPM_PARSER HAVE_ERT
|
||||||
# opm-parser to figure out where the source directory is
|
|
||||||
if ((NOT OPM_PARSER_INCLUDE_DIR) AND
|
|
||||||
(OPM_PARSER_ROOT AND (EXISTS "${OPM_PARSER_ROOT}/CMakeCache.txt")))
|
|
||||||
set (_regex "^OPMParser_SOURCE_DIR:STATIC=\(.*\)$")
|
|
||||||
file (STRINGS
|
|
||||||
"${OPM_PARSER_ROOT}/CMakeCache.txt"
|
|
||||||
_cache_entry
|
|
||||||
REGEX "${_regex}")
|
|
||||||
string(REGEX REPLACE "${_regex}" "\\1"
|
|
||||||
OPM_PARSER_INCLUDE_DIR
|
|
||||||
"${_cache_entry}")
|
|
||||||
if (OPM_PARSER_INCLUDE_DIR)
|
|
||||||
set (OPM_PARSER_INCLUDE_DIR "${OPM_PARSER_INCLUDE_DIR}"
|
|
||||||
CACHE PATH "Path to OPM parser header files" FORCE)
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# find out the size of a pointer. this is required to only search for
|
|
||||||
# libraries in the directories relevant for the architecture
|
|
||||||
if (CMAKE_SIZEOF_VOID_P)
|
|
||||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# these libraries constitute the parser core
|
|
||||||
find_library (OPM_PARSER_LIBRARY
|
|
||||||
NAMES "opmparser"
|
|
||||||
HINTS "${OPM_PARSER_ROOT}"
|
|
||||||
PATHS ${_opm_parser_build}
|
|
||||||
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
|
||||||
"opm/parser/eclipse"
|
|
||||||
DOC "Path to OPM parser library archive/shared object files"
|
|
||||||
${_no_default_path} )
|
|
||||||
|
|
||||||
# find the OPM-parser wrapper library around cJSON
|
|
||||||
find_library (OPM_JSON_LIBRARY
|
|
||||||
NAMES "opmjson"
|
|
||||||
HINTS "${OPM_PARSER_ROOT}"
|
|
||||||
PATHS ${_opm_parser_build}
|
|
||||||
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
|
||||||
"opm/json"
|
|
||||||
DOC "Path to OPM JSON library archive/shared object files"
|
|
||||||
${_no_default_path} )
|
|
||||||
|
|
||||||
# get the prerequisite ERT libraries
|
|
||||||
if (NOT ERT_FOUND)
|
|
||||||
find_package(ERT ${OPM_PARSER_QUIET})
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# get the prerequisite Boost libraries
|
|
||||||
find_package(Boost 1.44.0 COMPONENTS filesystem date_time system unit_test_framework regex ${OPM_PARSER_QUIET})
|
|
||||||
|
|
||||||
if (ERT_FOUND AND Boost_FOUND AND
|
|
||||||
OPM_PARSER_LIBRARY AND OPM_JSON_LIBRARY AND OPM_PARSER_INCLUDE_DIR)
|
|
||||||
# setup list of all required libraries to link with opm-parser. notice that
|
|
||||||
# we use the plural form to get *all* the libraries needed by cjson
|
|
||||||
set (opm-parser_INCLUDE_DIRS
|
|
||||||
${OPM_PARSER_INCLUDE_DIR}
|
|
||||||
${OPM_PARSER_GEN_INCLUDE_DIR}
|
|
||||||
${Boost_INCLUDE_DIRS}
|
|
||||||
${ERT_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
set (opm-parser_LIBRARIES
|
|
||||||
${OPM_PARSER_LIBRARY}
|
|
||||||
${OPM_JSON_LIBRARY}
|
|
||||||
${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)
|
|
||||||
include (CheckCSourceCompiles)
|
|
||||||
cmake_push_check_state ()
|
|
||||||
set (CMAKE_REQUIRED_INCLUDES ${opm-parser_INCLUDE_DIRS})
|
|
||||||
set (CMAKE_REQUIRED_LIBRARIES ${opm-parser_LIBRARIES})
|
|
||||||
|
|
||||||
check_cxx_source_compiles (
|
|
||||||
"#include <cstdlib>
|
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
|
||||||
|
|
||||||
int main (void) {
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}" HAVE_OPM_PARSER)
|
|
||||||
cmake_pop_check_state ()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# if the test program didn't compile, but was required to do so, bail
|
|
||||||
# out now and display an error; otherwise limp on
|
|
||||||
set (OPM_PARSER_FIND_REQUIRED ${opm-parser_FIND_REQUIRED})
|
|
||||||
find_package_handle_standard_args (opm-parser
|
|
||||||
DEFAULT_MSG
|
|
||||||
opm-parser_INCLUDE_DIRS opm-parser_LIBRARIES HAVE_OPM_PARSER
|
|
||||||
)
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
set (opm-parser_CONFIG_VARS "HAVE_OPM_PARSER;HAVE_REGEX")
|
|
||||||
set (opm-parser_FOUND ${OPM-PARSER_FOUND})
|
|
||||||
|
|
||||||
mark_as_advanced(opm-parser_LIBRARIES opm-parser_INCLUDE_DIRS OPM-PARSER_FOUND)
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ function (set_aliases)
|
|||||||
# are separated by space
|
# are separated by space
|
||||||
set (aliases
|
set (aliases
|
||||||
"HAVE_UMFPACK HAVE_SUITESPARSE_UMFPACK_H"
|
"HAVE_UMFPACK HAVE_SUITESPARSE_UMFPACK_H"
|
||||||
|
"HAVE_SUITESPARSE_UMFPACK HAVE_SUITESPARSE_UMFPACK_H"
|
||||||
"HAVE_DUNE_BOOST HAVE_BOOST"
|
"HAVE_DUNE_BOOST HAVE_BOOST"
|
||||||
)
|
)
|
||||||
foreach (alias IN LISTS aliases)
|
foreach (alias IN LISTS aliases)
|
||||||
|
|||||||
@@ -30,19 +30,34 @@ macro (opm_compile opm)
|
|||||||
add_definitions (${${opm}_DEFINITIONS})
|
add_definitions (${${opm}_DEFINITIONS})
|
||||||
set (${opm}_VERSION "${${opm}_VERSION_MAJOR}.${${opm}_VERSION_MINOR}")
|
set (${opm}_VERSION "${${opm}_VERSION_MAJOR}.${${opm}_VERSION_MINOR}")
|
||||||
if (${opm}_SOURCES)
|
if (${opm}_SOURCES)
|
||||||
add_library (${${opm}_TARGET} ${${opm}_LIBRARY_TYPE} ${${opm}_SOURCES})
|
add_library (${${opm}_TARGET} ${${opm}_LIBRARY_TYPE} ${${opm}_SOURCES})
|
||||||
set_target_properties (${${opm}_TARGET} PROPERTIES
|
set_target_properties (${${opm}_TARGET} PROPERTIES
|
||||||
SOVERSION ${${opm}_VERSION_MAJOR}
|
SOVERSION ${${opm}_VERSION_MAJOR}
|
||||||
VERSION ${${opm}_VERSION}
|
VERSION ${${opm}_VERSION}
|
||||||
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}"
|
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}"
|
||||||
POSITION_INDEPENDENT_CODE TRUE
|
POSITION_INDEPENDENT_CODE TRUE
|
||||||
)
|
)
|
||||||
target_link_libraries (${${opm}_TARGET} ${${opm}_LIBRARIES})
|
if (${${opm}_LIBRARY_TYPE} STREQUAL "SHARED")
|
||||||
|
# libs that will be linked with the main lib
|
||||||
|
string(REGEX REPLACE "([;^])[^;]+\\.a[;$]" "\\1" _public_libs
|
||||||
|
"${${opm}_LIBRARIES}")
|
||||||
|
# libs that will not actually linked to the library but
|
||||||
|
# transitively linked to binaries that link to the main library
|
||||||
|
string(REGEX REPLACE "([^;]+\\.[^a][a-zA-Z0-9]*|-[a-z]*)[;$]" "" _interface_libs
|
||||||
|
"${${opm}_LIBRARIES}")
|
||||||
|
else()
|
||||||
|
# Use all libs for real and transitive linking
|
||||||
|
set(_public_libs ${${opm}_LIBRARIES})
|
||||||
|
unset(_interface)
|
||||||
|
endif()
|
||||||
|
target_link_libraries (${${opm}_TARGET} PUBLIC ${_public_libs}
|
||||||
|
INTERFACE ${_interface_libs})
|
||||||
|
|
||||||
if (STRIP_DEBUGGING_SYMBOLS)
|
if (STRIP_DEBUGGING_SYMBOLS)
|
||||||
# queue this executable to be stripped
|
# queue this executable to be stripped
|
||||||
strip_debug_symbols (${${opm}_TARGET} ${opm}_DEBUG)
|
strip_debug_symbols (${${opm}_TARGET} ${opm}_DEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
add_static_analysis_tests(${opm}_SOURCES ${opm}_INCLUDE_DIRS)
|
||||||
else (${opm}_SOURCES)
|
else (${opm}_SOURCES)
|
||||||
# unset this variable to signal that no library is generated
|
# unset this variable to signal that no library is generated
|
||||||
set (${opm}_TARGET)
|
set (${opm}_TARGET)
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
# )
|
# )
|
||||||
|
|
||||||
include (Duplicates)
|
include (Duplicates)
|
||||||
|
include (OpmSiblingSearch)
|
||||||
|
|
||||||
# list of suffixes for all the project variables
|
# list of suffixes for all the project variables
|
||||||
set (_opm_proj_vars
|
set (_opm_proj_vars
|
||||||
@@ -135,15 +136,34 @@ macro (find_and_append_package_to prefix name)
|
|||||||
set (${name}_FOUND FALSE)
|
set (${name}_FOUND FALSE)
|
||||||
set (${NAME}_FOUND FALSE)
|
set (${NAME}_FOUND FALSE)
|
||||||
else ()
|
else ()
|
||||||
# using config mode is better than using module (aka. find) mode
|
# using config mode is better than using module (aka. find) mode
|
||||||
# because then the package has already done all its probes and
|
# because then the package has already done all its probes and
|
||||||
# stored them in the config file for us
|
# stored them in the config file for us
|
||||||
if (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND)
|
# For dune and opm modules and exempted packages we force module mode.
|
||||||
if (${name}_DIR)
|
# For dune and opm it will use config mode underneath.
|
||||||
message (STATUS "Finding package ${name} using config mode")
|
# We even need to repeat the search for opm-common once as this is done
|
||||||
find_package (${name} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
|
# in the top most CMakeLists.txt without querying defines, setting dependencies
|
||||||
else ()
|
# and the likes which is only done via opm_find_package
|
||||||
message (STATUS "Finding package ${name} using module mode")
|
if (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND
|
||||||
|
OR ("${name}" STREQUAL "opm-common" AND NOT _opm_common_deps_processed))
|
||||||
|
string(REGEX MATCH "(dune|opm)-.*" _is_opm ${name})
|
||||||
|
if (${name}_DIR AND NOT (_${name}_exempted OR _is_opm))
|
||||||
|
message (STATUS "Finding package ${name} using config mode ${_${name}_exempted}")
|
||||||
|
find_package (${name} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
|
||||||
|
else ()
|
||||||
|
# print message if this neither an opm module nor ecl
|
||||||
|
if (NOT (${name}_exempted EQUAL -1 OR _is_opm_) )
|
||||||
|
message (STATUS "Finding package ${name} using module mode")
|
||||||
|
endif()
|
||||||
|
if(${name} STREQUAL "ecl")
|
||||||
|
# Give us a chance to find ecl installed to CMAKE_INSTALL_PREFIX.
|
||||||
|
# We need to deactivate the package registry for this.
|
||||||
|
create_module_dir_var(ecl)
|
||||||
|
set(ARGN_NO_REQUIRED ${ARGN})
|
||||||
|
list(REMOVE_ITEM ARGN_NO_REQUIRED "REQUIRED")
|
||||||
|
find_package (${name} ${ARGN_NO_REQUIRED} NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_PACKAGE_REGISTRY)
|
||||||
|
# If everything else failed fall back to the registry
|
||||||
|
endif()
|
||||||
find_package (${name} ${ARGN})
|
find_package (${name} ${ARGN})
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
@@ -153,6 +173,10 @@ macro (find_and_append_package_to prefix name)
|
|||||||
if (NOT DEFINED ${NAME}_FOUND)
|
if (NOT DEFINED ${NAME}_FOUND)
|
||||||
set (${NAME}_FOUND "${${name}_FOUND}")
|
set (${NAME}_FOUND "${${name}_FOUND}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if(name STREQUAL "opm-common")
|
||||||
|
set(_opm_common_deps_processed ON)
|
||||||
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# the variable "NAME" may be replaced during find_package (as this is
|
# the variable "NAME" may be replaced during find_package (as this is
|
||||||
|
|||||||
@@ -102,6 +102,16 @@ find_openmp (${project})
|
|||||||
include (UseThreads)
|
include (UseThreads)
|
||||||
find_threads (${project})
|
find_threads (${project})
|
||||||
|
|
||||||
|
# SuperLU is optional
|
||||||
|
option (USE_SUPERLU "Use SuperLU direct solvers" OFF)
|
||||||
|
|
||||||
|
# PETSc is optional
|
||||||
|
option (USE_PETSC "Use PETSc iterative solvers" OFF)
|
||||||
|
|
||||||
|
# static code analysis
|
||||||
|
include(UseStaticAnalysis)
|
||||||
|
setup_static_analysis_tools()
|
||||||
|
|
||||||
# callback hook to setup additional dependencies
|
# callback hook to setup additional dependencies
|
||||||
if (COMMAND prereqs_hook)
|
if (COMMAND prereqs_hook)
|
||||||
prereqs_hook ()
|
prereqs_hook ()
|
||||||
|
|||||||
+23
-235
@@ -37,9 +37,7 @@
|
|||||||
# <http://www.vtk.org/Wiki/CMake:How_To_Find_Libraries>
|
# <http://www.vtk.org/Wiki/CMake:How_To_Find_Libraries>
|
||||||
|
|
||||||
include (OpmFind)
|
include (OpmFind)
|
||||||
|
include (OpmSiblingSearch)
|
||||||
option (SIBLING_SEARCH "Search sibling directories before system paths" ON)
|
|
||||||
mark_as_advanced (SIBLING_SEARCH)
|
|
||||||
|
|
||||||
# append all items from src into dst; both must be *names* of lists
|
# append all items from src into dst; both must be *names* of lists
|
||||||
macro (append_found src dst)
|
macro (append_found src dst)
|
||||||
@@ -57,8 +55,15 @@ macro (find_opm_package module deps header lib defs prog conf)
|
|||||||
string (REPLACE "-" "_" MODULE "${MODULE_UPPER}")
|
string (REPLACE "-" "_" MODULE "${MODULE_UPPER}")
|
||||||
|
|
||||||
# if someone else has included this test, don't do it again
|
# if someone else has included this test, don't do it again
|
||||||
|
# one exception is opm-common which is already found in the
|
||||||
|
# top most CMakeLists.txt but we still need to search for its
|
||||||
|
# dependencies
|
||||||
if (${MODULE}_FOUND OR ${module}_FOUND)
|
if (${MODULE}_FOUND OR ${module}_FOUND)
|
||||||
return ()
|
if (${module} STREQUAL "opm-common" AND NOT _opm_common_deps_processed)
|
||||||
|
set(_opm_common_deps_processed ON)
|
||||||
|
else()
|
||||||
|
return ()
|
||||||
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# variables to pass on to other packages
|
# variables to pass on to other packages
|
||||||
@@ -73,198 +78,13 @@ macro (find_opm_package module deps header lib defs prog conf)
|
|||||||
set (_${module}_required "")
|
set (_${module}_required "")
|
||||||
endif (${module}_FIND_REQUIRED)
|
endif (${module}_FIND_REQUIRED)
|
||||||
|
|
||||||
# see if there is a pkg-config entry for this package, and use those
|
create_module_dir_var(${module})
|
||||||
# settings as a starting point
|
|
||||||
find_package (PkgConfig)
|
|
||||||
pkg_check_modules (PkgConf_${module} QUIET ${module})
|
|
||||||
|
|
||||||
# these variables have non-standard names in FindPkgConfig (sic)
|
# This will also set all the needed variables with the exception of
|
||||||
set (${module}_DEFINITIONS ${PkgConf_${module}_CFLAGS_OTHER})
|
# ${module}_CONFIG_VARS for dune modules.
|
||||||
set (${module}_LINKER_FLAG ${PkgConf_${module}_LDFLAGS_OTHER})
|
find_package(${module} ${_${module}_quiet} ${_${module}_required} CONFIG)
|
||||||
|
|
||||||
# try to figure out whether we are in a subdir build tree, and attempt
|
|
||||||
# to put the same name as the appropriate build tree for the module
|
|
||||||
get_filename_component (_build_dir "${CMAKE_CURRENT_BINARY_DIR}" NAME)
|
|
||||||
|
|
||||||
# don't bother if we are in a project specific directory already
|
|
||||||
# (assuming no-one wants to name the build dir after another module!)
|
|
||||||
if ("${_build_dir}" STREQUAL "${PROJECT_NAME}")
|
|
||||||
set (_build_dir "")
|
|
||||||
endif ("${_build_dir}" STREQUAL "${PROJECT_NAME}")
|
|
||||||
|
|
||||||
# if the user hasn't specified any location, and it isn't found
|
|
||||||
# in standard system locations either, then start to wander
|
|
||||||
# about and look for it in proximity to ourself. Qt Creator likes
|
|
||||||
# to put the build-directories as siblings to the source trees,
|
|
||||||
# but with a -build suffix, DUNE likes to have the the build tree
|
|
||||||
# in a "build-cmake" sub-directory of each module
|
|
||||||
set(workaround_cmake_bug 0)
|
|
||||||
if(${module}_DIR})
|
|
||||||
set(workaround_cmake_bug 1)
|
|
||||||
endif()
|
|
||||||
if(${module}_ROOT})
|
|
||||||
set(workaround_cmake_bug 1)
|
|
||||||
endif()
|
|
||||||
if(${MODULE}_ROOT})
|
|
||||||
set(workaround_cmake_bug 1)
|
|
||||||
endif()
|
|
||||||
if (NOT workaround_cmake_bug)
|
|
||||||
string (TOLOWER "${module}" _module_lower)
|
|
||||||
set (_guess
|
|
||||||
"../${module}"
|
|
||||||
"../${_module_lower}"
|
|
||||||
)
|
|
||||||
set (_guess_bin_only
|
|
||||||
"../${module}-build"
|
|
||||||
"../${_module_lower}-build"
|
|
||||||
)
|
|
||||||
|
|
||||||
# look in similar dirs for the other module
|
|
||||||
if (_build_dir)
|
|
||||||
list (APPEND _guess_bin_only
|
|
||||||
"../../${module}/${_build_dir}"
|
|
||||||
"../../${_module_lower}/${_build_dir}"
|
|
||||||
)
|
|
||||||
endif (_build_dir)
|
|
||||||
|
|
||||||
# generate items that are in the build, not source dir
|
|
||||||
set (_guess_bin)
|
|
||||||
foreach (_item IN ITEMS ${_guess} ${_guess_bin_only})
|
|
||||||
list (APPEND _guess_bin "${PROJECT_BINARY_DIR}/${_item}")
|
|
||||||
endforeach (_item)
|
|
||||||
set (_no_system "")
|
|
||||||
else ()
|
|
||||||
# start looking at the paths in this order
|
|
||||||
set (_guess_bin
|
|
||||||
${${module}_DIR}
|
|
||||||
${${module}_ROOT}
|
|
||||||
${${MODULE}_ROOT}
|
|
||||||
)
|
|
||||||
# if every package is installed directly in the "suite" directory
|
|
||||||
# (e.g. /usr) then allow us to back-track one directory from the
|
|
||||||
# module sub-dir that was added by OpmFind (this happens incidently
|
|
||||||
# already for the source do to the out-of-source support)
|
|
||||||
if ("${${MODULE}_ROOT}" MATCHES "/${module}$")
|
|
||||||
get_filename_component (_suite_parent ${${MODULE}_ROOT} PATH)
|
|
||||||
list (APPEND _guess_bin
|
|
||||||
${_suite_parent}
|
|
||||||
${_suite_parent}/${module}
|
|
||||||
${_suite_parent}/${module}/${_build_dir}
|
|
||||||
)
|
|
||||||
endif ("${${MODULE}_ROOT}" MATCHES "/${module}$")
|
|
||||||
# when we look for the source, it may be that we have been specified
|
|
||||||
# a build directory which is a sub-dir of the source, so we look in
|
|
||||||
# the parent also
|
|
||||||
set (_guess
|
|
||||||
${${module}_DIR}
|
|
||||||
${${module}_ROOT}
|
|
||||||
${${MODULE}_ROOT}
|
|
||||||
)
|
|
||||||
# only add parent directories for those variants that are actually set
|
|
||||||
# (otherwise, we'll inadvertedly add the root directory (=all))
|
|
||||||
if (${module}_DIR)
|
|
||||||
list (APPEND _guess ${${module}_DIR}/..)
|
|
||||||
endif (${module}_DIR)
|
|
||||||
if (${module}_ROOT)
|
|
||||||
list (APPEND _guess ${${module}_ROOT}/..)
|
|
||||||
endif (${module}_ROOT)
|
|
||||||
if (${MODULE}_ROOT)
|
|
||||||
list (APPEND _guess ${${MODULE}_ROOT}/..)
|
|
||||||
endif (${MODULE}_ROOT)
|
|
||||||
# don't search the system paths! that would be dangerous; if there
|
|
||||||
# is a problem in our own specified directory, we don't necessarily
|
|
||||||
# want an old version that is left in one of the system paths!
|
|
||||||
set (_no_system "NO_DEFAULT_PATH")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# by specifying _guess in the HINTS section, it gets searched before
|
|
||||||
# the system locations as well. the CMake documentation has a cloudy
|
|
||||||
# recommendation, but it ends up like this: if NO_DEFAULT_PATH is
|
|
||||||
# specified, then PATHS is used. Otherwise, it looks in HINTS, then in
|
|
||||||
# system paths, and the finally in PATHS (!)
|
|
||||||
if (SIBLING_SEARCH)
|
|
||||||
set (_guess_hints ${_guess})
|
|
||||||
set (_guess_hints_bin ${_guess_bin})
|
|
||||||
else (SIBLING_SEARCH)
|
|
||||||
set (_guess_hints)
|
|
||||||
set (_guess_hints_bin)
|
|
||||||
endif (SIBLING_SEARCH)
|
|
||||||
|
|
||||||
# if an include directory is specified directly (e.g. OPM_CORE_INCLUDE_DIR=
|
|
||||||
# /usr/include/opm-2013.03) then this overrides everything else. Notice that
|
|
||||||
# this variable uses the fully capitalized version of the name.
|
|
||||||
if (${MODULE}_INCLUDE_DIR)
|
|
||||||
set (_guess "${${MODULE}_INCLUDE_DIR}")
|
|
||||||
set (_no_system_incl "NO_DEFAULT_PATH")
|
|
||||||
else ()
|
|
||||||
set (_no_system_incl "${_no_system}")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# search for this include and library file to get the installation
|
|
||||||
# directory of the package; hints are searched before the system locations,
|
|
||||||
# paths are searched afterwards
|
|
||||||
find_path (${module}_INCLUDE_DIR
|
|
||||||
NAMES "${header}"
|
|
||||||
PATHS ${_guess}
|
|
||||||
HINTS ${PkgConf_${module}_INCLUDE_DIRS} ${_guess_hints}
|
|
||||||
PATH_SUFFIXES "include"
|
|
||||||
${_no_system_incl}
|
|
||||||
)
|
|
||||||
|
|
||||||
# some modules are all in headers
|
|
||||||
if (NOT "${lib}" STREQUAL "")
|
|
||||||
if (CMAKE_SIZEOF_VOID_P)
|
|
||||||
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
|
||||||
endif (CMAKE_SIZEOF_VOID_P)
|
|
||||||
|
|
||||||
# again, we may directly override the location of the library alone by
|
|
||||||
# specifying e.g. OPM_CORE_LIB_DIR. notice that this is a *directory*
|
|
||||||
# and not the name of the library
|
|
||||||
if (${MODULE}_LIB_DIR)
|
|
||||||
set (_guess_bin "${${MODULE}_LIB_DIR}")
|
|
||||||
set (_no_system_lib "NO_DEFAULT_PATH")
|
|
||||||
else ()
|
|
||||||
set (_no_system_lib "${_no_system}")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# if there is more than one library, then look for all of them, putting
|
|
||||||
# them in variables with the name of the library appended. however, the
|
|
||||||
# first entry is assumed to be the "primary" library and will be named
|
|
||||||
# like the module. thus, with a lib entry of "foo;bar", the first library
|
|
||||||
# is called ${module}_LIBRARY and the second ${module}_LIBRARY_bar
|
|
||||||
foreach (_lib IN ITEMS ${lib})
|
|
||||||
# don't include any suffix if it is the first one
|
|
||||||
if ("${lib}" MATCHES "^${_lib}")
|
|
||||||
set (_which)
|
|
||||||
else ()
|
|
||||||
set (_which "_${_lib}")
|
|
||||||
endif ()
|
|
||||||
find_library (${module}_LIBRARY${_which}
|
|
||||||
NAMES "${_lib}"
|
|
||||||
PATHS ${_guess_bin}
|
|
||||||
HINTS ${PkgConf_${module}_LIBRARY_DIRS} ${_guess_hints_bin}
|
|
||||||
PATH_SUFFIXES "lib" "lib/Debug" "lib/Release" "lib/.libs" ".libs" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "build-cmake/lib"
|
|
||||||
${_no_system_lib}
|
|
||||||
)
|
|
||||||
# debug info if we didn't find the desired library
|
|
||||||
if (NOT ${module}_LIBRARY${_which})
|
|
||||||
message (STATUS "Failed to find library \"${_lib}\" for module ${module}")
|
|
||||||
endif ()
|
|
||||||
endforeach (_lib)
|
|
||||||
else (NOT "${lib}" STREQUAL "")
|
|
||||||
set (${module}_LIBRARY "")
|
|
||||||
endif (NOT "${lib}" STREQUAL "")
|
|
||||||
|
|
||||||
# add dependencies so that our result variables are complete
|
|
||||||
# list of necessities to build with the software
|
|
||||||
set (${module}_INCLUDE_DIRS "${${module}_INCLUDE_DIR}")
|
|
||||||
foreach (_lib IN ITEMS ${lib})
|
|
||||||
if ("${lib}" MATCHES "^${_lib}")
|
|
||||||
set (${module}_LIBRARIES "${${module}_LIBRARY}")
|
|
||||||
else ()
|
|
||||||
list (APPEND ${module}_LIBRARIES "${${module}_LIBRARY_${_lib}}")
|
|
||||||
endif ()
|
|
||||||
endforeach (_lib)
|
|
||||||
# period because it should be something that evaluates to true
|
# period because it should be something that evaluates to true
|
||||||
# in find_package_handle_standard_args
|
# in find_package_handle_standard_args
|
||||||
set (${module}_ALL_PREREQS ".")
|
set (${module}_ALL_PREREQS ".")
|
||||||
@@ -309,10 +129,10 @@ macro (find_opm_package module deps header lib defs prog conf)
|
|||||||
# these defines are used in dune/${module} headers, and should be put
|
# these defines are used in dune/${module} headers, and should be put
|
||||||
# in config.h when we include those
|
# in config.h when we include those
|
||||||
foreach (_var IN ITEMS ${conf})
|
foreach (_var IN ITEMS ${conf})
|
||||||
# massage the name to remove source code formatting
|
# massage the name to remove source code formatting
|
||||||
string (REGEX REPLACE "^[\n\t\ ]+" "" _var "${_var}")
|
string (REGEX REPLACE "^[\n\t\ ]+" "" _var "${_var}")
|
||||||
string (REGEX REPLACE "[\n\t\ ]+$" "" _var "${_var}")
|
string (REGEX REPLACE "[\n\t\ ]+$" "" _var "${_var}")
|
||||||
list (APPEND ${module}_CONFIG_VARS ${_var})
|
list (APPEND ${module}_CONFIG_VARS ${_var})
|
||||||
endforeach (_var)
|
endforeach (_var)
|
||||||
|
|
||||||
# these are the defines that should be set when compiling
|
# these are the defines that should be set when compiling
|
||||||
@@ -335,51 +155,19 @@ macro (find_opm_package module deps header lib defs prog conf)
|
|||||||
|
|
||||||
# write status message in the same manner as everyone else
|
# write status message in the same manner as everyone else
|
||||||
include (FindPackageHandleStandardArgs)
|
include (FindPackageHandleStandardArgs)
|
||||||
if ("${lib}" STREQUAL "")
|
|
||||||
set (_lib_var "")
|
|
||||||
set (_and_lib_var)
|
|
||||||
else ("${lib}" STREQUAL "")
|
|
||||||
foreach (_lib IN ITEMS ${lib})
|
|
||||||
if ("${lib}" MATCHES "^${_lib}")
|
|
||||||
set (_lib_var "${module}_LIBRARY")
|
|
||||||
set (_and_lib_var AND ${_lib_var})
|
|
||||||
else ()
|
|
||||||
list (APPEND _lib_var "${module}_LIBRARY_${_lib}")
|
|
||||||
set (_and_lib_var ${_and_lib_var} AND "${module}_LIBRARY_${_lib}")
|
|
||||||
endif ()
|
|
||||||
endforeach (_lib)
|
|
||||||
endif ("${lib}" STREQUAL "")
|
|
||||||
# if the search is going to fail, then write these variables to
|
|
||||||
# the console as well as a diagnostics
|
|
||||||
if ((NOT (${module}_INCLUDE_DIR ${_and_lib_var} AND HAVE_${MODULE}))
|
|
||||||
AND (_${module}_required OR NOT _${module}_quiet))
|
|
||||||
if (DEFINED ${module}_DIR)
|
|
||||||
message (STATUS "${module}_DIR = ${${module}_DIR}")
|
|
||||||
elseif (DEFINED ${module}_ROOT)
|
|
||||||
message (STATUS "${module}_ROOT = ${${module}_ROOT}")
|
|
||||||
elseif (DEFINED ${MODULE}_ROOT)
|
|
||||||
message (STATUS "${MODULE}_ROOT = ${${MODULE}_ROOT}")
|
|
||||||
endif (DEFINED ${module}_DIR)
|
|
||||||
endif ((NOT (${module}_INCLUDE_DIR ${_and_lib_var} AND HAVE_${MODULE}))
|
|
||||||
AND (_${module}_required OR NOT _${module}_quiet))
|
|
||||||
if ("${${module}_ALL_PREREQS}" MATCHES "-NOTFOUND")
|
|
||||||
message (STATUS "${module} prereqs: ${${module}_ALL_PREREQS}")
|
|
||||||
endif ()
|
|
||||||
find_package_handle_standard_args (
|
find_package_handle_standard_args (
|
||||||
${module}
|
${module}
|
||||||
DEFAULT_MSG
|
DEFAULT_MSG
|
||||||
${module}_INCLUDE_DIR ${_lib_var} HAVE_${MODULE} ${module}_ALL_PREREQS
|
${module}_INCLUDE_DIRS ${module}_LIBRARIES ${module}_FOUND ${module}_ALL_PREREQS
|
||||||
)
|
)
|
||||||
|
|
||||||
# allow the user to override these from user interface
|
|
||||||
mark_as_advanced (${module}_INCLUDE_DIR)
|
|
||||||
mark_as_advanced (${module}_LIBRARY)
|
|
||||||
|
|
||||||
# some genius that coded the FindPackageHandleStandardArgs figured out
|
# some genius that coded the FindPackageHandleStandardArgs figured out
|
||||||
# that the module name should be in uppercase (?!)
|
# that the module name should be in uppercase (?!)
|
||||||
set (${module}_FOUND "${${MODULE_UPPER}_FOUND}")
|
set (${module}_FOUND "${${MODULE_UPPER}_FOUND}")
|
||||||
set (${MODULE}_FOUND "${${MODULE_UPPER}_FOUND}")
|
set (${MODULE}_FOUND "${${MODULE_UPPER}_FOUND}")
|
||||||
|
|
||||||
|
# This variable is used by UseDuneVer
|
||||||
|
list(GET ${module}_INCLUDE_DIRS 0 ${module}_INCLUDE_DIR)
|
||||||
# print everything out if we're asked to
|
# print everything out if we're asked to
|
||||||
if (${module}_DEBUG)
|
if (${module}_DEBUG)
|
||||||
debug_find_vars (${module})
|
debug_find_vars (${module})
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ macro (opm_compile_satellites opm satellite excl_all test_regexp)
|
|||||||
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
|
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
|
||||||
else (NOT "${test_regexp}" STREQUAL "")
|
else (NOT "${test_regexp}" STREQUAL "")
|
||||||
set (_test_lib "")
|
set (_test_lib "")
|
||||||
|
add_static_analysis_tests(_sat_FILE ${opm}_INCLUDE_DIRS)
|
||||||
endif (NOT "${test_regexp}" STREQUAL "")
|
endif (NOT "${test_regexp}" STREQUAL "")
|
||||||
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
|
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
|
||||||
if (STRIP_DEBUGGING_SYMBOLS)
|
if (STRIP_DEBUGGING_SYMBOLS)
|
||||||
@@ -302,11 +303,6 @@ macro(opm_add_test TestName)
|
|||||||
if(CURTEST_DEPENDS)
|
if(CURTEST_DEPENDS)
|
||||||
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
|
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT TARGET test-suite)
|
|
||||||
add_custom_target(test-suite)
|
|
||||||
endif()
|
|
||||||
add_dependencies(test-suite "${CURTEST_EXE_NAME}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# figure out how the test should be run. if a test driver script
|
# figure out how the test should be run. if a test driver script
|
||||||
@@ -336,6 +332,13 @@ macro(opm_add_test TestName)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT CURTEST_NO_COMPILE)
|
||||||
|
if(NOT TARGET test-suite)
|
||||||
|
add_custom_target(test-suite)
|
||||||
|
endif()
|
||||||
|
add_dependencies(test-suite "${CURTEST_EXE_NAME}")
|
||||||
|
endif()
|
||||||
|
|
||||||
else() # test is skipped
|
else() # test is skipped
|
||||||
|
|
||||||
# the following causes the test to appear as 'skipped' in the
|
# the following causes the test to appear as 'skipped' in the
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
option (SIBLING_SEARCH "Search sibling directories before system paths" ON)
|
||||||
|
mark_as_advanced (SIBLING_SEARCH)
|
||||||
|
|
||||||
|
macro(create_module_dir_var module)
|
||||||
|
if(SIBLING_SEARCH AND NOT ${module}_DIR)
|
||||||
|
# guess the sibling dir
|
||||||
|
get_filename_component(_leaf_dir_name ${PROJECT_BINARY_DIR} NAME)
|
||||||
|
get_filename_component(_parent_full_dir ${PROJECT_BINARY_DIR} DIRECTORY)
|
||||||
|
get_filename_component(_parent_dir_name ${_parent_full_dir} NAME)
|
||||||
|
#Try if <module-name>/<build-dir> is used
|
||||||
|
get_filename_component(_modules_dir ${_parent_full_dir} DIRECTORY)
|
||||||
|
if (module STREQUAL "ecl")
|
||||||
|
#use clone directory libecl
|
||||||
|
set(_clone_dir "libecl")
|
||||||
|
else()
|
||||||
|
set(_clone_dir "${module}")
|
||||||
|
endif()
|
||||||
|
if(IS_DIRECTORY ${_modules_dir}/${_clone_dir}/${_leaf_dir_name})
|
||||||
|
set(${module}_DIR ${_modules_dir}/${_clone_dir}/${_leaf_dir_name})
|
||||||
|
else()
|
||||||
|
string(REPLACE ${PROJECT_NAME} ${_clone_dir} _module_leaf ${_leaf_dir_name})
|
||||||
|
if(NOT _leaf_dir_name STREQUAL _module_leaf
|
||||||
|
AND IS_DIRECTORY ${_parent_full_dir}/${_module_leaf})
|
||||||
|
# We are using build directories named <prefix><module-name><postfix>
|
||||||
|
set(${module}_DIR ${_parent_full_dir}/${_module_leaf})
|
||||||
|
elseif(IS_DIRECTORY ${_parent_full_dir}/${_clone_dir})
|
||||||
|
# All modules are in a common build dir
|
||||||
|
set(${module}_DIR "${_parent_full_dir}/${_clone_dir}}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(${module}_DIR AND NOT IS_DIRECTORY ${${module}_DIR})
|
||||||
|
message(WARNING "Value ${${module}_DIR} passed to variable"
|
||||||
|
" ${module}_DIR is not a directory")
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
if (NOT Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
find_package (Boost 1.44.0 COMPONENTS unit_test_framework QUIET)
|
||||||
find_package (Boost 1.44.0 COMPONENTS unit_test_framework QUIET)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
||||||
# setup to do a test compile
|
# setup to do a test compile
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if (CXX_COMPAT_GCC)
|
|||||||
|
|
||||||
# default optimization flags, if not set by user
|
# default optimization flags, if not set by user
|
||||||
set_default_option (CXX _opt_dbg "-O0" "(^|\ )-O")
|
set_default_option (CXX _opt_dbg "-O0" "(^|\ )-O")
|
||||||
set_default_option (CXX _opt_rel "-O2" "(^|\ )-O")
|
set_default_option (CXX _opt_rel "-O3" "(^|\ )-O")
|
||||||
|
|
||||||
# use these options for debug builds - no optimizations
|
# use these options for debug builds - no optimizations
|
||||||
add_options (ALL_LANGUAGES "${_prof_DEBUG}" ${_opt_dbg} "-DDEBUG")
|
add_options (ALL_LANGUAGES "${_prof_DEBUG}" ${_opt_dbg} "-DDEBUG")
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
# Add static analysis tests for a given source file
|
||||||
|
|
||||||
|
macro(setup_static_analysis_tools)
|
||||||
|
find_package(CppCheck)
|
||||||
|
if(CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||||
|
find_package(ClangCheck)
|
||||||
|
else()
|
||||||
|
message(STATUS "Disabling clang-check as CMAKE_EXPORT_COMPILE_COMMANDS is not enabled")
|
||||||
|
endif()
|
||||||
|
if(OPM_COMMON_ROOT)
|
||||||
|
set(DIR ${OPM_COMMON_ROOT})
|
||||||
|
elseif(OPM_MACROS_ROOT)
|
||||||
|
set(DIR ${OPM_MACROS_ROOT})
|
||||||
|
else()
|
||||||
|
set(DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
endif()
|
||||||
|
if(CPPCHECK_FOUND)
|
||||||
|
file(COPY ${DIR}/cmake/Scripts/cppcheck-test.sh
|
||||||
|
DESTINATION bin
|
||||||
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
endif()
|
||||||
|
if(CLANGCHECK_FOUND AND CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||||
|
configure_file(${DIR}/cmake/Scripts/clang-check-test.sh.in
|
||||||
|
${CMAKE_BINARY_DIR}/CMakeFiles/clang-check-test.sh)
|
||||||
|
file(COPY ${CMAKE_BINARY_DIR}/CMakeFiles/clang-check-test.sh
|
||||||
|
DESTINATION bin
|
||||||
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
function(add_static_analysis_tests sources includes)
|
||||||
|
if(CPPCHECK_FOUND OR (CLANGCHECK_FOUND AND CMAKE_EXPORT_COMPILE_COMMANDS))
|
||||||
|
foreach(dep ${${includes}})
|
||||||
|
list(APPEND IPATHS -I ${dep})
|
||||||
|
endforeach()
|
||||||
|
foreach(src ${${sources}})
|
||||||
|
file(RELATIVE_PATH name ${PROJECT_SOURCE_DIR} ${src})
|
||||||
|
if(CPPCHECK_FOUND)
|
||||||
|
add_test(NAME cppcheck+${name}
|
||||||
|
COMMAND bin/cppcheck-test.sh ${CPPCHECK_PROGRAM} ${src} ${IPATHS}
|
||||||
|
CONFIGURATIONS analyze cppcheck)
|
||||||
|
endif()
|
||||||
|
if(CLANGCHECK_FOUND AND CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||||
|
add_test(NAME clang-check+${name}
|
||||||
|
COMMAND bin/clang-check-test.sh ${CLANGCHECK_PROGRAM} ${src}
|
||||||
|
CONFIGURATIONS analyze clang-check)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# -*- mode: cmake; tab-width: 2; indent-tabs-mode: t; truncate-lines: t; compile-command: "cmake -Wdev" -*-
|
|
||||||
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
|
|
||||||
|
|
||||||
# defines that must be present in config.h for our headers
|
|
||||||
set (opm-benchmarks_CONFIG_VAR
|
|
||||||
)
|
|
||||||
|
|
||||||
# dependencies
|
|
||||||
set (opm-benchmarks_DEPS
|
|
||||||
# compile with C++0x/11 support if available
|
|
||||||
"CXX11Features REQUIRED"
|
|
||||||
# various runtime library enhancements
|
|
||||||
"Boost 1.44.0
|
|
||||||
COMPONENTS date_time filesystem system unit_test_framework REQUIRED"
|
|
||||||
# OPM dependency
|
|
||||||
"opm-common"
|
|
||||||
"opm-core REQUIRED"
|
|
||||||
"opm-upscaling REQUIRED"
|
|
||||||
)
|
|
||||||
@@ -29,10 +29,8 @@ set (opm-core_DEPS
|
|||||||
"SuiteSparse COMPONENTS umfpack"
|
"SuiteSparse COMPONENTS umfpack"
|
||||||
# solver
|
# solver
|
||||||
"SuperLU"
|
"SuperLU"
|
||||||
# xml processing (for config parsing)
|
|
||||||
"TinyXML"
|
|
||||||
# Ensembles-based Reservoir Tools (ERT)
|
# Ensembles-based Reservoir Tools (ERT)
|
||||||
"ERT REQUIRED"
|
"ecl REQUIRED"
|
||||||
# Look for MPI support
|
# Look for MPI support
|
||||||
"MPI"
|
"MPI"
|
||||||
# PETSc numerical backend
|
# PETSc numerical backend
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ set (opm-flowdiagnostics-applications_DEPS
|
|||||||
"CXX11Features REQUIRED"
|
"CXX11Features REQUIRED"
|
||||||
"Boost 1.44.0
|
"Boost 1.44.0
|
||||||
COMPONENTS filesystem regex system unit_test_framework REQUIRED"
|
COMPONENTS filesystem regex system unit_test_framework REQUIRED"
|
||||||
"ERT REQUIRED"
|
"ecl REQUIRED"
|
||||||
# prerequisite OPM modules
|
# prerequisite OPM modules
|
||||||
"opm-common REQUIRED;
|
"opm-common REQUIRED;
|
||||||
opm-flowdiagnostics REQUIRED;
|
opm-flowdiagnostics REQUIRED;
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ set (opm-grid_CONFIG_VAR
|
|||||||
DUNE_GRID_VERSION_MAJOR
|
DUNE_GRID_VERSION_MAJOR
|
||||||
DUNE_GRID_VERSION_MINOR
|
DUNE_GRID_VERSION_MINOR
|
||||||
DUNE_GRID_VERSION_REVISION
|
DUNE_GRID_VERSION_REVISION
|
||||||
|
DUNE_GEOMETRY_VERSION_MAJOR
|
||||||
|
DUNE_GEOMETRY_VERSION_MINOR
|
||||||
|
DUNE_GEOMETRY_VERSION_REVISION
|
||||||
DUNE_COMMON_VERSION_MAJOR
|
DUNE_COMMON_VERSION_MAJOR
|
||||||
DUNE_COMMON_VERSION_MINOR
|
DUNE_COMMON_VERSION_MINOR
|
||||||
DUNE_COMMON_VERSION_REVISION
|
DUNE_COMMON_VERSION_REVISION
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ set (opm-output_DEPS
|
|||||||
"Boost 1.44.0
|
"Boost 1.44.0
|
||||||
COMPONENTS unit_test_framework REQUIRED"
|
COMPONENTS unit_test_framework REQUIRED"
|
||||||
# Ensembles-based Reservoir Tools (ERT)
|
# Ensembles-based Reservoir Tools (ERT)
|
||||||
"ERT REQUIRED"
|
"ecl REQUIRED"
|
||||||
# Look for MPI support
|
# Look for MPI support
|
||||||
"opm-common REQUIRED"
|
"opm-common REQUIRED"
|
||||||
# Parser library for ECL-type simulation models
|
# Parser library for ECL-type simulation models
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ set (opm-simulators_CONFIG_VAR
|
|||||||
DUNE_ISTL_VERSION_MAJOR
|
DUNE_ISTL_VERSION_MAJOR
|
||||||
DUNE_ISTL_VERSION_MINOR
|
DUNE_ISTL_VERSION_MINOR
|
||||||
DUNE_ISTL_VERSION_REVISION
|
DUNE_ISTL_VERSION_REVISION
|
||||||
|
HAVE_SUITESPARSE_UMFPACK
|
||||||
)
|
)
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
@@ -24,6 +25,8 @@ set (opm-simulators_DEPS
|
|||||||
"dune-common REQUIRED;
|
"dune-common REQUIRED;
|
||||||
dune-istl REQUIRED"
|
dune-istl REQUIRED"
|
||||||
"ERTPython"
|
"ERTPython"
|
||||||
|
# Tim Davis' SuiteSparse archive
|
||||||
|
"SuiteSparse COMPONENTS umfpack REQUIRED"
|
||||||
# OPM dependency
|
# OPM dependency
|
||||||
"opm-common REQUIRED;
|
"opm-common REQUIRED;
|
||||||
opm-parser REQUIRED;
|
opm-parser REQUIRED;
|
||||||
|
|||||||
Executable
+23
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script performs a single analysis using clang-check
|
||||||
|
# It is used by the 'make test' target in the buildsystems
|
||||||
|
# Usually you should use 'ctest -C clang-check' rather than calling this script directly
|
||||||
|
#
|
||||||
|
# Parameters: $1 = Application binary
|
||||||
|
# $2 = Source file to process
|
||||||
|
|
||||||
|
clangcheck_cmd=$1
|
||||||
|
source_file=$2
|
||||||
|
|
||||||
|
tmpfil=`mktemp`
|
||||||
|
$clangcheck_cmd -p @CMAKE_BINARY_DIR@ -analyze $source_file &> $tmpfil
|
||||||
|
cat $tmpfil
|
||||||
|
if test -s $tmpfil
|
||||||
|
then
|
||||||
|
rm $tmpfil
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm $tmpfil
|
||||||
|
exit 0
|
||||||
Executable
+30
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script performs a single analysis using cppcheck
|
||||||
|
# It is used by the 'make test' target in the buildsystems
|
||||||
|
# Usually you should use 'ctest -C cppcheck' rather than calling this script directly
|
||||||
|
#
|
||||||
|
# Parameters: $1 = Application binary
|
||||||
|
# $2 = Source file to process
|
||||||
|
# $3..$N = include path parameters (-I dir1 -I dir2 ...)
|
||||||
|
|
||||||
|
cppcheck_cmd=$1
|
||||||
|
source_file=$2
|
||||||
|
shift 2
|
||||||
|
|
||||||
|
tmpfil=`mktemp`
|
||||||
|
$cppcheck_cmd $@ --enable=all --suppress=unusedFunction $source_file &> $tmpfil
|
||||||
|
nmatch=`cat $tmpfil | grep "\[.*\]" | wc -l`
|
||||||
|
nsys=`cat $tmpfil | grep "\[/usr.*\]" | wc -l`
|
||||||
|
nnone=`cat $tmpfil | grep "\[\\*]" | wc -l`
|
||||||
|
ndef=`cat $tmpfil | grep "\[.*Too many #ifdef" | wc -l`
|
||||||
|
let "nval=$nmatch-$nsys-$nnone-$ndef"
|
||||||
|
if test $nval -gt 0
|
||||||
|
then
|
||||||
|
cat $tmpfil
|
||||||
|
rm $tmpfil
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm $tmpfil
|
||||||
|
exit 0
|
||||||
@@ -19,51 +19,55 @@
|
|||||||
|
|
||||||
# <http://www.vtk.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file>
|
# <http://www.vtk.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file>
|
||||||
|
|
||||||
# propagate these properties from one build system to the other
|
# Prevent multiple inclusions
|
||||||
set (@opm-project_NAME@_VERSION "@opm-project_VERSION@")
|
if(NOT @opm-project_NAME@_FOUND)
|
||||||
set (@opm-project_NAME@_DEFINITIONS "@opm-project_DEFINITIONS@")
|
|
||||||
set (@opm-project_NAME@_INCLUDE_DIRS "@opm-project_INCLUDE_DIRS@")
|
|
||||||
set (@opm-project_NAME@_LIBRARY_DIRS "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
|
|
||||||
set (@opm-project_NAME@_LINKER_FLAGS "@opm-project_LINKER_FLAGS@")
|
|
||||||
set (@opm-project_NAME@_CONFIG_VARS "@opm-project_CONFIG_VARS@")
|
|
||||||
|
|
||||||
# libraries come from the build tree where this file was generated
|
# propagate these properties from one build system to the other
|
||||||
set (@opm-project_NAME@_LIBRARY "@opm-project_LIBRARY@")
|
set (@opm-project_NAME@_VERSION "@opm-project_VERSION@")
|
||||||
set (@opm-project_NAME@_LIBRARIES ${@opm-project_NAME@_LIBRARY} "@opm-project_LIBRARIES@")
|
set (@opm-project_NAME@_DEFINITIONS "@opm-project_DEFINITIONS@")
|
||||||
mark_as_advanced (@opm-project_NAME@_LIBRARY)
|
set (@opm-project_NAME@_INCLUDE_DIRS "@opm-project_INCLUDE_DIRS@")
|
||||||
|
set (@opm-project_NAME@_LIBRARY_DIRS "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
|
||||||
|
set (@opm-project_NAME@_LINKER_FLAGS "@opm-project_LINKER_FLAGS@")
|
||||||
|
set (@opm-project_NAME@_CONFIG_VARS "@opm-project_CONFIG_VARS@")
|
||||||
|
|
||||||
# not all projects have targets; conditionally add this part
|
# libraries come from the build tree where this file was generated
|
||||||
if (NOT "@opm-project_TARGET@" STREQUAL "")
|
set (@opm-project_NAME@_LIBRARY "@opm-project_LIBRARY@")
|
||||||
# add the library as a target, so that other things in the project including
|
set (@opm-project_NAME@_LIBRARIES ${@opm-project_NAME@_LIBRARY} "@opm-project_LIBRARIES@")
|
||||||
# this file may depend on it and get rebuild if this library changes.
|
mark_as_advanced (@opm-project_NAME@_LIBRARY)
|
||||||
add_library (@opm-project_TARGET@ UNKNOWN IMPORTED)
|
|
||||||
set_property (TARGET @opm-project_TARGET@ PROPERTY IMPORTED_LOCATION "${@opm-project_NAME@_LIBRARY}")
|
|
||||||
endif (NOT "@opm-project_TARGET@" STREQUAL "")
|
|
||||||
|
|
||||||
# ensure that we build with support for C++11 to preserve ABI
|
# not all projects have targets; conditionally add this part
|
||||||
string (REPLACE "@CXX_STD0X_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
if (NOT "@opm-project_TARGET@" STREQUAL "")
|
||||||
string (REPLACE "@CXX_STDLIB_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
# add the library as a target, so that other things in the project including
|
||||||
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
|
# this file may depend on it and get rebuild if this library changes.
|
||||||
set (CMAKE_CXX_FLAGS "@CXX_STD0X_FLAGS@@CXX_SPACE@@CXX_STDLIB_FLAGS@ ${CMAKE_CXX_FLAGS}")
|
add_library (@opm-project_TARGET@ UNKNOWN IMPORTED)
|
||||||
|
set_property (TARGET @opm-project_TARGET@ PROPERTY IMPORTED_LOCATION "${@opm-project_NAME@_LIBRARY}")
|
||||||
|
endif (NOT "@opm-project_TARGET@" STREQUAL "")
|
||||||
|
|
||||||
# same as above, but for C99
|
# ensure that we build with support for C++11 to preserve ABI
|
||||||
string (REPLACE "@C_STD99_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
string (REPLACE "@CXX_STD0X_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
|
string (REPLACE "@CXX_STDLIB_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
set (CMAKE_C_FLAG "@C_STD99_FLAGS@ ${CMAKE_C_FLAGS}")
|
|
||||||
|
|
||||||
# build with OpenMP if that was found
|
|
||||||
if (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
|
|
||||||
string (REPLACE "@OpenMP_C_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
|
||||||
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
|
|
||||||
set (CMAKE_C_FLAG "@OpenMP_C_FLAGS@ ${CMAKE_C_FLAGS}")
|
|
||||||
endif (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
|
|
||||||
if (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "")
|
|
||||||
string (REPLACE "@OpenMP_CXX_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
||||||
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
|
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
|
||||||
set (CMAKE_C_FLAG "@OpenMP_CXX_FLAGS@ ${CMAKE_CXX_FLAGS}")
|
set (CMAKE_CXX_FLAGS "@CXX_STD0X_FLAGS@@CXX_SPACE@@CXX_STDLIB_FLAGS@ ${CMAKE_CXX_FLAGS}")
|
||||||
endif (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "")
|
|
||||||
|
|
||||||
# this is the contents of config.h as far as our probes can tell:
|
# same as above, but for C99
|
||||||
|
string (REPLACE "@C_STD99_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
|
||||||
|
set (CMAKE_C_FLAG "@C_STD99_FLAGS@ ${CMAKE_C_FLAGS}")
|
||||||
|
|
||||||
# extra code
|
# build with OpenMP if that was found
|
||||||
@OPM_PROJECT_EXTRA_CODE@
|
if (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
|
||||||
|
string (REPLACE "@OpenMP_C_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
|
||||||
|
set (CMAKE_C_FLAG "@OpenMP_C_FLAGS@ ${CMAKE_C_FLAGS}")
|
||||||
|
endif (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
|
||||||
|
if (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "")
|
||||||
|
string (REPLACE "@OpenMP_CXX_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
|
||||||
|
set (CMAKE_C_FLAG "@OpenMP_CXX_FLAGS@ ${CMAKE_CXX_FLAGS}")
|
||||||
|
endif (NOT "@OpenMP_CXX_FLAGS@" STREQUAL "")
|
||||||
|
|
||||||
|
# this is the contents of config.h as far as our probes can tell:
|
||||||
|
|
||||||
|
# extra code
|
||||||
|
@OPM_PROJECT_EXTRA_CODE@
|
||||||
|
endif()
|
||||||
|
|||||||
Vendored
+1
-1
@@ -20,7 +20,7 @@ override_dh_auto_build:
|
|||||||
|
|
||||||
# consider using -DUSE_VERSIONED_DIR=ON if backporting
|
# consider using -DUSE_VERSIONED_DIR=ON if backporting
|
||||||
override_dh_auto_configure:
|
override_dh_auto_configure:
|
||||||
dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-common1 -DWHOLE_PROG_OPTIM=ON -DUSE_RUNPATH=OFF
|
dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-common1 -DWHOLE_PROG_OPTIM=ON -DUSE_RUNPATH=OFF -DWITH_NATIVE=OFF
|
||||||
|
|
||||||
override_dh_auto_install:
|
override_dh_auto_install:
|
||||||
dh_auto_install -- install-html
|
dh_auto_install -- install-html
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
Module: opm-common
|
Module: opm-common
|
||||||
Description: Open Porous Media Initiative shared infrastructure
|
Description: Open Porous Media Initiative shared infrastructure
|
||||||
Version: 2017.04-pre
|
Version: 2017.10-pre
|
||||||
Label: 2017.04-pre
|
Label: 2017.10-pre
|
||||||
Maintainer: opm@opm-project.org
|
Maintainer: opm@opm-project.org
|
||||||
MaintainerName: OPM community
|
MaintainerName: OPM community
|
||||||
Url: http://opm-project.org
|
Url: http://opm-project.org
|
||||||
|
|||||||
@@ -90,7 +90,12 @@ function build_module {
|
|||||||
cmake --build .
|
cmake --build .
|
||||||
fi
|
fi
|
||||||
test $? -eq 0 || exit 2
|
test $? -eq 0 || exit 2
|
||||||
ctest -T Test --no-compress-output
|
if test -z "$CTEST_CONFIGURATION"
|
||||||
|
then
|
||||||
|
ctest -T Test --no-compress-output
|
||||||
|
else
|
||||||
|
ctest -C $CTEST_CONFIGURATION --timeout 5000 -T Test --no-compress-output
|
||||||
|
fi
|
||||||
|
|
||||||
# Convert to junit format
|
# Convert to junit format
|
||||||
$WORKSPACE/deps/opm-common/jenkins/convert.py -x $WORKSPACE/deps/opm-common/jenkins/conv.xsl -t . > testoutput.xml
|
$WORKSPACE/deps/opm-common/jenkins/convert.py -x $WORKSPACE/deps/opm-common/jenkins/conv.xsl -t . > testoutput.xml
|
||||||
@@ -119,9 +124,9 @@ function clone_module {
|
|||||||
mkdir -p $WORKSPACE/deps/$1
|
mkdir -p $WORKSPACE/deps/$1
|
||||||
cd $WORKSPACE/deps/$1
|
cd $WORKSPACE/deps/$1
|
||||||
git init .
|
git init .
|
||||||
if [ "$1" == "ert" ]
|
if [ "$1" == "libecl" ]
|
||||||
then
|
then
|
||||||
git remote add origin https://github.com/Ensembles/$1
|
git remote add origin https://github.com/Statoil/$1
|
||||||
else
|
else
|
||||||
git remote add origin https://github.com/OPM/$1
|
git remote add origin https://github.com/OPM/$1
|
||||||
fi
|
fi
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@ ln -sf $WORKSPACE deps/opm-common
|
|||||||
|
|
||||||
# Downstreams and revisions
|
# Downstreams and revisions
|
||||||
declare -a downstreams
|
declare -a downstreams
|
||||||
downstreams=(ert
|
downstreams=(libecl
|
||||||
opm-parser
|
opm-parser
|
||||||
opm-output
|
opm-output
|
||||||
opm-material
|
opm-material
|
||||||
@@ -20,7 +20,7 @@ downstreams=(ert
|
|||||||
)
|
)
|
||||||
|
|
||||||
declare -A downstreamRev
|
declare -A downstreamRev
|
||||||
downstreamRev[ert]=master
|
downstreamRev[libecl]=master
|
||||||
downstreamRev[opm-parser]=master
|
downstreamRev[opm-parser]=master
|
||||||
downstreamRev[opm-material]=master
|
downstreamRev[opm-material]=master
|
||||||
downstreamRev[opm-core]=master
|
downstreamRev[opm-core]=master
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ MAIN_REPO=$1 # The repo the update was triggered from
|
|||||||
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
|
source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh
|
||||||
|
|
||||||
declare -a upstreams # Everything is considered an upstream to aid code reuse
|
declare -a upstreams # Everything is considered an upstream to aid code reuse
|
||||||
upstreams=(ert
|
upstreams=(libecl
|
||||||
opm-common
|
opm-common
|
||||||
opm-parser
|
opm-parser
|
||||||
opm-output
|
opm-output
|
||||||
@@ -18,7 +18,7 @@ upstreams=(ert
|
|||||||
)
|
)
|
||||||
|
|
||||||
declare -A upstreamRev
|
declare -A upstreamRev
|
||||||
upstreamRev[ert]=master
|
upstreamRev[libecl]=master
|
||||||
upstreamRev[opm-common]=master
|
upstreamRev[opm-common]=master
|
||||||
upstreamRev[opm-parser]=master
|
upstreamRev[opm-parser]=master
|
||||||
upstreamRev[opm-material]=master
|
upstreamRev[opm-material]=master
|
||||||
@@ -55,4 +55,39 @@ $WORKSPACE/deps/opm-simulators/tests/update_reference_data.sh $OPM_DATA_ROOT
|
|||||||
# Finally open the pull request
|
# Finally open the pull request
|
||||||
cd $OPM_DATA_ROOT
|
cd $OPM_DATA_ROOT
|
||||||
git remote add jenkins4opm git@github.com:jenkins4opm/opm-data
|
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
|
|
||||||
|
# Do some cleaning of old remote branches
|
||||||
|
# Easier code with git 2.7+
|
||||||
|
#BRANCHES=`git branch --sort=committerdate -r | grep jenkins4opm`
|
||||||
|
#NBRANCHES=`git branch --sort=committerdate -r | grep jenkins4opm | wc -l`
|
||||||
|
git fetch jenkins4opm # Sadly necessary with older git
|
||||||
|
BRANCHES=`git for-each-ref --sort=committerdate refs/remotes/jenkins4opm/ --format='%(refname:short)'`
|
||||||
|
NBRANCHES=`git for-each-ref --sort=committerdate refs/remotes/jenkins4opm/ --format='%(refname:short)' | wc -l`
|
||||||
|
if test $NBRANCHES -gt 30
|
||||||
|
then
|
||||||
|
for BRANCH in $BRANCHES
|
||||||
|
do
|
||||||
|
BNAME=`echo $BRANCH | cut -f1 -d '/' --complement`
|
||||||
|
if [ "$BNAME" != "HEAD" ]
|
||||||
|
then
|
||||||
|
git push jenkins4opm :$BNAME
|
||||||
|
fi
|
||||||
|
NBRANCHES=$((NBRANCHES-1))
|
||||||
|
if test $NBRANCHES -lt 30
|
||||||
|
then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "`echo $BRANCHES | tr ' ' '\n' | grep ^jenkins4opm/$BRANCH_NAME$`" ]
|
||||||
|
then
|
||||||
|
GH_TOKEN=`git config --get gitOpenPull.Token`
|
||||||
|
REV=${upstreamRev[$MAIN_REPO]}
|
||||||
|
PRNUMBER=${rev//[!0-9]/}
|
||||||
|
DATA_PR=`curl -X GET https://api.github.com/repos/OPM/opm-data/pulls?head=jenkins4opm:$BRANCH_NAME | grep '"number":' | awk -F ':' '{print $2}' | sed -e 's/,//'`
|
||||||
|
git push -u jenkins4opm $BRANCH_NAME -f
|
||||||
|
curl -d "{ \"body\": \"Existing PR https://github.com/OPM/opm-data/pull/$DATA_PR was updated\" }" -X POST https://api.github.com/repos/OPM/$MAIN_REPO/issues/$PRNUMBER/comments?access_token=$GH_TOKEN
|
||||||
|
else
|
||||||
|
git-open-pull -u jenkins4opm --base-account OPM --base-repo opm-data -r /tmp/cmsg $BRANCH_NAME
|
||||||
|
fi
|
||||||
|
|||||||
@@ -58,6 +58,13 @@ public:
|
|||||||
: NumericalProblem(message)
|
: NumericalProblem(message)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
class TooManyIterations : public NumericalProblem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit TooManyIterations(const std::string &message)
|
||||||
|
: NumericalProblem(message)
|
||||||
|
{}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // OPM_EXCEPTIONS_HPP
|
#endif // OPM_EXCEPTIONS_HPP
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Opm {
|
|||||||
class CounterLog : public LogBackend
|
class CounterLog : public LogBackend
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CounterLog(int64_t messageMask);
|
explicit CounterLog(int64_t messageMask);
|
||||||
CounterLog();
|
CounterLog();
|
||||||
|
|
||||||
size_t numMessages(int64_t messageType) const;
|
size_t numMessages(int64_t messageType) const;
|
||||||
|
|||||||
@@ -58,16 +58,16 @@ namespace Log {
|
|||||||
prefix = "Info";
|
prefix = "Info";
|
||||||
break;
|
break;
|
||||||
case MessageType::Warning:
|
case MessageType::Warning:
|
||||||
prefix = "Warning";
|
prefix = "\nWarning";
|
||||||
break;
|
break;
|
||||||
case MessageType::Error:
|
case MessageType::Error:
|
||||||
prefix = "Error";
|
prefix = "\nError";
|
||||||
break;
|
break;
|
||||||
case MessageType::Problem:
|
case MessageType::Problem:
|
||||||
prefix = "Problem";
|
prefix = "\nProblem";
|
||||||
break;
|
break;
|
||||||
case MessageType::Bug:
|
case MessageType::Bug:
|
||||||
prefix = "Bug";
|
prefix = "\nBug";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw std::invalid_argument("Unhandled messagetype");
|
throw std::invalid_argument("Unhandled messagetype");
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SimpleMessageFormatter(const bool use_color_coding)
|
explicit SimpleMessageFormatter(const bool use_color_coding)
|
||||||
: use_color_coding_(use_color_coding)
|
: use_color_coding_(use_color_coding)
|
||||||
{
|
{
|
||||||
prefix_flag_ = Log::MessageType::Warning + Log::MessageType::Error
|
prefix_flag_ = Log::MessageType::Warning + Log::MessageType::Error
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageLimiter(const int tag_limit, const std::map<int64_t, int> category_limits)
|
MessageLimiter(const int tag_limit, const std::map<int64_t, int>& category_limits)
|
||||||
: tag_limit_(tag_limit < 0 ? NoLimit : tag_limit),
|
: tag_limit_(tag_limit < 0 ? NoLimit : tag_limit),
|
||||||
category_limits_(category_limits)
|
category_limits_(category_limits)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -77,13 +77,13 @@ public:
|
|||||||
|
|
||||||
template <class BackendType>
|
template <class BackendType>
|
||||||
static std::shared_ptr<BackendType> getBackend(const std::string& name) {
|
static std::shared_ptr<BackendType> getBackend(const std::string& name) {
|
||||||
auto logger = OpmLog::getLogger();
|
auto logger = getLogger();
|
||||||
return logger->getBackend<BackendType>(name);
|
return logger->getBackend<BackendType>(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class BackendType>
|
template <class BackendType>
|
||||||
static std::shared_ptr<BackendType> popBackend(const std::string& name) {
|
static std::shared_ptr<BackendType> popBackend(const std::string& name) {
|
||||||
auto logger = OpmLog::getLogger();
|
auto logger = getLogger();
|
||||||
return logger->popBackend<BackendType>(name);
|
return logger->popBackend<BackendType>(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,13 @@ namespace Opm {
|
|||||||
TimerLog::TimerLog(const std::string& logFile) : StreamLog( logFile , StopTimer | StartTimer )
|
TimerLog::TimerLog(const std::string& logFile) : StreamLog( logFile , StopTimer | StartTimer )
|
||||||
{
|
{
|
||||||
m_work.precision(8);
|
m_work.precision(8);
|
||||||
|
m_start = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TimerLog::TimerLog(std::ostream& os) : StreamLog( os , StopTimer | StartTimer )
|
TimerLog::TimerLog(std::ostream& os) : StreamLog( os , StopTimer | StartTimer )
|
||||||
{
|
{
|
||||||
m_work.precision(8);
|
m_work.precision(8);
|
||||||
|
m_start = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ public:
|
|||||||
static const int64_t StartTimer = 4096;
|
static const int64_t StartTimer = 4096;
|
||||||
static const int64_t StopTimer = 8192;
|
static const int64_t StopTimer = 8192;
|
||||||
|
|
||||||
TimerLog(const std::string& logFile);
|
explicit TimerLog(const std::string& logFile);
|
||||||
TimerLog(std::ostream& os);
|
explicit TimerLog(std::ostream& os);
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
~TimerLog() {};
|
~TimerLog() {};
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ This package contains the documentation files for opm-common
|
|||||||
# consider using -DUSE_VERSIONED_DIR=ON if backporting
|
# consider using -DUSE_VERSIONED_DIR=ON if backporting
|
||||||
%build
|
%build
|
||||||
%{?el6:scl enable devtoolset-3 bash}
|
%{?el6:scl enable devtoolset-3 bash}
|
||||||
%{?el6:cmake28} %{?!el6:cmake} -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_DOCDIR=share/doc/%{name}-%{version} -DUSE_RUNPATH=OFF %{?el6:-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/g++ -DCMAKE_C_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gcc -DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gfortran -DBOOST_LIBRARYDIR=%{_libdir}/boost148 -DBOOST_INCLUDEDIR=%{_includedir}/boost148}
|
%{?el6:cmake28} %{?!el6:cmake} -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_DOCDIR=share/doc/%{name}-%{version} -DUSE_RUNPATH=OFF -DWITH_NATIVE=OFF %{?el6:-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/g++ -DCMAKE_C_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gcc -DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gfortran -DBOOST_LIBRARYDIR=%{_libdir}/boost148 -DBOOST_INCLUDEDIR=%{_includedir}/boost148}
|
||||||
make
|
make
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ BOOST_AUTO_TEST_CASE(DoLogging) {
|
|||||||
BOOST_AUTO_TEST_CASE(Test_Format) {
|
BOOST_AUTO_TEST_CASE(Test_Format) {
|
||||||
BOOST_CHECK_EQUAL( "There is an error here?\nIn file /path/to/file, line 100\n" , Log::fileMessage("/path/to/file" , 100 , "There is an error here?"));
|
BOOST_CHECK_EQUAL( "There is an error here?\nIn file /path/to/file, line 100\n" , Log::fileMessage("/path/to/file" , 100 , "There is an error here?"));
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL( "Error: This is the error" , Log::prefixMessage(Log::MessageType::Error , "This is the error"));
|
BOOST_CHECK_EQUAL( "\nError: This is the error" , Log::prefixMessage(Log::MessageType::Error , "This is the error"));
|
||||||
BOOST_CHECK_EQUAL( "Warning: This is the warning" , Log::prefixMessage(Log::MessageType::Warning , "This is the warning"));
|
BOOST_CHECK_EQUAL( "\nWarning: This is the warning" , Log::prefixMessage(Log::MessageType::Warning , "This is the warning"));
|
||||||
BOOST_CHECK_EQUAL( "Info: This is the info" , Log::prefixMessage(Log::MessageType::Info , "This is the info"));
|
BOOST_CHECK_EQUAL( "Info: This is the info" , Log::prefixMessage(Log::MessageType::Info , "This is the info"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,10 +250,10 @@ BOOST_AUTO_TEST_CASE(TestHelperFunctions)
|
|||||||
|
|
||||||
// fileMessage
|
// fileMessage
|
||||||
BOOST_CHECK_EQUAL(fileMessage("foo/bar", 1, "message"), "message\nIn file foo/bar, line 1\n");
|
BOOST_CHECK_EQUAL(fileMessage("foo/bar", 1, "message"), "message\nIn file foo/bar, line 1\n");
|
||||||
BOOST_CHECK_EQUAL(fileMessage(MessageType::Error, "foo/bar", 1, "message"), "Error: message\nIn file foo/bar, line 1\n");
|
BOOST_CHECK_EQUAL(fileMessage(MessageType::Error, "foo/bar", 1, "message"), "\nError: message\nIn file foo/bar, line 1\n");
|
||||||
|
|
||||||
// prefixMessage
|
// prefixMessage
|
||||||
BOOST_CHECK_EQUAL(prefixMessage(MessageType::Error, "message"), "Error: message");
|
BOOST_CHECK_EQUAL(prefixMessage(MessageType::Error, "message"), "\nError: message");
|
||||||
BOOST_CHECK_EQUAL(prefixMessage(MessageType::Info, "message"), "Info: message");
|
BOOST_CHECK_EQUAL(prefixMessage(MessageType::Info, "message"), "Info: message");
|
||||||
BOOST_CHECK_EQUAL(prefixMessage(MessageType::Note, "message"), "Note: message");
|
BOOST_CHECK_EQUAL(prefixMessage(MessageType::Note, "message"), "Note: message");
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ BOOST_AUTO_TEST_CASE(TestOpmLogWithLimits)
|
|||||||
+ Log::colorCodeMessage(Log::MessageType::Info, "Info") + "\n"
|
+ Log::colorCodeMessage(Log::MessageType::Info, "Info") + "\n"
|
||||||
+ Log::colorCodeMessage(Log::MessageType::Bug, "Bug") + "\n"
|
+ Log::colorCodeMessage(Log::MessageType::Bug, "Bug") + "\n"
|
||||||
+ Log::colorCodeMessage(Log::MessageType::Warning, "Warning") + "\n"
|
+ Log::colorCodeMessage(Log::MessageType::Warning, "Warning") + "\n"
|
||||||
+ Log::colorCodeMessage(Log::MessageType::Warning, "Message limit reached for message category: Warning") + "\n";
|
+ Log::colorCodeMessage(Log::MessageType::Warning, "Message limit reached for message category: \nWarning") + "\n";
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL(log_stream2.str(), expected2);
|
BOOST_CHECK_EQUAL(log_stream2.str(), expected2);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
build_order=(opm-common opm-parser opm-material opm-output opm-grid opm-core ewoms opm-simulators)
|
build_order=(opm-common opm-parser opm-output opm-material opm-grid opm-core ewoms opm-simulators)
|
||||||
|
|
||||||
# This shell script should be started with the name of a module as
|
# This shell script should be started with the name of a module as
|
||||||
# only only command line argument. It will start by building all
|
# only only command line argument. It will start by building all
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function build_dune {
|
|||||||
pushd . > /dev/null
|
pushd . > /dev/null
|
||||||
git clone ${url}
|
git clone ${url}
|
||||||
cd ${project}
|
cd ${project}
|
||||||
git checkout tags/v2.3.1
|
git checkout tags/v2.4.1
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ../
|
cmake ../
|
||||||
@@ -62,11 +62,11 @@ function install_python_deps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function build_ert {
|
function build_libecl {
|
||||||
install_python_deps
|
install_python_deps
|
||||||
git clone https://github.com/Ensembles/ert.git
|
git clone https://github.com/Statoil/libecl.git
|
||||||
mkdir -p ert/build
|
mkdir -p libecl/build
|
||||||
pushd ert/build > /dev/null
|
pushd libecl/build > /dev/null
|
||||||
cmake .. && make
|
cmake .. && make
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ function build_ert {
|
|||||||
#################################################################
|
#################################################################
|
||||||
|
|
||||||
build_superlu
|
build_superlu
|
||||||
build_ert
|
build_libecl
|
||||||
|
|
||||||
build_dune dune-common
|
build_dune dune-common
|
||||||
build_dune dune-istl
|
build_dune dune-istl
|
||||||
|
|||||||
Reference in New Issue
Block a user