Compare commits
4 Commits
release/20
...
release/20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
faab33a051 | ||
|
|
513893eb59 | ||
|
|
62dc95e894 | ||
|
|
8e11e44559 |
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
BasedOnStyle: WebKit,
|
|
||||||
AlignAfterOpenBracket: AlwaysBreak,
|
|
||||||
AlignConsecutiveAssignments: false,
|
|
||||||
AlignConsecutiveDeclarations: false,
|
|
||||||
AlignAfterOpenBracket: Align,
|
|
||||||
AllowShortBlocksOnASingleLine: false,
|
|
||||||
AllowShortFunctionsOnASingleLine: None,
|
|
||||||
AlwaysBreakAfterReturnType: TopLevelDefinitions,
|
|
||||||
AlwaysBreakTemplateDeclarations: Yes,
|
|
||||||
BinPackArguments: false,
|
|
||||||
BinPackParameters: false,
|
|
||||||
BreakBeforeBraces: Linux,
|
|
||||||
BreakConstructorInitializers: BeforeComma,
|
|
||||||
ColumnLimit: 120,
|
|
||||||
Cpp11BracedListStyle: true,
|
|
||||||
FixNamespaceComments: true,
|
|
||||||
MaxEmptyLinesToKeep: 5,
|
|
||||||
NamespaceIndentation: Inner,
|
|
||||||
}
|
|
||||||
29
.gitignore
vendored
29
.gitignore
vendored
@@ -44,32 +44,3 @@ Testing/
|
|||||||
|
|
||||||
# Build directory in source.
|
# Build directory in source.
|
||||||
build/
|
build/
|
||||||
|
|
||||||
gmon.out
|
|
||||||
log.log
|
|
||||||
build
|
|
||||||
install
|
|
||||||
.cproject
|
|
||||||
.project
|
|
||||||
/testdata/statoil
|
|
||||||
.idea
|
|
||||||
/Debug/
|
|
||||||
|
|
||||||
# Compiled Dynamic libraries
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
|
|
||||||
# Compiled Static libraries
|
|
||||||
*.lai
|
|
||||||
*.la
|
|
||||||
*.a
|
|
||||||
|
|
||||||
# Mac OS X debug info
|
|
||||||
*.dSYM
|
|
||||||
|
|
||||||
# emacs directory setting:
|
|
||||||
.dir-locals.el
|
|
||||||
|
|
||||||
*.pyc
|
|
||||||
*.eggs
|
|
||||||
*.egg-info
|
|
||||||
|
|||||||
0
.gitmodules
vendored
0
.gitmodules
vendored
31
.travis.yml
Normal file
31
.travis.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
language: cpp
|
||||||
|
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- boost-latest
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- libboost1.55-all-dev
|
||||||
|
- gcc-4.8
|
||||||
|
- g++-4.8
|
||||||
|
- gfortran-4.8
|
||||||
|
- liblapack-dev
|
||||||
|
- libgmp3-dev
|
||||||
|
- libsuitesparse-dev
|
||||||
|
- libeigen3-dev
|
||||||
|
- bc
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- export CXX="g++-4.8" CC="gcc-4.8" FC="gfortran-4.8"
|
||||||
|
- cd ..
|
||||||
|
- opm-common/travis/build-prereqs.sh
|
||||||
|
- opm-common/travis/clone-opm.sh opm-common
|
||||||
|
|
||||||
|
|
||||||
|
script: opm-common/travis/build-and-test.sh opm-common
|
||||||
|
|
||||||
|
|
||||||
446
CMakeLists.txt
446
CMakeLists.txt
@@ -1,141 +1,41 @@
|
|||||||
project(opm-common C CXX)
|
cmake_minimum_required (VERSION 2.8)
|
||||||
cmake_minimum_required (VERSION 3.10)
|
|
||||||
|
|
||||||
option(SIBLING_SEARCH "Search for other modules in sibling directories?" ON)
|
option(SIBLING_SEARCH "Search for other modules in sibling directories?" ON)
|
||||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
|
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
|
||||||
set(OPM_MACROS_ROOT ${PROJECT_SOURCE_DIR})
|
set(OPM_MACROS_ROOT ${PROJECT_SOURCE_DIR})
|
||||||
|
|
||||||
option(ENABLE_ECL_INPUT "Enable eclipse input support?" ON)
|
|
||||||
option(ENABLE_ECL_OUTPUT "Enable eclipse output support?" ON)
|
|
||||||
option(ENABLE_MOCKSIM "Build the mock simulator for io testing" ON)
|
|
||||||
option(OPM_ENABLE_PYTHON "Enable python bindings?" OFF)
|
|
||||||
option(OPM_INSTALL_PYTHON "Enable python bindings?" OFF)
|
|
||||||
option(OPM_ENABLE_EMBEDDED_PYTHON "Enable embedded python?" OFF)
|
|
||||||
|
|
||||||
# Output implies input
|
|
||||||
if(ENABLE_ECL_OUTPUT)
|
|
||||||
set(ENABLE_ECL_INPUT ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# And likewise, no input means no output
|
|
||||||
if(NOT ENABLE_ECL_INPUT)
|
|
||||||
set(ENABLE_ECL_OUTPUT OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
# not the same location as most of the other projects; this hook overrides
|
# not the same location as most of the other projects; this hook overrides
|
||||||
macro (dir_hook)
|
macro (dir_hook)
|
||||||
endmacro (dir_hook)
|
endmacro (dir_hook)
|
||||||
|
|
||||||
# We need to define this variable in the installed cmake config file.
|
# We need to define this variable in the installed cmake config file.
|
||||||
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "#ENABLE_ECL_INPUT is needed by opm-common-prereq.cmake
|
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "set(OPM_MACROS_ROOT ${CMAKE_INSTALL_PREFIX}/share/opm)
|
||||||
set(ENABLE_ECL_INPUT ${ENABLE_ECL_INPUT})
|
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)")
|
||||||
set(OPM_MACROS_ROOT ${CMAKE_INSTALL_PREFIX}/share/opm)
|
|
||||||
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)
|
|
||||||
include(OpmPackage) #Make macros availabe after find_package(opm-common)")
|
|
||||||
|
|
||||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "#ENABLE_ECL_INPUT is needed by opm-common-prereq.cmake
|
set(OPM_PROJECT_EXTRA_CODE_INTREE "set(OPM_MACROS_ROOT ${OPM_MACROS_ROOT})
|
||||||
set(ENABLE_ECL_INPUT ${ENABLE_ECL_INPUT})
|
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)")
|
||||||
set(OPM_MACROS_ROOT ${OPM_MACROS_ROOT})
|
|
||||||
list(APPEND CMAKE_MODULE_PATH \${OPM_MACROS_ROOT}/cmake/Modules)
|
|
||||||
include(OpmPackage) #Make macros availabe after find_package(opm-common)")
|
|
||||||
if(ENABLE_ECL_OUTPUT)
|
|
||||||
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
|
|
||||||
set(COMPARE_ECL_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/compareECL)
|
|
||||||
set(OPM_PACK_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/opmpack)
|
|
||||||
set(RST_DECK_COMMAND ${CMAKE_INSTALL_PREFIX}/bin${${name}_VER_DIR}/rst_deck)")
|
|
||||||
|
|
||||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
|
|
||||||
set(COMPARE_ECL_COMMAND ${PROJECT_BINARY_DIR}/bin/compareECL)
|
|
||||||
set(OPM_PACK_COMMAND ${PROJECT_BINARY_DIR}/bin/opmpack)
|
|
||||||
set(RST_DECK_COMMAND ${PROJECT_BINARY_DIR}/bin/rst_deck)")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# project information is in dune.module. Read this file and set variables.
|
# project information is in dune.module. Read this file and set variables.
|
||||||
# we cannot generate dune.module since it is read by dunecontrol before
|
# we cannot generate dune.module since it is read by dunecontrol before
|
||||||
# the build starts, so it makes sense to keep the data there then.
|
# the build starts, so it makes sense to keep the data there then.
|
||||||
include (OpmInit)
|
include (OpmInit)
|
||||||
OpmSetPolicies()
|
|
||||||
|
|
||||||
# Look for the opm-tests repository; if found the variable
|
|
||||||
# HAVE_OPM_TESTS will be set to true.
|
|
||||||
include(Findopm-tests)
|
|
||||||
|
|
||||||
# list of prerequisites for this particular project; this is in a
|
# list of prerequisites for this particular project; this is in a
|
||||||
# separate file (in cmake/Modules sub-directory) because it is shared
|
# separate file (in cmake/Modules sub-directory) because it is shared
|
||||||
# with the find module
|
# with the find module
|
||||||
include (${project}-prereqs)
|
include (${project}-prereqs)
|
||||||
|
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
# source_hook runs before config_hook and the former needs fmt, hence this
|
|
||||||
# needs to be here.
|
|
||||||
if(fmt_FOUND)
|
|
||||||
# OpmSatellites will not add the library, do it here.
|
|
||||||
list(APPEND opm-common_LIBRARIES fmt::fmt)
|
|
||||||
else()
|
|
||||||
add_definitions(-DFMT_HEADER_ONLY)
|
|
||||||
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/external/fmtlib/include)
|
|
||||||
# Not sure why this is needed.
|
|
||||||
list(APPEND EXTRA_INCLUDES ${PROJECT_SOURCE_DIR}/external/fmtlib/include)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# read the list of components from this file (in the project directory);
|
# read the list of components from this file (in the project directory);
|
||||||
# it should set various lists with the names of the files to include
|
# it should set various lists with the names of the files to include
|
||||||
include (CMakeLists_files.cmake)
|
include (CMakeLists_files.cmake)
|
||||||
|
|
||||||
macro (config_hook)
|
macro (config_hook)
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
if(NOT cjson_FOUND)
|
|
||||||
list(APPEND EXTRA_INCLUDES ${PROJECT_SOURCE_DIR}/external/cjson)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# For this project
|
|
||||||
include_directories(${EXTRA_INCLUDES} ${PROJECT_BINARY_DIR}/include)
|
|
||||||
# For downstreams
|
|
||||||
list(APPEND EXTRA_INCLUDES ${PROJECT_BINARY_DIR}/include)
|
|
||||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
|
|
||||||
list(APPEND opm-common_INCLUDE_DIRS ${EXTRA_INCLUDES})")
|
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
|
|
||||||
set(HAVE_ECL_INPUT 1)")
|
|
||||||
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
|
|
||||||
set(HAVE_ECL_INPUT 1)")
|
|
||||||
endif()
|
|
||||||
if(ENABLE_ECL_OUTPUT)
|
|
||||||
set(OPM_PROJECT_EXTRA_CODE_INTREE "${OPM_PROJECT_EXTRA_CODE_INTREE}
|
|
||||||
set(HAVE_ECL_OUTPUT 1)")
|
|
||||||
set(OPM_PROJECT_EXTRA_CODE_INSTALLED "${OPM_PROJECT_EXTRA_CODE_INSTALLED}
|
|
||||||
set(HAVE_ECL_OUTPUT 1)")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(Boost COMPONENTS filesystem regex system unit_test_framework)
|
|
||||||
|
|
||||||
if (HAVE_DYNAMIC_BOOST_TEST)
|
|
||||||
set_target_properties(Boost::unit_test_framework PROPERTIES INTERFACE_COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK=1)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endmacro (config_hook)
|
endmacro (config_hook)
|
||||||
|
|
||||||
macro (prereqs_hook)
|
macro (prereqs_hook)
|
||||||
endmacro (prereqs_hook)
|
endmacro (prereqs_hook)
|
||||||
|
|
||||||
macro (sources_hook)
|
macro (sources_hook)
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
# Keyword generation
|
|
||||||
include(GenerateKeywords.cmake)
|
|
||||||
|
|
||||||
# Append generated sources
|
|
||||||
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserInit.cpp)
|
|
||||||
foreach (name A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
|
|
||||||
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/ParserKeywords/${name}.cpp)
|
|
||||||
endforeach()
|
|
||||||
if (OPM_ENABLE_PYTHON)
|
|
||||||
list(INSERT opm-common_SOURCES 0 ${PROJECT_BINARY_DIR}/python/cxx/builtin_pybind11.cpp)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
set_source_files_properties(src/opm/parser/eclipse/Python/Python.cpp
|
|
||||||
PROPERTIES COMPILE_FLAGS -Wno-shadow)
|
|
||||||
endmacro (sources_hook)
|
endmacro (sources_hook)
|
||||||
|
|
||||||
macro (fortran_hook)
|
macro (fortran_hook)
|
||||||
@@ -145,342 +45,10 @@ macro (files_hook)
|
|||||||
endmacro (files_hook)
|
endmacro (files_hook)
|
||||||
|
|
||||||
macro (tests_hook)
|
macro (tests_hook)
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
include(ExtraTests.cmake)
|
|
||||||
endif()
|
|
||||||
endmacro (tests_hook)
|
endmacro (tests_hook)
|
||||||
|
|
||||||
macro (install_hook)
|
|
||||||
install(DIRECTORY ${PROJECT_BINARY_DIR}/include/
|
|
||||||
DESTINATION include
|
|
||||||
PATTERN *.hpp)
|
|
||||||
endmacro (install_hook)
|
|
||||||
|
|
||||||
# If opm-common is configured to embed the python interpreter we must make sure
|
|
||||||
# that all downstream modules link libpython transitively. Due to the required
|
|
||||||
# integration with Python+cmake machinery provided by pybind11 this is done by
|
|
||||||
# manually adding to the opm-common_LIBRARIES variable here, and not in the
|
|
||||||
# OpmnLibMain function. Here only the library dependency is implemented, the
|
|
||||||
# bulk of the python configuration is further down in the file.
|
|
||||||
if (OPM_ENABLE_PYTHON)
|
|
||||||
# We need to be compatible with older CMake versions
|
|
||||||
# that do not offer FindPython3
|
|
||||||
# e.g. Ubuntu LTS 18.04 uses cmake 3.10
|
|
||||||
if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
|
|
||||||
find_package(PythonInterp REQUIRED)
|
|
||||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
|
||||||
find_package(PythonLibs REQUIRED)
|
|
||||||
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
if(PYTHON_VERSION_MAJOR LESS 3)
|
|
||||||
message(SEND_ERROR "OPM requires version 3 of Python but only version ${PYTHON_VERSION_STRING} was found")
|
|
||||||
endif()
|
|
||||||
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
|
|
||||||
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
|
|
||||||
else()
|
|
||||||
# Be backwards compatible.
|
|
||||||
if(PYTHON_EXECUTABLE AND NOT Python3_EXECUTABLE)
|
|
||||||
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
|
|
||||||
endif()
|
|
||||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
|
||||||
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
|
|
||||||
get_target_property(_lib_path Python3::Python IMPORTED_LOCATION)
|
|
||||||
set(PYTHON_LIBRARY ${_lib_path})
|
|
||||||
set(PYTHON_LIBRARIES {PYTHON_LIBRARY})
|
|
||||||
list(APPEND opm-common_LIBRARIES ${PYTHON_LIBRARY})
|
|
||||||
set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
|
|
||||||
else()
|
|
||||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
|
||||||
endif()
|
|
||||||
# Compatibility settings for PythonInterp and PythonLibs
|
|
||||||
# used e.g. in FindCwrap, pybind11
|
|
||||||
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
|
||||||
endif()
|
|
||||||
# We always need the PYTHON_INCLUDE_DIR. Unfortunately
|
|
||||||
# When we build pypi packages CMake will fail to determine
|
|
||||||
# these via the usual find_package(PythonLibs or
|
|
||||||
# find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
|
|
||||||
# Hence we overwrite them here.
|
|
||||||
if(NOT PYTHON_INCLUDE_DIRS)
|
|
||||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "from distutils import sysconfig; print(sysconfig.get_python_inc(plat_specific=True), end=\"\");"
|
|
||||||
RESULT_VARIABLE _PYTHON_DIR_SUCCESS
|
|
||||||
OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
|
|
||||||
ERROR_VARIABLE _PYTHON_ERROR_VALUE)
|
|
||||||
if(NOT _PYTHON_DIR_SUCCESS MATCHES 0)
|
|
||||||
message(FATAL_ERROR "Could not determine Python include directory. Error: ${_PYTHON_ERROR_VALUE}.")
|
|
||||||
endif()
|
|
||||||
set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
|
|
||||||
endif()
|
|
||||||
find_package(pybind11 2.2 CONFIG)
|
|
||||||
if (NOT pybind11_FOUND)
|
|
||||||
# Use full path for reuse with pypi
|
|
||||||
set(pybind11_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/python/pybind11/include ${PYTHON_INCLUDE_DIRS})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
# all setup common to the OPM library modules is done here
|
# all setup common to the OPM library modules is done here
|
||||||
include (OpmLibMain)
|
include (OpmLibMain)
|
||||||
|
|
||||||
if (ENABLE_MOCKSIM)
|
# Install build system files
|
||||||
add_library(mocksim
|
install(DIRECTORY cmake DESTINATION share/opm)
|
||||||
msim/src/msim.cpp)
|
|
||||||
target_link_libraries(mocksim opmcommon)
|
|
||||||
target_include_directories(mocksim PUBLIC msim/include)
|
|
||||||
add_executable(msim examples/msim.cpp)
|
|
||||||
target_link_libraries(msim mocksim)
|
|
||||||
|
|
||||||
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
|
||||||
set(_libs mocksim opmcommon
|
|
||||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
|
|
||||||
|
|
||||||
foreach( test test_msim test_msim_ACTIONX test_msim_EXIT)
|
|
||||||
opm_add_test(${test} SOURCES tests/msim/${test}.cpp
|
|
||||||
LIBRARIES ${_libs}
|
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests
|
|
||||||
CONDITION ${HAVE_ECL_INPUT})
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (ENABLE_SCHEDULE_DEBUG)
|
|
||||||
add_compile_definitions( SCHEDULE_DEBUG )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Build the compare utilities
|
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
add_executable(compareECL
|
|
||||||
test_util/EclFilesComparator.cpp
|
|
||||||
test_util/EclRegressionTest.cpp
|
|
||||||
test_util/compareECL.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(convertECL
|
|
||||||
test_util/convertECL.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(summary
|
|
||||||
test_util/summary.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(rewriteEclFile
|
|
||||||
test_util/rewriteEclFile.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
foreach(target compareECL convertECL summary rewriteEclFile)
|
|
||||||
target_link_libraries(${target} opmcommon)
|
|
||||||
install(TARGETS ${target} DESTINATION bin)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
# Add the tests
|
|
||||||
set(_libs opmcommon
|
|
||||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
|
|
||||||
|
|
||||||
opm_add_test(test_EclFilesComparator
|
|
||||||
CONDITION
|
|
||||||
ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
|
|
||||||
SOURCES
|
|
||||||
tests/test_EclFilesComparator.cpp
|
|
||||||
test_util/EclFilesComparator.cpp
|
|
||||||
LIBRARIES
|
|
||||||
${_libs}
|
|
||||||
WORKING_DIRECTORY
|
|
||||||
${PROJECT_BINARY_DIR}/tests
|
|
||||||
)
|
|
||||||
|
|
||||||
opm_add_test(test_EclRegressionTest
|
|
||||||
CONDITION
|
|
||||||
ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
|
|
||||||
SOURCES
|
|
||||||
tests/test_EclRegressionTest.cpp
|
|
||||||
test_util/EclFilesComparator.cpp
|
|
||||||
test_util/EclRegressionTest.cpp
|
|
||||||
LIBRARIES
|
|
||||||
${_libs}
|
|
||||||
WORKING_DIRECTORY
|
|
||||||
${PROJECT_BINARY_DIR}/tests
|
|
||||||
)
|
|
||||||
|
|
||||||
foreach(test test_EclIO test_EGrid test_ERft test_ERst test_ESmry test_EInit test_ExtESmry)
|
|
||||||
opm_add_test(${test} CONDITION ENABLE_ECL_INPUT AND Boost_UNIT_TEST_FRAMEWORK_FOUND
|
|
||||||
LIBRARIES ${_libs}
|
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Install build system files and documentation
|
|
||||||
install(DIRECTORY cmake
|
|
||||||
DESTINATION share/opm USE_SOURCE_PERMISSIONS
|
|
||||||
PATTERN "OPM-CMake.md" EXCLUDE)
|
|
||||||
|
|
||||||
install(FILES cmake/OPM-CMake.md
|
|
||||||
DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
|
||||||
|
|
||||||
# Install tab completion skeleton
|
|
||||||
install(FILES etc/opm_bash_completion.sh.in DESTINATION share/opm/etc)
|
|
||||||
|
|
||||||
if (OPM_ENABLE_PYTHON)
|
|
||||||
# -------------------------------------------------------------------------
|
|
||||||
# 1: Wrap C++ functionality in Python
|
|
||||||
if (EXISTS "/etc/debian_version")
|
|
||||||
set(PYTHON_PACKAGE_PATH "dist-packages")
|
|
||||||
else()
|
|
||||||
set(PYTHON_PACKAGE_PATH "site-packages")
|
|
||||||
endif()
|
|
||||||
if(PYTHON_VERSION_MAJOR)
|
|
||||||
set(PY_MAJOR ${PYTHON_VERSION_MAJOR})
|
|
||||||
else()
|
|
||||||
set(PY_MAJOR ${Python3_VERSION_MAJOR})
|
|
||||||
endif()
|
|
||||||
if(PYTHON_VERSION_MINOR)
|
|
||||||
set(PY_MINOR ${PYTHON_VERSION_MINOR})
|
|
||||||
else()
|
|
||||||
set(PY_MINOR ${Python3_VERSION_MINOR})
|
|
||||||
endif()
|
|
||||||
set(PYTHON_INSTALL_PREFIX "lib/python${PY_MAJOR}.${PY_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
|
|
||||||
|
|
||||||
make_directory(${PROJECT_BINARY_DIR}/python)
|
|
||||||
get_target_property(_opmcommon_include_dirs opmcommon INCLUDE_DIRECTORIES)
|
|
||||||
list(APPEND _opmcommon_include_dirs ${_ecl_include_dirs})
|
|
||||||
string(REPLACE ";" ":" _setup_include_dirs "${_opmcommon_include_dirs}")
|
|
||||||
|
|
||||||
get_target_property(_opmcommon_lib_dirs opmcommon LINK_DIRECTORIES)
|
|
||||||
if (CMAKE_PREFIX_PATH)
|
|
||||||
list(APPEND _opmcommon_lib_dirs ${PROJECT_BINARY_DIR}/lib ${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR})
|
|
||||||
else()
|
|
||||||
list(APPEND _opmcommon_lib_dirs ${PROJECT_BINARY_DIR}/lib)
|
|
||||||
endif()
|
|
||||||
string(REPLACE ";" ":" _setup_lib_dirs "${_opmcommon_lib_dirs}")
|
|
||||||
|
|
||||||
if (USE_RUNPATH)
|
|
||||||
set (_python_rpath_list)
|
|
||||||
if (CMAKE_PREFIX_PATH)
|
|
||||||
foreach(path ${CMAKE_PREFIX_PATH})
|
|
||||||
list(APPEND _python_rpath_list "${path}/${CMAKE_INSTALL_LIBDIR}")
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (BUILD_SHARED_LIBS)
|
|
||||||
list(APPEND _python_rpath_list "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (_python_rpath_list)
|
|
||||||
string(REPLACE ";" ":" _rpath "${_python_rpath_list}")
|
|
||||||
set( _rpath_arg "--rpath=${_rpath}")
|
|
||||||
else()
|
|
||||||
set(_rpath_arg "")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set( _rpath_arg "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(opm-common_PYTHON_PACKAGE_VERSION ${OPM_PYTHON_PACKAGE_VERSION_TAG})
|
|
||||||
|
|
||||||
# Generate versioned setup.py
|
|
||||||
if (pybind11_INCLUDE_DIRS)
|
|
||||||
string(REGEX REPLACE ";" "', '" _tmp "${pybind11_INCLUDE_DIRS}")
|
|
||||||
set(SETUP_PY_PYBIND_INCLUDE_DIR "'${_tmp}'")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (TARGET fmt::fmt)
|
|
||||||
get_target_property(SETUP_PY_FMT_LIBS fmt::fmt LOCATION)
|
|
||||||
get_target_property(FMT_FLAGS fmt::fmt INTERFACE_COMPILE_DEFINITIONS)
|
|
||||||
foreach(flag ${FMT_FLAGS})
|
|
||||||
set(SETUP_PY_FMT_FLAGS "${SETUP_PY_FMT_FLAGS} '-D${flag}',")
|
|
||||||
endforeach()
|
|
||||||
list(APPEND opm-common_PYTHON_LINKAGE "'${SETUP_PY_FMT_LIBS}'")
|
|
||||||
else()
|
|
||||||
set(SETUP_PY_FMT_FLAGS "'-DFMT_HEADER_ONLY'")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
configure_file (${PROJECT_SOURCE_DIR}/python/setup.py.in ${PROJECT_BINARY_DIR}/python/setup.py)
|
|
||||||
file(COPY ${PROJECT_SOURCE_DIR}/python/README.md DESTINATION ${PROJECT_BINARY_DIR}/python)
|
|
||||||
execute_process(COMMAND ${Python3_EXECUTABLE} target_name.py
|
|
||||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python
|
|
||||||
OUTPUT_VARIABLE python_lib_target)
|
|
||||||
|
|
||||||
add_custom_target(copy_python ALL
|
|
||||||
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/python/install.py ${PROJECT_SOURCE_DIR}/python ${PROJECT_BINARY_DIR} 0)
|
|
||||||
|
|
||||||
add_custom_command(OUTPUT python/opm/${python_lib_target}
|
|
||||||
DEPENDS ${PYTHON_CXX_DEPENDS}
|
|
||||||
DEPENDS copy_python
|
|
||||||
COMMAND ${Python3_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/setup.py
|
|
||||||
build
|
|
||||||
build_ext
|
|
||||||
--build-lib=${PROJECT_BINARY_DIR}/python
|
|
||||||
--library-dirs=${_setup_lib_dirs}
|
|
||||||
${_rpath_arg}
|
|
||||||
--include-dirs=${_setup_include_dirs}
|
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
|
|
||||||
COMMENT "Building python bindings at python/opm/${python_lib_target}")
|
|
||||||
add_custom_target(opmcommon_python ALL DEPENDS python/opm/${python_lib_target})
|
|
||||||
add_dependencies(opmcommon_python opmcommon)
|
|
||||||
|
|
||||||
# The install target is based on manually copying the python file tree to the
|
|
||||||
# installation area with a small installation script 'install.py'. Would have
|
|
||||||
# preferred to use standard setup.py install, but the setup.py based solution
|
|
||||||
# refuses to install to a location which the current python executable can not
|
|
||||||
# load from, and the use of eggs in the setup.py based installation makes
|
|
||||||
# debugging quite difficult.
|
|
||||||
#
|
|
||||||
# Since the installation of Python code is nonstandard it is protected by an
|
|
||||||
# extra cmake switch, OPM_INSTALL_PYTHON. If you prefer you can still invoke
|
|
||||||
# setup.py install manually - optionally with the generated script
|
|
||||||
# setup-install.sh - and completely bypass cmake in the installation phase.
|
|
||||||
if (OPM_INSTALL_PYTHON)
|
|
||||||
install( CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${PROJECT_BINARY_DIR}/python/install.py ${PROJECT_BINARY_DIR}/python/opm ${DEST_PREFIX}${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PREFIX} 1)")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Observe that if the opmcommon library has been built as a shared library the
|
|
||||||
# python library opmcommon_python will in general not find it runtime while
|
|
||||||
# testing.
|
|
||||||
add_test(NAME python_tests
|
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/lib ${Python3_EXECUTABLE} setup.py build_ext --dry-run --build-lib ${PROJECT_BINARY_DIR}/python test
|
|
||||||
)
|
|
||||||
|
|
||||||
set_target_properties(opmcommon PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
||||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_BINARY_DIR}/python)
|
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
|
||||||
# Let cmake configure some small shell scripts which can be used to simplify
|
|
||||||
# building, testing and installation of the Python extensions.
|
|
||||||
configure_file(python/setup-build.sh.in tmp/setup-build.sh)
|
|
||||||
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-build.sh
|
|
||||||
DESTINATION ${PROJECT_BINARY_DIR}
|
|
||||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
|
|
||||||
|
|
||||||
configure_file(python/setup-package.sh.in tmp/setup-package.sh)
|
|
||||||
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-package.sh
|
|
||||||
DESTINATION ${PROJECT_BINARY_DIR}
|
|
||||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
|
|
||||||
|
|
||||||
configure_file(python/setup-test.sh.in tmp/setup-test.sh)
|
|
||||||
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-test.sh
|
|
||||||
DESTINATION ${PROJECT_BINARY_DIR}
|
|
||||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
|
|
||||||
|
|
||||||
configure_file(python/setup-install.sh.in tmp/setup-install.sh)
|
|
||||||
file( COPY ${PROJECT_BINARY_DIR}/tmp/setup-install.sh
|
|
||||||
DESTINATION ${PROJECT_BINARY_DIR}
|
|
||||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE )
|
|
||||||
|
|
||||||
configure_file(python/enable-python.sh.in enable-python.sh)
|
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
|
||||||
# 2: Embed the Python interpreter for keywords like PYACTION and PYINPUT
|
|
||||||
target_include_directories(opmcommon SYSTEM PRIVATE "${pybind11_INCLUDE_DIRS}")
|
|
||||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
|
||||||
target_link_libraries(opmcommon PUBLIC ${PYTHON_LIBRARY})
|
|
||||||
add_definitions(-DEMBEDDED_PYTHON)
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
|
||||||
message(WARNING "Inconsistent settings OPM_ENABLE_PYTHON / OPM_ENABLE_EMBEDDED_PYTHON")
|
|
||||||
set(OPM_ENABLE_EMBEDDED_PYTHON OFF CACHE BOOL "Enable embedded python?" FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
install(DIRECTORY docs/man1 DESTINATION ${CMAKE_INSTALL_MANDIR}
|
|
||||||
FILES_MATCHING PATTERN "*.1")
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# This file sets up five lists:
|
# This file sets up five lists:
|
||||||
# MAIN_SOURCE_FILES List of compilation units which will be included in
|
# MAIN_SOURCE_FILES List of compilation units which will be included in
|
||||||
# the library. If it isn't on this list, it won't be
|
# the library. If it isn't on this list, it won't be
|
||||||
# part of the library. Please try to keep it sorted to
|
# part of the library. Please try to keep it sorted to
|
||||||
# maintain sanity.
|
# maintain sanity.
|
||||||
@@ -21,577 +21,43 @@
|
|||||||
# the library needs it.
|
# the library needs it.
|
||||||
|
|
||||||
list (APPEND MAIN_SOURCE_FILES
|
list (APPEND MAIN_SOURCE_FILES
|
||||||
src/opm/common/OpmLog/CounterLog.cpp
|
opm/common/data/SimulationDataContainer.cpp
|
||||||
src/opm/common/OpmLog/EclipsePRTLog.cpp
|
opm/common/OpmLog/CounterLog.cpp
|
||||||
src/opm/common/OpmLog/LogBackend.cpp
|
opm/common/OpmLog/EclipsePRTLog.cpp
|
||||||
src/opm/common/OpmLog/Logger.cpp
|
opm/common/OpmLog/LogBackend.cpp
|
||||||
src/opm/common/OpmLog/LogUtil.cpp
|
opm/common/OpmLog/Logger.cpp
|
||||||
src/opm/common/OpmLog/KeywordLocation.cpp
|
opm/common/OpmLog/LogUtil.cpp
|
||||||
src/opm/common/OpmLog/InfoLogger.cpp
|
opm/common/OpmLog/OpmLog.cpp
|
||||||
src/opm/common/OpmLog/OpmLog.cpp
|
opm/common/OpmLog/StreamLog.cpp
|
||||||
src/opm/common/OpmLog/StreamLog.cpp
|
opm/common/OpmLog/TimerLog.cpp
|
||||||
src/opm/common/OpmLog/TimerLog.cpp
|
|
||||||
src/opm/common/utility/ActiveGridCells.cpp
|
|
||||||
src/opm/common/utility/FileSystem.cpp
|
|
||||||
src/opm/common/utility/numeric/MonotCubicInterpolator.cpp
|
|
||||||
src/opm/common/utility/OpmInputError.cpp
|
|
||||||
src/opm/common/utility/parameters/Parameter.cpp
|
|
||||||
src/opm/common/utility/parameters/ParameterGroup.cpp
|
|
||||||
src/opm/common/utility/parameters/ParameterTools.cpp
|
|
||||||
src/opm/common/utility/numeric/calculateCellVol.cpp
|
|
||||||
src/opm/common/utility/TimeService.cpp
|
|
||||||
)
|
)
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
list(APPEND MAIN_SOURCE_FILES
|
|
||||||
src/opm/io/eclipse/SummaryNode.cpp
|
|
||||||
src/opm/json/JsonObject.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/Deck.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckTree.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/FileDeck.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckItem.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckValue.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckRecord.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckOutput.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckSection.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/ImportContainer.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/UDAValue.cpp
|
|
||||||
src/opm/parser/eclipse/Python/Python.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Aquifer/AquiferConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Aquifer/AquiferCT.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Aquifer/Aquifetp.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Aquifer/Aquancon.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Aquifer/AquiferHelpers.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferConnection.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/checkDeck.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/EclipseConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/EclipseState.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/EndpointScaling.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/Box.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/BoxManager.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/FaceDir.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/FaultCollection.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/Fault.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/FaultFace.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/GridDims.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/MapAxes.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/NNC.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/Operate.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/PinchMode.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/setKeywordBox.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/TranCalculator.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Grid/TransMult.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/InitConfig/Equil.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/InitConfig/InitConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/IOConfig/IOConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Runspec.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/TracerConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/MICPpara.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Actions.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionParser.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Condition.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Enums.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/State.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/eval_uda.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GPMaint.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GConSump.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/KeywordHandlers.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/MessageLimits.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/icd.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Compsegs.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/AICD.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/SICD.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Network/Balance.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Network/Branch.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Network/ExtNetwork.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Network/Node.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/RFTConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/RPTConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/RSTConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleDeck.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleState.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/SummaryState.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Tuning.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/WriteRestartFileEvents.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Connection.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/injection.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/PAvg.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/PAvgCalculator.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/PAvgCalculatorCollection.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/NameOrder.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellMatcher.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WList.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellMICPProperties.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/SimulationConfig/BCConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/SimulationConfig/RockConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/Aqudims.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/ColumnSchema.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/DenT.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/Eqldims.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/JFunc.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/PvtxTable.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/Regdims.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/SimpleTable.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/PolyInjTables.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/StandardCond.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/TableColumn.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/TableContainer.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/TableIndex.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/TLMixpar.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/TableSchema.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/RwgsaltTable.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Tables/Tabdims.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParser.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQToken.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQState.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.cpp
|
|
||||||
src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ErrorGuard.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ParseContext.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/Parser.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ParserEnums.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ParserItem.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ParserRecord.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
|
|
||||||
src/opm/parser/eclipse/Units/Dimension.cpp
|
|
||||||
src/opm/parser/eclipse/Units/UnitSystem.cpp
|
|
||||||
src/opm/parser/eclipse/Utility/Functional.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# This list is only used to register a CMake dependency between the the python
|
|
||||||
# extension and the corresponding C++ wrapper files. The cpp files actually
|
|
||||||
# listed here are repeated in the actual definition of the extension in the
|
|
||||||
# setup.py file.
|
|
||||||
list( APPEND PYTHON_CXX_SOURCE_FILES
|
|
||||||
python/cxx/connection.cpp
|
|
||||||
python/cxx/converters.cpp
|
|
||||||
python/cxx/deck.cpp
|
|
||||||
python/cxx/deck_keyword.cpp
|
|
||||||
python/cxx/eclipse_io.cpp
|
|
||||||
python/cxx/field_props.cpp
|
|
||||||
python/cxx/eclipse_config.cpp
|
|
||||||
python/cxx/eclipse_grid.cpp
|
|
||||||
python/cxx/eclipse_state.cpp
|
|
||||||
python/cxx/emodel_util.cpp
|
|
||||||
python/cxx/export.cpp
|
|
||||||
python/cxx/group.cpp
|
|
||||||
python/cxx/log.cpp
|
|
||||||
python/cxx/parsecontext.cpp
|
|
||||||
python/cxx/parser.cpp
|
|
||||||
python/cxx/schedule.cpp
|
|
||||||
python/cxx/summary_state.cpp
|
|
||||||
python/cxx/table_manager.cpp
|
|
||||||
python/cxx/unit_system.cpp
|
|
||||||
python/cxx/well.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
if (OPM_ENABLE_EMBEDDED_PYTHON)
|
|
||||||
set_source_files_properties(${PYTHON_CXX_SOURCE_FILES} PROPERTIES COMPILE_FLAGS -Wno-shadow)
|
|
||||||
set_source_files_properties(src/opm/parser/eclipse/Python/PythonInterp.cpp PROPERTIES COMPILE_FLAGS -Wno-shadow)
|
|
||||||
set_source_files_properties(src/opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.cpp PROPERTIES COMPILE_FLAGS -Wno-shadow)
|
|
||||||
list( APPEND MAIN_SOURCE_FILES
|
|
||||||
src/opm/parser/eclipse/Python/PythonInterp.cpp
|
|
||||||
src/opm/parser/eclipse/Python/PyRunModule.cpp
|
|
||||||
${PYTHON_CXX_SOURCE_FILES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
list( APPEND PYTHON_CXX_DEPENDS ${PYTHON_CXX_SOURCE_FILES}
|
|
||||||
python/cxx/converters.hpp
|
|
||||||
python/cxx/export.hpp)
|
|
||||||
|
|
||||||
if(NOT cjson_FOUND)
|
|
||||||
list(APPEND MAIN_SOURCE_FILES external/cjson/cJSON.c)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(ENABLE_ECL_OUTPUT)
|
|
||||||
list( APPEND MAIN_SOURCE_FILES
|
|
||||||
src/opm/io/eclipse/EclFile.cpp
|
|
||||||
src/opm/io/eclipse/EclOutput.cpp
|
|
||||||
src/opm/io/eclipse/EclUtil.cpp
|
|
||||||
src/opm/io/eclipse/EGrid.cpp
|
|
||||||
src/opm/io/eclipse/EInit.cpp
|
|
||||||
src/opm/io/eclipse/ERft.cpp
|
|
||||||
src/opm/io/eclipse/ERst.cpp
|
|
||||||
src/opm/io/eclipse/ERsm.cpp
|
|
||||||
src/opm/io/eclipse/ESmry.cpp
|
|
||||||
src/opm/io/eclipse/ExtESmry.cpp
|
|
||||||
src/opm/io/eclipse/ESmry_write_rsm.cpp
|
|
||||||
src/opm/io/eclipse/OutputStream.cpp
|
|
||||||
src/opm/io/eclipse/ExtSmryOutput.cpp
|
|
||||||
src/opm/io/eclipse/RestartFileView.cpp
|
|
||||||
src/opm/io/eclipse/SummaryNode.cpp
|
|
||||||
src/opm/io/eclipse/rst/action.cpp
|
|
||||||
src/opm/io/eclipse/rst/aquifer.cpp
|
|
||||||
src/opm/io/eclipse/rst/connection.cpp
|
|
||||||
src/opm/io/eclipse/rst/group.cpp
|
|
||||||
src/opm/io/eclipse/rst/header.cpp
|
|
||||||
src/opm/io/eclipse/rst/udq.cpp
|
|
||||||
src/opm/io/eclipse/rst/segment.cpp
|
|
||||||
src/opm/io/eclipse/rst/state.cpp
|
|
||||||
src/opm/io/eclipse/rst/well.cpp
|
|
||||||
src/opm/output/eclipse/ActiveIndexByColumns.cpp
|
|
||||||
src/opm/output/eclipse/AggregateActionxData.cpp
|
|
||||||
src/opm/output/eclipse/AggregateAquiferData.cpp
|
|
||||||
src/opm/output/eclipse/AggregateConnectionData.cpp
|
|
||||||
src/opm/output/eclipse/AggregateGroupData.cpp
|
|
||||||
src/opm/output/eclipse/AggregateNetworkData.cpp
|
|
||||||
src/opm/output/eclipse/AggregateMSWData.cpp
|
|
||||||
src/opm/output/eclipse/AggregateUDQData.cpp
|
|
||||||
src/opm/output/eclipse/AggregateWellData.cpp
|
|
||||||
src/opm/output/eclipse/AggregateWListData.cpp
|
|
||||||
src/opm/output/eclipse/CreateActionRSTDims.cpp
|
|
||||||
src/opm/output/eclipse/CreateDoubHead.cpp
|
|
||||||
src/opm/output/eclipse/CreateInteHead.cpp
|
|
||||||
src/opm/output/eclipse/CreateLogiHead.cpp
|
|
||||||
src/opm/output/eclipse/CreateUdqDims.cpp
|
|
||||||
src/opm/output/eclipse/DoubHEAD.cpp
|
|
||||||
src/opm/output/eclipse/EclipseGridInspector.cpp
|
|
||||||
src/opm/output/eclipse/EclipseIO.cpp
|
|
||||||
src/opm/output/eclipse/InteHEAD.cpp
|
|
||||||
src/opm/output/eclipse/LinearisedOutputTable.cpp
|
|
||||||
src/opm/output/eclipse/LoadRestart.cpp
|
|
||||||
src/opm/output/eclipse/LogiHEAD.cpp
|
|
||||||
src/opm/output/eclipse/RestartIO.cpp
|
|
||||||
src/opm/output/eclipse/Inplace.cpp
|
|
||||||
src/opm/output/eclipse/Summary.cpp
|
|
||||||
src/opm/output/eclipse/Tables.cpp
|
|
||||||
src/opm/output/eclipse/UDQDims.cpp
|
|
||||||
src/opm/output/eclipse/RegionCache.cpp
|
|
||||||
src/opm/output/eclipse/RestartValue.cpp
|
|
||||||
src/opm/output/eclipse/WriteInit.cpp
|
|
||||||
src/opm/output/eclipse/WriteRFT.cpp
|
|
||||||
src/opm/output/eclipse/WriteRPT.cpp
|
|
||||||
src/opm/output/eclipse/report/WELSPECS.cpp
|
|
||||||
src/opm/output/data/Aquifer.cpp
|
|
||||||
src/opm/output/data/Solution.cpp
|
|
||||||
src/opm/utility/EModel.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
list (APPEND TEST_SOURCE_FILES
|
list (APPEND TEST_SOURCE_FILES
|
||||||
tests/test_ActiveGridCells.cpp
|
tests/test_SimulationDataContainer.cpp
|
||||||
tests/test_calculateCellVol.cpp
|
|
||||||
tests/test_cmp.cpp
|
tests/test_cmp.cpp
|
||||||
tests/test_cubic.cpp
|
|
||||||
tests/test_FileSystem.cpp
|
|
||||||
tests/test_messagelimiter.cpp
|
|
||||||
tests/test_nonuniformtablelinear.cpp
|
|
||||||
tests/test_OpmInputError_format.cpp
|
|
||||||
tests/test_OpmLog.cpp
|
tests/test_OpmLog.cpp
|
||||||
tests/test_param.cpp
|
tests/test_messagelimiter.cpp
|
||||||
tests/test_RootFinders.cpp
|
|
||||||
tests/test_sparsevector.cpp
|
|
||||||
tests/test_uniformtablelinear.cpp
|
|
||||||
)
|
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
list(APPEND TEST_SOURCE_FILES
|
|
||||||
tests/rst_test.cpp
|
|
||||||
tests/test_ERsm.cpp
|
|
||||||
tests/test_GuideRate.cpp
|
|
||||||
tests/test_RestartFileView.cpp
|
|
||||||
tests/parser/ACTIONX.cpp
|
|
||||||
tests/parser/ADDREGTests.cpp
|
|
||||||
tests/parser/AquiferTests.cpp
|
|
||||||
tests/parser/BoxTests.cpp
|
|
||||||
tests/parser/ColumnSchemaTests.cpp
|
|
||||||
tests/parser/ConnectionTests.cpp
|
|
||||||
tests/parser/COMPSEGUnits.cpp
|
|
||||||
tests/parser/CopyRegTests.cpp
|
|
||||||
tests/parser/DeckValueTests.cpp
|
|
||||||
tests/parser/DeckTests.cpp
|
|
||||||
tests/parser/EclipseGridTests.cpp
|
|
||||||
tests/parser/EmbeddedPython.cpp
|
|
||||||
tests/parser/EqualRegTests.cpp
|
|
||||||
tests/parser/EventTests.cpp
|
|
||||||
tests/parser/FaceDirTests.cpp
|
|
||||||
tests/parser/FaultTests.cpp
|
|
||||||
tests/parser/FieldPropsTests.cpp
|
|
||||||
tests/parser/FoamTests.cpp
|
|
||||||
tests/parser/FunctionalTests.cpp
|
|
||||||
tests/parser/GeomodifierTests.cpp
|
|
||||||
tests/parser/GroupTests.cpp
|
|
||||||
tests/parser/ImportTests.cpp
|
|
||||||
tests/parser/InitConfigTest.cpp
|
|
||||||
tests/parser/IOConfigTests.cpp
|
|
||||||
tests/parser/MICPTests.cpp
|
|
||||||
tests/parser/MessageLimitTests.cpp
|
|
||||||
tests/parser/MultiRegTests.cpp
|
|
||||||
tests/parser/MultisegmentWellTests.cpp
|
|
||||||
tests/parser/MULTREGTScannerTests.cpp
|
|
||||||
tests/parser/NetworkTests.cpp
|
|
||||||
tests/parser/OrderedMapTests.cpp
|
|
||||||
tests/parser/ParseContextTests.cpp
|
|
||||||
tests/parser/ParseContext_EXIT1.cpp
|
|
||||||
tests/parser/ParseDATAWithDefault.cpp
|
|
||||||
tests/parser/PAvgTests.cpp
|
|
||||||
tests/parser/PYACTION.cpp
|
|
||||||
tests/parser/RawKeywordTests.cpp
|
|
||||||
tests/parser/test_ReportConfig.cpp
|
|
||||||
tests/parser/ResinsightTest.cpp
|
|
||||||
tests/parser/RestartConfigTests.cpp
|
|
||||||
tests/parser/RFTConfigTests.cpp
|
|
||||||
tests/parser/RockTableTests.cpp
|
|
||||||
tests/parser/RunspecTests.cpp
|
|
||||||
tests/parser/SaltTableTests.cpp
|
|
||||||
tests/parser/ScheduleSerializeTest.cpp
|
|
||||||
tests/parser/ScheduleRestartTests.cpp
|
|
||||||
tests/parser/ScheduleTests.cpp
|
|
||||||
tests/parser/SectionTests.cpp
|
|
||||||
tests/parser/SimpleTableTests.cpp
|
|
||||||
tests/parser/SimulationConfigTest.cpp
|
|
||||||
tests/parser/StarTokenTests.cpp
|
|
||||||
tests/parser/StringTests.cpp
|
|
||||||
tests/parser/SummaryConfigTests.cpp
|
|
||||||
tests/parser/TabdimsTests.cpp
|
|
||||||
tests/parser/TableColumnTests.cpp
|
|
||||||
tests/parser/TableContainerTests.cpp
|
|
||||||
tests/parser/TableManagerTests.cpp
|
|
||||||
tests/parser/TableSchemaTests.cpp
|
|
||||||
tests/parser/ThresholdPressureTest.cpp
|
|
||||||
tests/parser/TracerTests.cpp
|
|
||||||
tests/parser/TransMultTests.cpp
|
|
||||||
tests/parser/TuningTests.cpp
|
|
||||||
tests/parser/UDQTests.cpp
|
|
||||||
tests/parser/UnitTests.cpp
|
|
||||||
tests/parser/integration/NNCTests.cpp
|
|
||||||
tests/parser/WellSolventTests.cpp
|
|
||||||
tests/parser/WellTracerTests.cpp
|
|
||||||
tests/parser/WellTests.cpp
|
|
||||||
tests/parser/WLIST.cpp
|
|
||||||
tests/parser/WriteRestartFileEventsTests.cpp
|
|
||||||
tests/parser/WTEST.cpp)
|
|
||||||
endif()
|
|
||||||
if(ENABLE_ECL_OUTPUT)
|
|
||||||
list (APPEND TEST_SOURCE_FILES
|
|
||||||
tests/test_ActiveIndexByColumns.cpp
|
|
||||||
tests/test_AggregateActionxData.cpp
|
|
||||||
tests/test_AggregateAquiferData.cpp
|
|
||||||
tests/test_AggregateWellData.cpp
|
|
||||||
tests/test_AggregateGroupData.cpp
|
|
||||||
tests/test_AggregateNetworkData.cpp
|
|
||||||
tests/test_AggregateWListData.cpp
|
|
||||||
tests/test_AggregateMSWData.cpp
|
|
||||||
tests/test_AggregateConnectionData.cpp
|
|
||||||
tests/test_AggregateUDQData.cpp
|
|
||||||
tests/test_ArrayDimChecker.cpp
|
|
||||||
tests/test_data_GuideRateValue.cpp
|
|
||||||
tests/test_EclipseIO.cpp
|
|
||||||
tests/test_DoubHEAD.cpp
|
|
||||||
tests/test_InteHEAD.cpp
|
|
||||||
tests/test_LinearisedOutputTable.cpp
|
|
||||||
tests/test_LogiHEAD.cpp
|
|
||||||
tests/test_LGOData.cpp
|
|
||||||
tests/test_OutputStream.cpp
|
|
||||||
tests/test_regionCache.cpp
|
|
||||||
tests/test_PaddedOutputString.cpp
|
|
||||||
tests/test_Restart.cpp
|
|
||||||
tests/test_RFT.cpp
|
|
||||||
tests/test_rst.cpp
|
|
||||||
tests/test_Solution.cpp
|
|
||||||
tests/test_Serializer.cpp
|
|
||||||
tests/test_Inplace.cpp
|
|
||||||
tests/test_Summary.cpp
|
|
||||||
tests/test_Summary_Group.cpp
|
|
||||||
tests/test_Tables.cpp
|
|
||||||
tests/test_Wells.cpp
|
|
||||||
tests/test_WindowedArray.cpp
|
|
||||||
tests/test_restartwellinfo.cpp
|
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
|
|
||||||
list (APPEND TEST_DATA_FILES
|
list (APPEND TEST_DATA_FILES
|
||||||
tests/testdata.param
|
)
|
||||||
)
|
|
||||||
if(ENABLE_ECL_OUTPUT)
|
|
||||||
list (APPEND TEST_DATA_FILES
|
|
||||||
tests/GDFILE_NO_ACTNUM.DATA
|
|
||||||
tests/EGRID_NO_ACTNUM.FEGRID
|
|
||||||
tests/BASE_SIM.DATA
|
|
||||||
tests/BASE_SIM_THPRES.DATA
|
|
||||||
tests/RESTART_SIM.DATA
|
|
||||||
tests/summary_deck.DATA
|
|
||||||
tests/group_group.DATA
|
|
||||||
tests/testblackoilstate3.DATA
|
|
||||||
tests/testrft.DATA
|
|
||||||
tests/table_deck.DATA
|
|
||||||
tests/summary_deck_non_constant_porosity.DATA
|
|
||||||
tests/SUMMARY_EFF_FAC.DATA
|
|
||||||
tests/SPE1CASE1.DATA
|
|
||||||
tests/SPE1CASE1_RPTONLY.DATA
|
|
||||||
tests/SPE1CASE1_SUMTHIN.DATA
|
|
||||||
tests/SPE1CASE1.SMSPEC
|
|
||||||
tests/SPE1CASE1A.SMSPEC
|
|
||||||
tests/SPE1CASE1B.DATA
|
|
||||||
tests/props_spe1case1b.inc
|
|
||||||
tests/SPE9_CP_PACKED.DATA
|
|
||||||
tests/SOFR_TEST.DATA
|
|
||||||
tests/UDQ_BASE.DATA
|
|
||||||
tests/UDQ_RESTART.DATA
|
|
||||||
tests/UDQ_ACTIONX.X0007
|
|
||||||
tests/UDQ_ACTIONX.DATA
|
|
||||||
tests/UDQ_ACTIONX_RESTART.DATA
|
|
||||||
tests/UDQ_TEST_WCONPROD_IUAD-2.DATA
|
|
||||||
tests/9_4C_WINJ_GINJ_UDQ_MSW-UDARATE_TEST_PACK.DATA
|
|
||||||
tests/UDQ_ACTIONX_TEST1.DATA
|
|
||||||
tests/UDQ_ACTIONX_TEST1_U.DATA
|
|
||||||
tests/TEST_AGGREGATE_MSW.DATA
|
|
||||||
tests/include_example_pvt.txt
|
|
||||||
tests/include_example_summary.txt
|
|
||||||
tests/include_sgof.txt
|
|
||||||
tests/include_swof.txt
|
|
||||||
tests/include_grid_3x5x4.grdecl
|
|
||||||
tests/SPE1CASE2.DATA
|
|
||||||
tests/SPE1CASE2_RESTART.DATA
|
|
||||||
tests/SPE1CASE2_RESTART_SKIPREST.DATA
|
|
||||||
tests/SPE1CASE2.X0060
|
|
||||||
tests/PYACTION.DATA
|
|
||||||
tests/0A4_GRCTRL_LRAT_LRAT_GGR_BASE_MODEL2_MSW_ALL.DATA
|
|
||||||
tests/MOD4_TEST_IGRP-DATA.DATA
|
|
||||||
tests/2_WLIFT_MODEL5_NOINC.DATA
|
|
||||||
tests/TEST_NETWORK_ALL.DATA
|
|
||||||
tests/TEST_WLIST.DATA
|
|
||||||
tests/act1.py
|
|
||||||
tests/MSW.DATA
|
|
||||||
tests/MSW_2WELSEGS.DATA
|
|
||||||
tests/EXIT_TEST.DATA
|
|
||||||
tests/action_syntax_error.py
|
|
||||||
tests/action_missing_run.py
|
|
||||||
tests/EMBEDDED_PYTHON.DATA
|
|
||||||
tests/wclose.py
|
|
||||||
tests/msim/MSIM_PYACTION.DATA
|
|
||||||
tests/msim/action1.py
|
|
||||||
tests/msim/action2.py
|
|
||||||
tests/VFP_CASE.DATA)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
list (APPEND EXAMPLE_SOURCE_FILES
|
list (APPEND EXAMPLE_SOURCE_FILES
|
||||||
)
|
)
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
list (APPEND TEST_DATA_FILES
|
|
||||||
tests/ECLFILE.INIT
|
|
||||||
tests/ECLFILE.FINIT
|
|
||||||
tests/LGR_TESTMOD.EGRID
|
|
||||||
tests/LGR_TESTMOD.INIT
|
|
||||||
tests/LGR_TESTMOD.UNRST
|
|
||||||
tests/LGR_TESTMOD.X0002
|
|
||||||
tests/MODEL1_IX.INIT
|
|
||||||
tests/MODEL1_IX.SMSPEC
|
|
||||||
tests/MODEL1_IX.UNSMRY
|
|
||||||
tests/SPE1CASE1.EGRID
|
|
||||||
tests/SPE1CASE1.RFT
|
|
||||||
tests/SPE1_TESTCASE.UNRST
|
|
||||||
tests/SPE1_TESTCASE.FUNRST
|
|
||||||
tests/SPE1_TESTCASE.F0025
|
|
||||||
tests/SPE1_TESTCASE.X0025
|
|
||||||
tests/SPE1CASE1.UNSMRY
|
|
||||||
tests/SPE1CASE1A.UNSMRY
|
|
||||||
tests/SPE1CASE1_RST60.SMSPEC
|
|
||||||
tests/SPE1CASE1_RST60.UNSMRY
|
|
||||||
tests/SPE1CASE1_RST60.ESMRY
|
|
||||||
tests/MODEL2_RESTART.DATA
|
|
||||||
tests/restart/MODEL2.UNRST
|
|
||||||
tests/UDQ_WCONPROD.DATA
|
|
||||||
tests/UDQ_WCONPROD_GRID.grdecl
|
|
||||||
tests/UDQ_WCONPROD_RESTART.DATA
|
|
||||||
tests/UDQ_WCONPROD.X0006
|
|
||||||
)
|
|
||||||
list (APPEND EXAMPLE_SOURCE_FILES
|
|
||||||
examples/opmi.cpp
|
|
||||||
examples/opmpack.cpp
|
|
||||||
examples/opmhash.cpp
|
|
||||||
examples/rst_deck.cpp
|
|
||||||
examples/wellgraph.cpp
|
|
||||||
examples/make_ext_smry.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# programs listed here will not only be compiled, but also marked for
|
# programs listed here will not only be compiled, but also marked for
|
||||||
# installation
|
# installation
|
||||||
list (APPEND PROGRAM_SOURCE_FILES
|
list (APPEND PROGRAM_SOURCE_FILES
|
||||||
)
|
)
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
list (APPEND PROGRAM_SOURCE_FILES
|
|
||||||
examples/opmi.cpp
|
|
||||||
examples/opmpack.cpp
|
|
||||||
examples/opmhash.cpp
|
|
||||||
examples/rst_deck.cpp
|
|
||||||
examples/make_esmry.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
list( APPEND PUBLIC_HEADER_FILES
|
list( APPEND PUBLIC_HEADER_FILES
|
||||||
opm/common/ErrorMacros.hpp
|
opm/common/ErrorMacros.hpp
|
||||||
opm/common/Exceptions.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/CounterLog.hpp
|
||||||
opm/common/OpmLog/EclipsePRTLog.hpp
|
opm/common/OpmLog/EclipsePRTLog.hpp
|
||||||
opm/common/OpmLog/LogBackend.hpp
|
opm/common/OpmLog/LogBackend.hpp
|
||||||
@@ -599,360 +65,9 @@ list( APPEND PUBLIC_HEADER_FILES
|
|||||||
opm/common/OpmLog/LogUtil.hpp
|
opm/common/OpmLog/LogUtil.hpp
|
||||||
opm/common/OpmLog/MessageFormatter.hpp
|
opm/common/OpmLog/MessageFormatter.hpp
|
||||||
opm/common/OpmLog/MessageLimiter.hpp
|
opm/common/OpmLog/MessageLimiter.hpp
|
||||||
opm/common/OpmLog/KeywordLocation.hpp
|
|
||||||
opm/common/OpmLog/InfoLogger.hpp
|
|
||||||
opm/common/OpmLog/OpmLog.hpp
|
opm/common/OpmLog/OpmLog.hpp
|
||||||
opm/common/OpmLog/StreamLog.hpp
|
opm/common/OpmLog/StreamLog.hpp
|
||||||
opm/common/OpmLog/TimerLog.hpp
|
opm/common/OpmLog/TimerLog.hpp
|
||||||
opm/common/utility/Serializer.hpp
|
opm/common/util/numeric/cmp.hpp
|
||||||
opm/common/utility/ActiveGridCells.hpp
|
|
||||||
opm/common/utility/FileSystem.hpp
|
|
||||||
opm/common/utility/OpmInputError.hpp
|
|
||||||
opm/common/utility/numeric/cmp.hpp
|
|
||||||
opm/common/utility/platform_dependent/disable_warnings.h
|
opm/common/utility/platform_dependent/disable_warnings.h
|
||||||
opm/common/utility/platform_dependent/reenable_warnings.h
|
opm/common/utility/platform_dependent/reenable_warnings.h)
|
||||||
opm/common/utility/numeric/blas_lapack.h
|
|
||||||
opm/common/utility/numeric/buildUniformMonotoneTable.hpp
|
|
||||||
opm/common/utility/numeric/linearInterpolation.hpp
|
|
||||||
opm/common/utility/numeric/MonotCubicInterpolator.hpp
|
|
||||||
opm/common/utility/numeric/NonuniformTableLinear.hpp
|
|
||||||
opm/common/utility/numeric/RootFinders.hpp
|
|
||||||
opm/common/utility/numeric/SparseVector.hpp
|
|
||||||
opm/common/utility/numeric/UniformTableLinear.hpp
|
|
||||||
opm/common/utility/parameters/ParameterGroup.hpp
|
|
||||||
opm/common/utility/parameters/ParameterGroup_impl.hpp
|
|
||||||
opm/common/utility/parameters/Parameter.hpp
|
|
||||||
opm/common/utility/parameters/ParameterMapItem.hpp
|
|
||||||
opm/common/utility/parameters/ParameterRequirement.hpp
|
|
||||||
opm/common/utility/parameters/ParameterStrings.hpp
|
|
||||||
opm/common/utility/parameters/ParameterTools.hpp
|
|
||||||
opm/common/utility/numeric/calculateCellVol.hpp
|
|
||||||
opm/common/utility/String.hpp
|
|
||||||
opm/common/utility/TimeService.hpp
|
|
||||||
)
|
|
||||||
if(ENABLE_ECL_INPUT)
|
|
||||||
list(APPEND PUBLIC_HEADER_FILES
|
|
||||||
opm/io/eclipse/SummaryNode.hpp
|
|
||||||
opm/json/JsonObject.hpp
|
|
||||||
opm/parser/eclipse/Utility/Functional.hpp
|
|
||||||
opm/parser/eclipse/Utility/Typetools.hpp
|
|
||||||
opm/parser/eclipse/Generator/KeywordGenerator.hpp
|
|
||||||
opm/parser/eclipse/Generator/KeywordLoader.hpp
|
|
||||||
opm/parser/eclipse/Units/UnitSystem.hpp
|
|
||||||
opm/parser/eclipse/Units/Units.hpp
|
|
||||||
opm/parser/eclipse/Units/Dimension.hpp
|
|
||||||
opm/parser/eclipse/Parser/ErrorGuard.hpp
|
|
||||||
opm/parser/eclipse/Parser/ParserItem.hpp
|
|
||||||
opm/parser/eclipse/Parser/Parser.hpp
|
|
||||||
opm/parser/eclipse/Parser/ParserRecord.hpp
|
|
||||||
opm/parser/eclipse/Parser/ParserKeyword.hpp
|
|
||||||
opm/parser/eclipse/Parser/InputErrorAction.hpp
|
|
||||||
opm/parser/eclipse/Parser/ParserEnums.hpp
|
|
||||||
opm/parser/eclipse/Parser/ParseContext.hpp
|
|
||||||
opm/parser/eclipse/Parser/ParserConst.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/InitConfig/Equil.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/InitConfig/FoamConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Util/IOrderSet.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Util/OrderedMap.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/FieldData.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/Keywords.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/GridDims.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/TranCalculator.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/TransMult.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/PinchMode.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/MULTREGTScanner.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/FaultCollection.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/Fault.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/Box.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/FaultFace.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/NNC.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/BoxManager.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/MapAxes.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Grid/MinpvMode.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/EndpointScaling.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/TracerConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/MICPpara.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/DenT.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SimpleTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/StandardCond.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PolyInjTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PdvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/TlpmixpaTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PvdgTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/MsfnTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/GasvisctTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/Regdims.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SpecrockTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PermfactTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/RwgsaltTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SaltpvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PlydhflfTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PlymwinjTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/RsvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SkprwatTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SkprpolyTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SpecheatTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SgcwmisTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/Sof2Table.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/TLMixpar.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/TableManager.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SwfnTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/EnptvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SwofTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/Aqudims.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/JFunc.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/TableIndex.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PvtgTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PvtgwTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PvtgwoTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/Tabdims.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/TableSchema.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/RocktabTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/EnkrvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PlyrockTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PvtxTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/WatvisctTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/TableEnums.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/RvvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/TableContainer.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/AqutabTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PlyadsTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/FoamadsTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PbvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SorwmisTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PlymaxTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PlyviscTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/TableColumn.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SsfnTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PvdoTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/OilvisctTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SgfnTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/MiscTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SgwfnTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PvdsTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PvtsolTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/Rock2dTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/RockwnodTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/OverburdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/ColumnSchema.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/PmiscTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/RtempvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SlgofTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/ImptvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/ImkrvdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/Sof3Table.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/SgofTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Tables/TracerVdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/EclipseState.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/EclipseConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Aquifer/Aquancon.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Aquifer/AquiferConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Aquifer/AquiferCT.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Aquifer/Aquifetp.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferConnection.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionValue.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/ActionX.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/Condition.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/Enums.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/PyAction.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Action/State.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Network/Balance.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Network/Branch.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Network/ExtNetwork.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Network/Node.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/ProductionControls.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/InjectionControls.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/PAvg.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/PAvgCalculator.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/PAvgCalculatorCollection.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/NameOrder.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellMatcher.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellMICPProperties.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/RPTConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/RSTConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/ScheduleDeck.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/ScheduleState.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/WriteRestartFileEvents.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Group/GPMaint.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Group/GConSump.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/Events.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/MSW/icd.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/MSW/AICD.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/MSW/SICD.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/SimulationConfig/BCConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/SimulationConfig/RockConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/MSW/Valve.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/checkDeck.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Runspec.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQState.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQToken.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.hpp
|
|
||||||
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp
|
|
||||||
opm/parser/eclipse/Deck/DeckItem.hpp
|
|
||||||
opm/parser/eclipse/Deck/Deck.hpp
|
|
||||||
opm/parser/eclipse/Deck/FileDeck.hpp
|
|
||||||
opm/parser/eclipse/Deck/DeckSection.hpp
|
|
||||||
opm/parser/eclipse/Deck/DeckTree.hpp
|
|
||||||
opm/parser/eclipse/Deck/DeckOutput.hpp
|
|
||||||
opm/parser/eclipse/Deck/DeckValue.hpp
|
|
||||||
opm/parser/eclipse/Deck/DeckKeyword.hpp
|
|
||||||
opm/parser/eclipse/Deck/DeckRecord.hpp
|
|
||||||
opm/parser/eclipse/Deck/ImportContainer.hpp
|
|
||||||
opm/parser/eclipse/Deck/UDAValue.hpp
|
|
||||||
opm/parser/eclipse/Deck/value_status.hpp
|
|
||||||
opm/parser/eclipse/Python/Python.hpp)
|
|
||||||
endif()
|
|
||||||
if(ENABLE_ECL_OUTPUT)
|
|
||||||
list(APPEND PUBLIC_HEADER_FILES
|
|
||||||
opm/io/eclipse/EclFile.hpp
|
|
||||||
opm/io/eclipse/EclIOdata.hpp
|
|
||||||
opm/io/eclipse/EclOutput.hpp
|
|
||||||
opm/io/eclipse/EclUtil.hpp
|
|
||||||
opm/io/eclipse/EGrid.hpp
|
|
||||||
opm/io/eclipse/EInit.hpp
|
|
||||||
opm/io/eclipse/ERft.hpp
|
|
||||||
opm/io/eclipse/ERst.hpp
|
|
||||||
opm/io/eclipse/ERsm.hpp
|
|
||||||
opm/io/eclipse/ESmry.hpp
|
|
||||||
opm/io/eclipse/ExtESmry.hpp
|
|
||||||
opm/io/eclipse/PaddedOutputString.hpp
|
|
||||||
opm/io/eclipse/OutputStream.hpp
|
|
||||||
opm/io/eclipse/ExtSmryOutput.hpp
|
|
||||||
opm/io/eclipse/RestartFileView.hpp
|
|
||||||
opm/io/eclipse/SummaryNode.hpp
|
|
||||||
opm/io/eclipse/rst/action.hpp
|
|
||||||
opm/io/eclipse/rst/aquifer.hpp
|
|
||||||
opm/io/eclipse/rst/connection.hpp
|
|
||||||
opm/io/eclipse/rst/group.hpp
|
|
||||||
opm/io/eclipse/rst/header.hpp
|
|
||||||
opm/io/eclipse/rst/segment.hpp
|
|
||||||
opm/io/eclipse/rst/state.hpp
|
|
||||||
opm/io/eclipse/rst/udq.hpp
|
|
||||||
opm/io/eclipse/rst/well.hpp
|
|
||||||
opm/output/data/Aquifer.hpp
|
|
||||||
opm/output/data/Cells.hpp
|
|
||||||
opm/output/data/GuideRateValue.hpp
|
|
||||||
opm/output/data/Groups.hpp
|
|
||||||
opm/output/data/Solution.hpp
|
|
||||||
opm/output/data/Wells.hpp
|
|
||||||
opm/output/eclipse/VectorItems/action.hpp
|
|
||||||
opm/output/eclipse/VectorItems/aquifer.hpp
|
|
||||||
opm/output/eclipse/VectorItems/connection.hpp
|
|
||||||
opm/output/eclipse/VectorItems/group.hpp
|
|
||||||
opm/output/eclipse/VectorItems/network.hpp
|
|
||||||
opm/output/eclipse/VectorItems/intehead.hpp
|
|
||||||
opm/output/eclipse/VectorItems/logihead.hpp
|
|
||||||
opm/output/eclipse/VectorItems/msw.hpp
|
|
||||||
opm/output/eclipse/VectorItems/tabdims.hpp
|
|
||||||
opm/output/eclipse/VectorItems/well.hpp
|
|
||||||
opm/output/eclipse/ActiveIndexByColumns.hpp
|
|
||||||
opm/output/eclipse/AggregateActionxData.hpp
|
|
||||||
opm/output/eclipse/AggregateAquiferData.hpp
|
|
||||||
opm/output/eclipse/AggregateGroupData.hpp
|
|
||||||
opm/output/eclipse/AggregateNetworkData.hpp
|
|
||||||
opm/output/eclipse/AggregateConnectionData.hpp
|
|
||||||
opm/output/eclipse/AggregateMSWData.hpp
|
|
||||||
opm/output/eclipse/AggregateUDQData.hpp
|
|
||||||
opm/output/eclipse/AggregateWellData.hpp
|
|
||||||
opm/output/eclipse/AggregateWListData.hpp
|
|
||||||
opm/output/eclipse/DoubHEAD.hpp
|
|
||||||
opm/output/eclipse/EclipseGridInspector.hpp
|
|
||||||
opm/output/eclipse/EclipseIO.hpp
|
|
||||||
opm/output/eclipse/EclipseIOUtil.hpp
|
|
||||||
opm/output/eclipse/InteHEAD.hpp
|
|
||||||
opm/output/eclipse/LinearisedOutputTable.hpp
|
|
||||||
opm/output/eclipse/LogiHEAD.hpp
|
|
||||||
opm/output/eclipse/RegionCache.hpp
|
|
||||||
opm/output/eclipse/RestartIO.hpp
|
|
||||||
opm/output/eclipse/RestartValue.hpp
|
|
||||||
opm/output/eclipse/Inplace.hpp
|
|
||||||
opm/output/eclipse/Summary.hpp
|
|
||||||
opm/output/eclipse/Tables.hpp
|
|
||||||
opm/output/eclipse/UDQDims.hpp
|
|
||||||
opm/output/eclipse/WindowedArray.hpp
|
|
||||||
opm/output/eclipse/WriteInit.hpp
|
|
||||||
opm/output/eclipse/WriteRFT.hpp
|
|
||||||
opm/output/eclipse/WriteRPT.hpp
|
|
||||||
opm/output/eclipse/WriteRestartHelpers.hpp
|
|
||||||
opm/output/OutputWriter.hpp
|
|
||||||
opm/utility/EModel.hpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_ECL_INPUT OR ENABLE_ECL_OUTPUT)
|
|
||||||
list(APPEND TEST_SOURCE_FILES
|
|
||||||
tests/test_SummaryNode.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
${BASE_DIR}/tmp_gen/ParserInit.cpp
|
|
||||||
${BASE_DIR}/ParserInit.cpp)
|
|
||||||
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
${BASE_DIR}/tmp_gen/TestKeywords.cpp
|
|
||||||
${BASE_DIR}/TestKeywords.cpp)
|
|
||||||
|
|
||||||
if (EXISTS ${BASE_DIR}/python/cxx)
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
${BASE_DIR}/tmp_gen/builtin_pybind11.cpp
|
|
||||||
${BASE_DIR}/python/cxx/builtin_pybind11.cpp)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords/Builtin.hpp
|
|
||||||
${BASE_DIR}/include/opm/parser/eclipse/Parser/ParserKeywords/Builtin.hpp)
|
|
||||||
|
|
||||||
|
|
||||||
file(GLOB HDRS ${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords/*.hpp)
|
|
||||||
|
|
||||||
foreach(HDR ${HDRS})
|
|
||||||
file(RELATIVE_PATH hdr ${BASE_DIR}/tmp_gen/include/opm/parser/eclipse/Parser/ParserKeywords ${HDR})
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
${HDR}
|
|
||||||
${BASE_DIR}/include/opm/parser/eclipse/Parser/ParserKeywords/${hdr})
|
|
||||||
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
foreach (name A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
${BASE_DIR}/tmp_gen/ParserKeywords/${name}.cpp
|
|
||||||
${BASE_DIR}/ParserKeywords/${name}.cpp)
|
|
||||||
endforeach()
|
|
||||||
139
ExtraTests.cmake
139
ExtraTests.cmake
@@ -1,139 +0,0 @@
|
|||||||
# Libs to link tests against
|
|
||||||
set(TEST_LIBS opmcommon Boost::unit_test_framework)
|
|
||||||
set(EXTRA_TESTS)
|
|
||||||
|
|
||||||
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
|
||||||
|
|
||||||
# Generated source, needs to be here
|
|
||||||
opm_add_test(InlineKeywordTest
|
|
||||||
EXE_NAME TestKeywords
|
|
||||||
SOURCES ${PROJECT_BINARY_DIR}/TestKeywords.cpp
|
|
||||||
LIBRARIES ${TEST_LIBS})
|
|
||||||
list(APPEND EXTRA_TESTS TestKeywords)
|
|
||||||
|
|
||||||
# Extra compile definitions and extra parameters
|
|
||||||
include(cmake/Modules/CheckCaseSensitiveFileSystem.cmake)
|
|
||||||
set(_testdir ${PROJECT_SOURCE_DIR}/tests/parser/data)
|
|
||||||
|
|
||||||
opm_add_test(ParserTests
|
|
||||||
SOURCES tests/parser/ParserTests.cpp
|
|
||||||
LIBRARIES ${TEST_LIBS}
|
|
||||||
TEST_ARGS -- ${_testdir}/)
|
|
||||||
list(APPEND EXTRA_TESTS ParserTests)
|
|
||||||
|
|
||||||
opm_add_test(ParserIncludeTests
|
|
||||||
SOURCES tests/parser/ParserIncludeTests.cpp
|
|
||||||
LIBRARIES ${TEST_LIBS}
|
|
||||||
TEST_ARGS -- ${_testdir}/parser/)
|
|
||||||
target_compile_definitions(ParserIncludeTests PRIVATE
|
|
||||||
-DHAVE_CASE_SENSITIVE_FILESYSTEM=${HAVE_CASE_SENSITIVE_FILESYSTEM})
|
|
||||||
list(APPEND EXTRA_TESTS ParserIncludeTests)
|
|
||||||
|
|
||||||
opm_add_test(PvtxTableTests
|
|
||||||
SOURCES tests/parser/PvtxTableTests.cpp
|
|
||||||
LIBRARIES ${TEST_LIBS}
|
|
||||||
TEST_ARGS -- ${_testdir}/integration_tests/)
|
|
||||||
list(APPEND EXTRA_TESTS PvtxTableTests)
|
|
||||||
|
|
||||||
opm_add_test(EclipseStateTests
|
|
||||||
SOURCES tests/parser/EclipseStateTests.cpp
|
|
||||||
LIBRARIES ${TEST_LIBS}
|
|
||||||
TEST_ARGS -- ${_testdir}/integration_tests/)
|
|
||||||
list(APPEND EXTRA_TESTS EclipseStateTests)
|
|
||||||
|
|
||||||
foreach (test BoxTest
|
|
||||||
CheckDeckValidity
|
|
||||||
EclipseGridCreateFromDeck
|
|
||||||
IncludeTest
|
|
||||||
IntegrationTests
|
|
||||||
IOConfigIntegrationTest
|
|
||||||
ParseKEYWORD
|
|
||||||
Polymer
|
|
||||||
ScheduleCreateFromDeck
|
|
||||||
TransMultIntegrationTests)
|
|
||||||
|
|
||||||
opm_add_test(${test}
|
|
||||||
SOURCES tests/parser/integration/${test}.cpp
|
|
||||||
LIBRARIES ${TEST_LIBS}
|
|
||||||
TEST_ARGS -- ${_testdir}/integration_tests/)
|
|
||||||
list(APPEND EXTRA_TESTS ${test})
|
|
||||||
endforeach ()
|
|
||||||
|
|
||||||
opm_add_test( rst_spe1
|
|
||||||
SOURCES tests/rst_test.cpp
|
|
||||||
LIBRARIES ${TEST_LIBS}
|
|
||||||
TEST_ARGS tests/SPE1CASE2.DATA tests/SPE1CASE2_RESTART.DATA )
|
|
||||||
|
|
||||||
opm_add_test( rst_msw
|
|
||||||
SOURCES tests/rst_test.cpp
|
|
||||||
LIBRARIES ${TEST_LIBS}
|
|
||||||
TEST_ARGS tests/MSW.DATA tests/MSW_RESTART.DATA )
|
|
||||||
|
|
||||||
add_test( NAME rst_deck_test
|
|
||||||
COMMAND ${PROJECT_SOURCE_DIR}/tests/rst_test_driver.sh ${PROJECT_BINARY_DIR}/bin/rst_deck ${PROJECT_BINARY_DIR}/bin/opmhash
|
|
||||||
${PROJECT_SOURCE_DIR}/tests/SPE1CASE2_INCLUDE.DATA)
|
|
||||||
|
|
||||||
|
|
||||||
# opm-tests dependent tests
|
|
||||||
if(HAVE_OPM_TESTS)
|
|
||||||
opm_add_test(parse_write ONLY_COMPILE
|
|
||||||
SOURCES tests/parser/integration/parse_write.cpp
|
|
||||||
LIBRARIES ${TEST_LIBS})
|
|
||||||
list(APPEND EXTRA_TESTS parse_write)
|
|
||||||
foreach (deck ${OPM_TESTS_ROOT}/norne/NORNE_ATW2013.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe1_solvent/SPE1CASE2_SOLVENT.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe9_solvent/SPE9_CP_SOLVENT_CO2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe5/SPE5CASE1.DATA
|
|
||||||
${OPM_TESTS_ROOT}/polymer_simple2D/2D_THREEPHASE_POLY_HETER.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe1/SPE1CASE1.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe1/SPE1CASE2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe1/SPE1CASE2_FAMII.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe1/SPE1CASE2_SLGOF.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe3/SPE3CASE1.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe3/SPE3CASE2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_GROUP.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe9/SPE9_CP_SHORT_RESTART.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe9/SPE9.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe10model1/SPE10_MODEL1.DATA
|
|
||||||
${OPM_TESTS_ROOT}/spe10model2/SPE10_MODEL2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/msw_2d_h/2D_H__.DATA
|
|
||||||
${OPM_TESTS_ROOT}/model2/0_BASE_MODEL2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/model2/1_MULTREGT_MODEL2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/model2/2_MULTXYZ_MODEL2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/model2/3_MULTFLT_MODEL2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/model2/4_MINPVV_MODEL2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/model2/5_SWATINIT_MODEL2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/model2/6_ENDSCALE_MODEL2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/model2/7_HYSTERESIS_MODEL2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/model2/8_MULTIPLY_TRANXYZ_MODEL2.DATA
|
|
||||||
${OPM_TESTS_ROOT}/model2/9_EDITNNC_MODEL2.DATA)
|
|
||||||
|
|
||||||
get_filename_component(test_name ${deck} NAME_WE)
|
|
||||||
opm_add_test(${test_name} NO_COMPILE
|
|
||||||
EXE_NAME parse_write
|
|
||||||
TEST_ARGS ${deck})
|
|
||||||
endforeach()
|
|
||||||
opm_add_test("SPE9_CP_GROUP2" NO_COMPILE EXE_NAME parse_write TEST_ARGS "${OPM_TESTS_ROOT}/spe9group/SPE9_CP_GROUP.DATA")
|
|
||||||
set_property(TEST NORNE_ATW2013
|
|
||||||
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
|
|
||||||
|
|
||||||
add_test( NAME rst_deck_test_norne
|
|
||||||
COMMAND ${PROJECT_SOURCE_DIR}/tests/rst_test_driver.sh ${CMAKE_BINARY_DIR}/bin/rst_deck ${CMAKE_BINARY_DIR}/bin/opmhash
|
|
||||||
${OPM_TESTS_ROOT}/norne/NORNE_ATW2013.DATA)
|
|
||||||
|
|
||||||
set_property(TEST rst_deck_test_norne
|
|
||||||
PROPERTY ENVIRONMENT "OPM_ERRORS_IGNORE=PARSE_RANDOM_SLASH")
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
# JSON tests
|
|
||||||
opm_add_test(jsonTests
|
|
||||||
SOURCES tests/json/jsonTests.cpp
|
|
||||||
LIBRARIES ${TEST_LIBS}
|
|
||||||
TEST_ARGS ${PROJECT_SOURCE_DIR}/tests/json/example1.json)
|
|
||||||
list(APPEND EXTRA_TESTS jsonTests)
|
|
||||||
|
|
||||||
endif()
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
set(genkw_SOURCES src/opm/json/JsonObject.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/createDefaultKeywordList.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/UDAValue.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckTree.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckValue.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/Deck.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckItem.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckKeyword.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckRecord.cpp
|
|
||||||
src/opm/parser/eclipse/Deck/DeckOutput.cpp
|
|
||||||
src/opm/parser/eclipse/Generator/KeywordGenerator.cpp
|
|
||||||
src/opm/parser/eclipse/Generator/KeywordLoader.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ErrorGuard.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ParseContext.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ParserEnums.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ParserItem.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ParserKeyword.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/ParserRecord.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/raw/RawKeyword.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/raw/RawRecord.cpp
|
|
||||||
src/opm/parser/eclipse/Parser/raw/StarToken.cpp
|
|
||||||
src/opm/parser/eclipse/Units/Dimension.cpp
|
|
||||||
src/opm/parser/eclipse/Units/UnitSystem.cpp
|
|
||||||
src/opm/common/utility/OpmInputError.cpp
|
|
||||||
src/opm/common/OpmLog/OpmLog.cpp
|
|
||||||
src/opm/common/OpmLog/Logger.cpp
|
|
||||||
src/opm/common/OpmLog/StreamLog.cpp
|
|
||||||
src/opm/common/OpmLog/LogBackend.cpp
|
|
||||||
src/opm/common/OpmLog/LogUtil.cpp
|
|
||||||
)
|
|
||||||
if(NOT cjson_FOUND)
|
|
||||||
list(APPEND genkw_SOURCES external/cjson/cJSON.c)
|
|
||||||
endif()
|
|
||||||
add_executable(genkw ${genkw_SOURCES})
|
|
||||||
|
|
||||||
target_link_libraries(genkw ${opm-common_LIBRARIES})
|
|
||||||
|
|
||||||
# Generate keyword list
|
|
||||||
include(src/opm/parser/eclipse/share/keywords/keyword_list.cmake)
|
|
||||||
string(REGEX REPLACE "([^;]+)" "${PROJECT_SOURCE_DIR}/src/opm/parser/eclipse/share/keywords/\\1" keyword_files "${keywords}")
|
|
||||||
configure_file(src/opm/parser/eclipse/keyword_list.argv.in keyword_list.argv)
|
|
||||||
|
|
||||||
# Generate keyword source
|
|
||||||
|
|
||||||
set( genkw_argv keyword_list.argv
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/include/
|
|
||||||
opm/parser/eclipse/Parser/ParserKeywords
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp)
|
|
||||||
|
|
||||||
set( _tmp_output
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/B.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/C.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/D.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/E.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/F.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/G.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/H.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/I.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/J.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/K.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/L.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/M.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/N.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/O.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/P.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Q.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/R.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/S.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/T.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/U.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/V.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/W.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/X.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Y.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/Z.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/ParserInit.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/tmp_gen/TestKeywords.cpp)
|
|
||||||
|
|
||||||
|
|
||||||
set( _target_output
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/A.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/B.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/C.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/D.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/E.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/F.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/G.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/H.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/I.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/J.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/K.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/L.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/M.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/N.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/O.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/P.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/Q.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/R.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/S.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/T.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/U.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/V.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/W.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/X.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/Y.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserKeywords/Z.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/TestKeywords.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/ParserInit.cpp)
|
|
||||||
|
|
||||||
|
|
||||||
if (OPM_ENABLE_PYTHON)
|
|
||||||
list(APPEND genkw_argv ${PROJECT_BINARY_DIR}/tmp_gen/builtin_pybind11.cpp)
|
|
||||||
list(APPEND _tmp_output ${PROJECT_BINARY_DIR}/tmp_gen/builtin_pybind11.cpp)
|
|
||||||
list(APPEND _target_output ${PROJECT_BINARY_DIR}/python/cxx/builtin_pybind11.cpp)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
add_custom_command( OUTPUT
|
|
||||||
${_tmp_output}
|
|
||||||
COMMAND genkw ${genkw_argv}
|
|
||||||
DEPENDS genkw ${keyword_files} src/opm/parser/eclipse/share/keywords/keyword_list.cmake)
|
|
||||||
|
|
||||||
# To avoid some rebuilds
|
|
||||||
add_custom_command(OUTPUT
|
|
||||||
${_target_output}
|
|
||||||
DEPENDS ${PROJECT_BINARY_DIR}/tmp_gen/ParserKeywords/A.cpp
|
|
||||||
COMMAND ${CMAKE_COMMAND} -DBASE_DIR=${PROJECT_BINARY_DIR} -P ${PROJECT_SOURCE_DIR}/CopyHeaders.cmake)
|
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
# opm-common
|
# opm-common 
|
||||||
Contains common components used throughout all of OPM,
|
Contains common components used throughout all of OPM,
|
||||||
in particular CMake modules for the build system.
|
in particular CMake modules for the build system.
|
||||||
|
|||||||
63
changelog.md
63
changelog.md
@@ -1,63 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
A short month-by-month synopsis of change highlights. Most bugfixes won't make
|
|
||||||
it in here, only the bigger features and interface changes.
|
|
||||||
|
|
||||||
# Important changes between release 2019.04 and 2019.10
|
|
||||||
|
|
||||||
* opm-common and the rest of OPM does not use libecl anymore and
|
|
||||||
supports reading and writing Eclipse files directly
|
|
||||||
* Improved Eclipse compatible restart, support for unified and non unified
|
|
||||||
files, and formatted and unformatted files
|
|
||||||
* Support for reading and checking various additional keywords was introduced (those
|
|
||||||
starting with A - M, R, T, V, W, Z).
|
|
||||||
* ACTIONX support implemented
|
|
||||||
* NUPCOL support implemented
|
|
||||||
* UDA, UDQ support implemented
|
|
||||||
* Implemented writing saturation function scaled end-point arrays (e.g., SWL, SGU,
|
|
||||||
SOWCR, KRORW, PCG) to INIT file
|
|
||||||
* Fixes concerning interaction of WELOPEN and WCON* with WECON and
|
|
||||||
WTEST
|
|
||||||
* Added support for FOAM keywords (FOAMMOB, FOAMROCK, WFOAM)
|
|
||||||
* Refactored and reimplemented Well representation in deck
|
|
||||||
|
|
||||||
# 2016.12
|
|
||||||
* ZCORN adjustments improved, considers cell-cell relations
|
|
||||||
* Slightly more robust compilation - won't crash if locales are broken
|
|
||||||
* Accessing the PVTW table has a richer interface
|
|
||||||
* FAULTS face direction accepts X+, I+, Y+, J+, Z+ and K+
|
|
||||||
* WELOPEN can be controlled with completion numbers (last two parameters)
|
|
||||||
* COMPLUMP is now supported
|
|
||||||
* Don't crash on aquifer keywords
|
|
||||||
* GMWSET and FMWSET are expanded properly
|
|
||||||
* Don't crash on DEBUG
|
|
||||||
* Read support for COORDSYS, GRUPRIG, LGR, PRORDER, TRACERS, TUNINGDP,
|
|
||||||
WDFACCOR, WEFAC, and WORKLIM, no longer crashes.
|
|
||||||
* RS and RV support.
|
|
||||||
* Support for DENSITY, PVTW, and ROCK tables
|
|
||||||
* JFUNC is understood and exposed
|
|
||||||
|
|
||||||
# 2016.11
|
|
||||||
* A new class, Runspec, for the RUNSPEC section, has been introduced
|
|
||||||
* Nodes in the FIELD group are no longer added to the Summary config
|
|
||||||
* WCONHIST only adds phases present in the deck
|
|
||||||
* cJSON can now be installed externally
|
|
||||||
* DeckItem and ParserItem internals refactored
|
|
||||||
* Build time reduced by only giving necessary source files to the json compiler
|
|
||||||
* Support for OPERATE, WSEGITER and GCONPROD
|
|
||||||
* Internal shared_ptrs removed from Schedule and children; interface updated
|
|
||||||
* Schedule is now copyable with regular C++ copy semantics - no internal refs
|
|
||||||
* Well head I/J is now time step dependent
|
|
||||||
* Well reference depth is time step dependent
|
|
||||||
* Some ZCORN issues fixed
|
|
||||||
* gas/oil and oil/gas ratio unit fixed for FIELD units
|
|
||||||
|
|
||||||
# 2016.10
|
|
||||||
* Significant improvements in overall parser performance
|
|
||||||
* shared_ptr has largely been removed from all public interfaces
|
|
||||||
* JFUNC keyword can be parsed
|
|
||||||
* Boolean conversions are explicit
|
|
||||||
* The Units.hpp header from core is moved here, replacing ConversionFactors
|
|
||||||
* The ConstPtr and Ptr shared pointer aliases are removed
|
|
||||||
* UnitSystem, Eclipse3DProperties, and OilVaporizationProperties are default
|
|
||||||
constructible
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#
|
|
||||||
# Module to check whether the file system is case sensitive or not
|
|
||||||
#
|
|
||||||
# Sets the following variable:
|
|
||||||
#
|
|
||||||
# HAVE_CASE_SENSITIVE_FILESYSTEM True if the file system honors the case of files
|
|
||||||
|
|
||||||
message(STATUS "Checking whether the file system is case-sensitive")
|
|
||||||
# create a file containing uppercase characters
|
|
||||||
file(WRITE "${CMAKE_BINARY_DIR}/UPPER" "Foo")
|
|
||||||
|
|
||||||
# check if the all-lowercase file with the same name can be opened
|
|
||||||
set(FooContents "")
|
|
||||||
if (EXISTS "${CMAKE_BINARY_DIR}/upper")
|
|
||||||
file(READ "${CMAKE_BINARY_DIR}/upper" FooContents)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# remove the file again in order not to have it dangling around...
|
|
||||||
file(REMOVE "${CMAKE_BINARY_DIR}/UPPER")
|
|
||||||
|
|
||||||
# check the contents of the file opened with lower-case. If it is
|
|
||||||
# empty, the file system is case sensitive.
|
|
||||||
if ("${FooContents}" STREQUAL "Foo")
|
|
||||||
message(STATUS "File system is not case-sensitive")
|
|
||||||
set(HAVE_CASE_SENSITIVE_FILESYSTEM 0)
|
|
||||||
else()
|
|
||||||
message(STATUS "File system is case-sensitive")
|
|
||||||
set(HAVE_CASE_SENSITIVE_FILESYSTEM 1)
|
|
||||||
endif()
|
|
||||||
@@ -78,17 +78,7 @@ function (configure_vars obj syntax filename verb)
|
|||||||
# write a CMake statements that warns if the value has changed
|
# write a CMake statements that warns if the value has changed
|
||||||
if ("${syntax}" STREQUAL "CMAKE")
|
if ("${syntax}" STREQUAL "CMAKE")
|
||||||
set (_db "\${") # to avoid parsing problems
|
set (_db "\${") # to avoid parsing problems
|
||||||
# special case: if we have a truth variable HAVE_ and this is
|
file (APPEND "${filename}" "if (DEFINED ${_var} AND NOT \"${_db}${_var}}\" STREQUAL \"${${_var}}\")\n")
|
||||||
# either just defined (as is), or set to 1 explicitly, then both
|
|
||||||
# of these count as "true", so put in a check that also accepts
|
|
||||||
# both of these values.
|
|
||||||
if (("${_var}" MATCHES "^HAVE_.*") AND
|
|
||||||
(("${${_var}}" STREQUAL "") OR ("${${_var}}" STREQUAL "1")))
|
|
||||||
set (_cond "(\"${_db}${_var}}\" STREQUAL \"\") OR (\"${_db}${_var}}\" STREQUAL \"1\")")
|
|
||||||
else ()
|
|
||||||
set (_cond "\"${_db}${_var}}\" STREQUAL \"${${_var}}\"")
|
|
||||||
endif ()
|
|
||||||
file (APPEND "${filename}" "if (DEFINED ${_var} AND NOT (${_cond}))\n")
|
|
||||||
file (APPEND "${filename}" "\tmessage (WARNING \"Incompatible value \\\"${_db}${_var}}\\\" of variable \\\"${_var}\\\"\")\n")
|
file (APPEND "${filename}" "\tmessage (WARNING \"Incompatible value \\\"${_db}${_var}}\\\" of variable \\\"${_var}\\\"\")\n")
|
||||||
file (APPEND "${filename}" "endif ()\n")
|
file (APPEND "${filename}" "endif ()\n")
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
47
cmake/Modules/DuneCompat.cmake
Normal file
47
cmake/Modules/DuneCompat.cmake
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# - Dunecontrol compatibility
|
||||||
|
#
|
||||||
|
# Enables this build to be a part of a dunecontrol chain. The
|
||||||
|
# DUNE_CHECK_MODULES macro greps the top-level Makefile for the
|
||||||
|
# presence of the abs_top_srcdir variable (!) and uses that as
|
||||||
|
# the include directory of a module. Also, the contents are not
|
||||||
|
# checked so if the variable is not present, it generates an
|
||||||
|
# invalid command line (-I without argument) which causes the
|
||||||
|
# autoconf probe to fail. This module patches our Makefile (!!)
|
||||||
|
# so the necessary string will be there; in itself this string
|
||||||
|
# has no use for us, it is solemnly to satisfy the M4 scripts.
|
||||||
|
|
||||||
|
if (CMAKE_GENERATOR MATCHES "Unix Makefiles")
|
||||||
|
# we need an up-to-date, patched Makefile. this is always checked when
|
||||||
|
# the makefile is run, thus the need for a marker file to keep a
|
||||||
|
# timestamp to see when it was last patched (by us)
|
||||||
|
# amazingly, nothing depends on the generated Makefile, so this can be
|
||||||
|
# run whenever in the build without trigging a compile of e.g. config.h
|
||||||
|
add_custom_target (dune-compat ALL
|
||||||
|
COMMAND ${CMAKE_COMMAND} -DCMAKE_HOME_DIRECTORY=${CMAKE_HOME_DIRECTORY} -P ${OPM_MACROS_ROOT}/cmake/Scripts/DuneCompat2.cmake
|
||||||
|
COMMENT "Patching Makefile to be DUNE compatible"
|
||||||
|
)
|
||||||
|
endif (CMAKE_GENERATOR MATCHES "Unix Makefiles")
|
||||||
|
|
||||||
|
# dunecontrol refuses to use a build tree as module directory unless
|
||||||
|
# there is a dune.module in it. however, if we are in a sub-dir. of
|
||||||
|
# the source, we are probably using dunecontrol with a --build-dir
|
||||||
|
# argument, and won't call dunecontrol from the parent (which is the
|
||||||
|
# source dir and most likely doesn't contain other projects) anyway,
|
||||||
|
# i.e. we only copy if we are truly out-of-source
|
||||||
|
string (LENGTH "${PROJECT_SOURCE_DIR}/" _src_dir_len)
|
||||||
|
string (LENGTH "${PROJECT_BINARY_DIR}/" _bin_dir_len)
|
||||||
|
if (_src_dir_len GREATER _bin_dir_len)
|
||||||
|
set (_not_substring TRUE)
|
||||||
|
else (_src_dir_len GREATER _bin_dir_len)
|
||||||
|
string (SUBSTRING "${PROJECT_BINARY_DIR}/" 0 ${_src_dir_len} _proj_prefix)
|
||||||
|
if ("${PROJECT_SOURCE_DIR}/" STREQUAL "${_proj_prefix}")
|
||||||
|
set (_not_substring FALSE)
|
||||||
|
else ("${PROJECT_SOURCE_DIR}/" STREQUAL "${_proj_prefix}")
|
||||||
|
set (_not_substring TRUE)
|
||||||
|
endif ("${PROJECT_SOURCE_DIR}/" STREQUAL "${_proj_prefix}")
|
||||||
|
endif (_src_dir_len GREATER _bin_dir_len)
|
||||||
|
if (_not_substring)
|
||||||
|
execute_process (COMMAND
|
||||||
|
${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/dune.module ${PROJECT_BINARY_DIR}/dune.module
|
||||||
|
)
|
||||||
|
endif (_not_substring)
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
find_library(ALBERTA_LTDL_LIB
|
|
||||||
NAMES ltdl
|
|
||||||
PATH_SUFFIXES lib lib32 lib64
|
|
||||||
)
|
|
||||||
find_path(ALBERTA_INCLUDE_DIR
|
|
||||||
NAMES alberta/alberta.h
|
|
||||||
PATHS ${ALBERTA_ROOT}
|
|
||||||
PATH_SUFFIXES alberta include NO_DEFAULT_PATH
|
|
||||||
DOC "Include path of Alberta")
|
|
||||||
find_path(ALBERTA_INCLUDE_DIR
|
|
||||||
NAMES
|
|
||||||
alberta/alberta.h
|
|
||||||
PATHS /usr/local /opt
|
|
||||||
PATH_SUFFIXES alberta)
|
|
||||||
#look for libraries
|
|
||||||
find_library(ALBERTA_UTIL_LIB
|
|
||||||
NAMES alberta_util alberta_utilities
|
|
||||||
PATHS ${ALBERTA_ROOT}
|
|
||||||
PATH_SUFFIXES lib lib32 lib64
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
find_library(ALBERTA_UTIL_LIB
|
|
||||||
NAMES alberta_util alberta_utilities
|
|
||||||
PATH_SUFFIXES lib lib32 lib64)
|
|
||||||
|
|
||||||
foreach(dim RANGE 1 9)
|
|
||||||
find_library(ALBERTA_${dim}D_LIB alberta_${dim}d
|
|
||||||
PATHS ${ALBERTA_ROOT}
|
|
||||||
PATH_SUFFIXES lib lib32 lib64
|
|
||||||
Cache FILEPATH DOC "Alberta lib for ${dim}D" NO_DEFAULT_PATH)
|
|
||||||
find_library(ALBERTA_${dim}D_LIB alberta_${dim}d PATH_SUFFIXES lib lib32 lib64)
|
|
||||||
if(ALBERTA_${dim}D_LIB)
|
|
||||||
set(ALBERTA_LIBRARIES ${ALBERTA_LIBRARIES} ${ALBERTA_${dim}D_LIB})
|
|
||||||
endif()
|
|
||||||
endforeach(dim RANGE 1 9)
|
|
||||||
|
|
||||||
if(ALBERTA_LIBRARIES AND ALBERTA_INCLUDE_DIR)
|
|
||||||
set(ALBERTA_INCLUDE_DIRS ${ALBERTA_INCLUDE_DIR})
|
|
||||||
set(ALBERTA_LIBRARIES ${ALBERTA_LIBRARIES} ${ALBERTA_UTIL_LIB} ${ALBERTA_LTDL_LIB})
|
|
||||||
set(ALBERTA_FOUND ON)
|
|
||||||
set(Alberta_FOUND ON)
|
|
||||||
set(HAVE_ALBERTA 1)
|
|
||||||
set(DUNE_ALBERTA_VERSION 0x300)
|
|
||||||
else()
|
|
||||||
set(ALBERTA_FOUND OFF)
|
|
||||||
set(Alberta_FOUND OFF)
|
|
||||||
endif()
|
|
||||||
468
cmake/Modules/FindCXX11Features.cmake
Normal file
468
cmake/Modules/FindCXX11Features.cmake
Normal file
@@ -0,0 +1,468 @@
|
|||||||
|
#
|
||||||
|
# Module that checks for supported C++11 (former C++0x) features.
|
||||||
|
#
|
||||||
|
# Sets the follwing variable:
|
||||||
|
#
|
||||||
|
# HAVE_FINAL True if the compiler supports the "final" quantifier
|
||||||
|
# HAVE_TYPE_TRAITS True if the <type_traits> header is available and implements sufficient functionality
|
||||||
|
# HAVE_SHARED_PTR True if std::shared_ptr is available
|
||||||
|
# HAVE_UNIQUE_PTR True if std::unique_ptr is available
|
||||||
|
# HAVE_NULLPTR True if nullptr is available
|
||||||
|
# HAVE_ARRAY True if header <array> and fill() are available
|
||||||
|
# HAVE_ATTRIBUTE_ALWAYS_INLINE True if attribute always inline is supported
|
||||||
|
# HAS_ATTRIBUTE_UNUSED True if attribute unused is supported
|
||||||
|
# HAS_ATTRIBUTE_DEPRECATED True if attribute deprecated is supported
|
||||||
|
# HAS_ATTRIBUTE_DEPRECATED_MSG True if attribute deprecated("msg") is supported
|
||||||
|
# HAVE_CONSTEXPR True if constexpr attribute is available
|
||||||
|
# HAVE_INTEGRAL_CONSTANT True if compiler supports integral_constant
|
||||||
|
# HAVE_STATIC_ASSERT True if static_assert is available
|
||||||
|
# HAVE_AUTO True if the compiler supports the auto keyword
|
||||||
|
# HAVE_VARIADIC_TEMPLATES True if variadic templates are supported
|
||||||
|
# HAVE_VARIADIC_CONSTRUCTOR_SFINAE True if variadic constructor sfinae is supported
|
||||||
|
# HAVE_RVALUE_REFERENCES True if rvalue references are supported
|
||||||
|
# HAVE_TUPLE True if std::tuple is available
|
||||||
|
# HAVE_TR1_TUPLE True if std::tr1::tuple is available
|
||||||
|
|
||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
include(CheckCXXSourceRuns)
|
||||||
|
|
||||||
|
# test for C++11 flags
|
||||||
|
include(TestCXXAcceptsFlag)
|
||||||
|
include(CheckIncludeFileCXX)
|
||||||
|
|
||||||
|
# macro to only add option once
|
||||||
|
include(AddOptions)
|
||||||
|
|
||||||
|
# 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
|
||||||
|
set (CXX_STDLIB_FLAGS)
|
||||||
|
string (TOUPPER "${CMAKE_CXX_COMPILER_ID}" _comp_id)
|
||||||
|
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++")
|
||||||
|
endif (CXX_FLAG_STDLIB_LIBCXX)
|
||||||
|
endif (APPLE AND (_comp_id MATCHES "CLANG"))
|
||||||
|
|
||||||
|
# to format the command-line options pretty, we have an optional space
|
||||||
|
if (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
|
||||||
|
set (CXX_SPACE " ")
|
||||||
|
else (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
|
||||||
|
set (CXX_SPACE)
|
||||||
|
endif (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
|
||||||
|
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)
|
||||||
|
add_options(CXX ALL_BUILDS ${CMAKE_CXX14_STANDARD_COMPILE_OPTION})
|
||||||
|
else()
|
||||||
|
add_options(CXX ALL_BUILDS ${CMAKE_CXX11_STANDARD_COMPILE_OPTION})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# perform tests
|
||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
|
||||||
|
# the "final" method specifier
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
struct Base {
|
||||||
|
virtual void foo() = 0;
|
||||||
|
};
|
||||||
|
struct Derived : public Base {
|
||||||
|
virtual void foo() final {};
|
||||||
|
};
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_FINAL
|
||||||
|
)
|
||||||
|
|
||||||
|
# std::is_convertible, std::is_base_of
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
class Base {};
|
||||||
|
class Derived : public Base {};
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
bool foo = std::is_convertible<int, double>::value;
|
||||||
|
bool bar = std::is_base_of<Base, Derived>::value;
|
||||||
|
bool foobar = std::is_integral<double>::value;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_TYPE_TRAITS
|
||||||
|
)
|
||||||
|
|
||||||
|
# nullptr
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
std::shared_ptr<int> foo(new int(123));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_SHARED_PTR
|
||||||
|
)
|
||||||
|
|
||||||
|
# this is required by dune-common to avoid linker errors. "fun"!
|
||||||
|
if (HAVE_SHARED_PTR)
|
||||||
|
set(HAVE_MAKE_SHARED 1)
|
||||||
|
set(SHARED_PTR_HEADER "<memory>")
|
||||||
|
set(SHARED_PTR_NAMESPACE "std")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# nullptr
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
std::unique_ptr<int> foo(new int(123));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_UNIQUE_PTR
|
||||||
|
)
|
||||||
|
|
||||||
|
# nullptr
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
char* ch = nullptr;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_NULLPTR
|
||||||
|
)
|
||||||
|
|
||||||
|
# constexpr
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
template <class T>
|
||||||
|
inline constexpr int foo(T bar) { return bar*2; }
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
constexpr int foobar = foo(100);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_CONSTEXPR
|
||||||
|
)
|
||||||
|
|
||||||
|
# array and fill
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <array>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
std::array<int,2> a;
|
||||||
|
a.fill(9);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_ARRAY
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check whether if std::integral_constant< T, v > is supported and casts into T
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <type_traits>
|
||||||
|
void f( int ){}
|
||||||
|
|
||||||
|
int main(void){
|
||||||
|
f( std::integral_constant< int, 42 >() );
|
||||||
|
}
|
||||||
|
" HAVE_INTEGRAL_CONSTANT
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check whether if <tuple> is available
|
||||||
|
check_include_file_cxx("tuple" HAVE_TUPLE)
|
||||||
|
|
||||||
|
# Check whether if <tr1/tuple> is available
|
||||||
|
check_include_file_cxx("tr1/tuple" HAVE_TR1_TUPLE)
|
||||||
|
|
||||||
|
# __attribute__((always_inline))
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
void __attribute__((always_inline)) foo(void) {}
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
foo();
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
" HAVE_ATTRIBUTE_ALWAYS_INLINE
|
||||||
|
)
|
||||||
|
|
||||||
|
# __attribute__((unused))
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
int __attribute__((unused)) foo;
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
" HAS_ATTRIBUTE_UNUSED
|
||||||
|
)
|
||||||
|
|
||||||
|
# __attribute__((deprecated))
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#define DEP __attribute__((deprecated))
|
||||||
|
class bar
|
||||||
|
{
|
||||||
|
bar() DEP;
|
||||||
|
};
|
||||||
|
|
||||||
|
class peng { } DEP;
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
class t_bar
|
||||||
|
{
|
||||||
|
t_bar() DEP;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
class t_peng {
|
||||||
|
t_peng() {};
|
||||||
|
} DEP;
|
||||||
|
|
||||||
|
void foo() DEP;
|
||||||
|
|
||||||
|
void foo() {};
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
" HAS_ATTRIBUTE_DEPRECATED
|
||||||
|
)
|
||||||
|
|
||||||
|
# __attribute__((deprecated("msg")))
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#define DEP __attribute__((deprecated(\"message\")))
|
||||||
|
class bar {
|
||||||
|
bar() DEP;
|
||||||
|
};
|
||||||
|
|
||||||
|
class peng { } DEP;
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
class t_bar
|
||||||
|
{
|
||||||
|
t_bar() DEP;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
class t_peng
|
||||||
|
{
|
||||||
|
t_peng() {};
|
||||||
|
} DEP;
|
||||||
|
|
||||||
|
void foo() DEP;
|
||||||
|
|
||||||
|
void foo() {};
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
" HAS_ATTRIBUTE_DEPRECATED_MSG
|
||||||
|
)
|
||||||
|
|
||||||
|
# static assert
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
static_assert(true,\"MSG\");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_STATIC_ASSERT
|
||||||
|
)
|
||||||
|
|
||||||
|
# auto keyword
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
auto foo = 1.23;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_AUTO
|
||||||
|
)
|
||||||
|
|
||||||
|
# variadic template support
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
template<typename... T>
|
||||||
|
int addints(T... x);
|
||||||
|
|
||||||
|
int add_ints()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T1, typename... T>
|
||||||
|
int add_ints(T1 t1, T... t)
|
||||||
|
{
|
||||||
|
return t1 + add_ints(t...);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
assert( 5 == add_ints(9,3,-5,-2) );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_VARIADIC_TEMPLATES
|
||||||
|
)
|
||||||
|
|
||||||
|
# SFINAE on variadic template constructors within template classes
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
template<typename... U>
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
template<typename... T,
|
||||||
|
typename = typename std::enable_if<(sizeof...(T) < 2)>::type
|
||||||
|
>
|
||||||
|
A(T... t)
|
||||||
|
: i(1)
|
||||||
|
{}
|
||||||
|
|
||||||
|
template<typename... T,
|
||||||
|
typename = typename std::enable_if<(sizeof...(T) >= 2)>::type,
|
||||||
|
typename = void
|
||||||
|
>
|
||||||
|
A(T... t)
|
||||||
|
: i(-1)
|
||||||
|
{}
|
||||||
|
|
||||||
|
A()
|
||||||
|
: i(1)
|
||||||
|
{}
|
||||||
|
|
||||||
|
int i;
|
||||||
|
};
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
return (A<int>().i + A<int>(2).i + A<int>(\"foo\",3.4).i + A<int>(8,'a',A<int>()).i == 0 ? 0 : 1);
|
||||||
|
}
|
||||||
|
" HAVE_VARIADIC_CONSTRUCTOR_SFINAE
|
||||||
|
)
|
||||||
|
|
||||||
|
# rvalue references
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <cassert>
|
||||||
|
#include <utility>
|
||||||
|
int foo(int&& x) { return 1; }
|
||||||
|
int foo(const int& x) { return -1; }
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
int forward(T&& x)
|
||||||
|
{
|
||||||
|
return foo(std::forward<T>(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
assert( forward(i) + forward(int(2)) == 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_RVALUE_REFERENCES
|
||||||
|
)
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
include(CheckIncludeFileCXX)
|
||||||
|
# Search for some tr1 headers
|
||||||
|
foreach(_HEADER tuple tr1/tuple type_traits tr1/type_traits)
|
||||||
|
string(REPLACE "/" "_" _HEADER_VAR ${_HEADER})
|
||||||
|
string(TOUPPER ${_HEADER_VAR} _HEADER_VAR )
|
||||||
|
check_include_file_cxx(${_HEADER} "HAVE_${_HEADER_VAR}")
|
||||||
|
endforeach(_HEADER tuple tr1/tuple tr1/type_traits)
|
||||||
|
|
||||||
|
# make sure that the C++-11 features implemented by the compiler are a
|
||||||
|
# superset of those provided by GCC 4.4. This makes the test fail on
|
||||||
|
# all GCC compilers before 4.4.
|
||||||
|
set(CXX_FEATURES_MISSING "")
|
||||||
|
if (NOT HAVE_TYPE_TRAITS)
|
||||||
|
set(CXX_FEATURES_MISSING
|
||||||
|
"${CXX_FEATURES_MISSING} - Sufficiently conformant type traits (defined by the 'type_traits' header file)\n")
|
||||||
|
endif()
|
||||||
|
if (NOT HAVE_SHARED_PTR)
|
||||||
|
set(CXX_FEATURES_MISSING
|
||||||
|
"${CXX_FEATURES_MISSING} - Shared pointers (the std::shared_ptr class)\n")
|
||||||
|
endif()
|
||||||
|
if (NOT HAVE_UNIQUE_PTR)
|
||||||
|
set(CXX_FEATURES_MISSING
|
||||||
|
"${CXX_FEATURES_MISSING} - Unique pointers (the std::unique_ptr class)\n")
|
||||||
|
endif()
|
||||||
|
if (NOT HAVE_ARRAY)
|
||||||
|
set(CXX_FEATURES_MISSING
|
||||||
|
"${CXX_FEATURES_MISSING} - Statically sized arrays (the std::array class)\n")
|
||||||
|
endif()
|
||||||
|
if (NOT HAVE_STATIC_ASSERT)
|
||||||
|
set(CXX_FEATURES_MISSING
|
||||||
|
"${CXX_FEATURES_MISSING} - Static assertations (the static_assert() mechanism)\n")
|
||||||
|
endif()
|
||||||
|
if (NOT HAVE_AUTO)
|
||||||
|
set(CXX_FEATURES_MISSING
|
||||||
|
"${CXX_FEATURES_MISSING} - Automatically typed variables (the 'auto' keyword)\n")
|
||||||
|
endif()
|
||||||
|
if (NOT HAVE_VARIADIC_TEMPLATES)
|
||||||
|
set(CXX_FEATURES_MISSING
|
||||||
|
"${CXX_FEATURES_MISSING} - Variable number of template arguments\n")
|
||||||
|
endif()
|
||||||
|
if (NOT HAVE_VARIADIC_CONSTRUCTOR_SFINAE)
|
||||||
|
set(CXX_FEATURES_MISSING
|
||||||
|
"${CXX_FEATURES_MISSING} - Constructors with variable number of template arguments obeying the SFINAE (specialization failure is not an error) rule\n")
|
||||||
|
endif()
|
||||||
|
if (NOT HAVE_RVALUE_REFERENCES)
|
||||||
|
set(CXX_FEATURES_MISSING
|
||||||
|
"${CXX_FEATURES_MISSING} - References to rvalue objects\n")
|
||||||
|
endif()
|
||||||
|
if (NOT HAVE_TUPLE)
|
||||||
|
set(CXX_FEATURES_MISSING
|
||||||
|
"${CXX_FEATURES_MISSING} - Tuples (the std::tuple class)\n")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CXX_FEATURES_MISSING)
|
||||||
|
set (CXX11FEATURES_FOUND FALSE)
|
||||||
|
if (CXX11Features_FIND_REQUIRED)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"Your C++ compiler does not support the minimum set of C++-2011 features required. "
|
||||||
|
"Make sure to use a compiler which implements all C++-2011 features provided by GCC 4.4. "
|
||||||
|
"Your compiler does not seem to implement the following features:\n"
|
||||||
|
"${CXX_FEATURES_MISSING}")
|
||||||
|
endif()
|
||||||
|
else ()
|
||||||
|
set (CXX11FEATURES_FOUND TRUE)
|
||||||
|
endif()
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# 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)
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# 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)
|
|
||||||
49
cmake/Modules/FindCwrap.cmake
Normal file
49
cmake/Modules/FindCwrap.cmake
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# Find the Python wrappers for module cwrap from ert
|
||||||
|
#
|
||||||
|
# Set the cache variable CWRAP_PYTHON_PATH to the install location of the root
|
||||||
|
# ert package.
|
||||||
|
|
||||||
|
find_package(PythonInterp)
|
||||||
|
if(PYTHONINTERP_FOUND)
|
||||||
|
|
||||||
|
# We try to find the cwrap Python distribution. This is done by running Python
|
||||||
|
# code which tries to 'import cwrap' and prints out the path to the module if
|
||||||
|
# the import succeeds.
|
||||||
|
#
|
||||||
|
# The normal Python import machinery is employed, so if you have installed cwrap
|
||||||
|
# python in a default location, or alternatively set the PYTHONPATH variable the
|
||||||
|
# cwrap Python distribution will eventually be found there, independently of the
|
||||||
|
# alternatives which are tested with the ${PATH_LIST} variable.
|
||||||
|
|
||||||
|
if (EXISTS "/etc/debian_version")
|
||||||
|
set( PYTHON_PACKAGE_PATH "dist-packages")
|
||||||
|
else()
|
||||||
|
set( PYTHON_PACKAGE_PATH "site-packages")
|
||||||
|
endif()
|
||||||
|
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
|
||||||
|
|
||||||
|
set(PATH_LIST)
|
||||||
|
if (ERT_ROOT)
|
||||||
|
list(APPEND PATH_LIST ${ERT_ROOT})
|
||||||
|
endif()
|
||||||
|
list(APPEND PATH_LIST ${CMAKE_PREFIX_PATH})
|
||||||
|
|
||||||
|
# Add various popular sibling alternatives.
|
||||||
|
list(APPEND PATH_LIST "${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert-build")
|
||||||
|
|
||||||
|
foreach( PATH ${PATH_LIST})
|
||||||
|
set( python_code "import sys; sys.path.insert(0 , '${PATH}/${PYTHON_INSTALL_PREFIX}'); import os.path; import inspect; import cwrap; print os.path.dirname(os.path.dirname(inspect.getfile(cwrap)))")
|
||||||
|
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "${python_code}"
|
||||||
|
RESULT_VARIABLE import_result
|
||||||
|
OUTPUT_VARIABLE stdout_output
|
||||||
|
ERROR_VARIABLE stderr_output
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||||
|
|
||||||
|
if (${import_result} EQUAL 0)
|
||||||
|
set( CWRAP_PYTHON_PATH ${stdout_output} CACHE PATH "Python path for cwrap" )
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
find_package_handle_standard_args("Cwrap" DEFAULT_MSG CWRAP_PYTHON_PATH)
|
||||||
269
cmake/Modules/FindERT.cmake
Normal file
269
cmake/Modules/FindERT.cmake
Normal file
@@ -0,0 +1,269 @@
|
|||||||
|
# - Find the Ensemble-based Reservoir Tool (ERT)
|
||||||
|
#
|
||||||
|
# Set the cache variable ERT_ROOT to the install location of the ERT
|
||||||
|
# libraries and header files.
|
||||||
|
#
|
||||||
|
# If found, it sets these variables:
|
||||||
|
#
|
||||||
|
# ERT_INCLUDE_DIRS Header file directories
|
||||||
|
# ERT_LIBRARIES Archives and shared objects
|
||||||
|
# ERT_CONFIG_VARS Definitions that goes in config.h
|
||||||
|
# ERT_LINKER_FLAGS Options that must be passed to linker
|
||||||
|
#
|
||||||
|
# It will also add to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS if necessary to
|
||||||
|
# link with the ERT libraries.
|
||||||
|
|
||||||
|
# variables to pass on to other packages
|
||||||
|
if (FIND_QUIETLY)
|
||||||
|
set (ERT_QUIET "QUIET")
|
||||||
|
else (FIND_QUIETLY)
|
||||||
|
set (ERT_QUIET "")
|
||||||
|
endif (FIND_QUIETLY)
|
||||||
|
|
||||||
|
# if a directory has been specified by the user, then don't go look
|
||||||
|
# in the system directories as well
|
||||||
|
if (ERT_ROOT)
|
||||||
|
set (_no_default_path "NO_DEFAULT_PATH")
|
||||||
|
else (ERT_ROOT)
|
||||||
|
set (_no_default_path "")
|
||||||
|
endif (ERT_ROOT)
|
||||||
|
|
||||||
|
# ERT doesn't have any config-mode file, so we need to specify the root
|
||||||
|
# directory in its own variable
|
||||||
|
find_path (ERT_ECL_INCLUDE_DIR
|
||||||
|
NAMES "ert/ecl/ecl_util.h"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
|
PATH_SUFFIXES "libecl/include/" "include"
|
||||||
|
DOC "Path to ERT Eclipse library header files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
find_path (ERT_ECL_WELL_INCLUDE_DIR
|
||||||
|
NAMES "ert/ecl_well/well_const.h"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
|
PATH_SUFFIXES "libecl_well/include/" "include"
|
||||||
|
DOC "Path to ERT Eclipse library header files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
find_path (ERT_ECLXX_INCLUDE_DIR
|
||||||
|
NAMES "ert/ecl/EclKW.hpp"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
|
PATH_SUFFIXES "libeclxx/include/" "include"
|
||||||
|
DOC "Path to ERT Eclipse C++ library header files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
find_path (ERT_UTIL_INCLUDE_DIR
|
||||||
|
NAMES "ert/util/stringlist.h"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
|
PATH_SUFFIXES "libert_util/include/" "include"
|
||||||
|
DOC "Path to ERT Eclipse library header files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
find_path (ERT_UTILXX_INCLUDE_DIR
|
||||||
|
NAMES "ert/util/ert_unique_ptr.hpp"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
|
PATH_SUFFIXES "libert_utilxx/include/" "include"
|
||||||
|
DOC "Path to ERT Eclipse C++ library header files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
find_path (ERT_GEN_INCLUDE_DIR
|
||||||
|
NAMES "ert/util/int_vector.h"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_SOURCE_DIR}/../ert"
|
||||||
|
PATH_SUFFIXES "libert_util/include"
|
||||||
|
"include" "build/libert_util/include" "build/libert_util/include"
|
||||||
|
DOC "Path to ERT generated library header files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# need all of these libraries
|
||||||
|
if (CMAKE_SIZEOF_VOID_P)
|
||||||
|
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||||
|
endif (CMAKE_SIZEOF_VOID_P)
|
||||||
|
find_library (ERT_LIBRARY_ECL
|
||||||
|
NAMES "ecl"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
|
DOC "Path to ERT Eclipse library archive/shared object files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
find_library (ERT_LIBRARY_ECLXX
|
||||||
|
NAMES "eclxx"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
|
DOC "Path to ERT Eclipse C++ library archive/shared object files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
find_library (ERT_LIBRARY_ECL_WELL
|
||||||
|
NAMES "ecl_well"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
|
DOC "Path to ERT Eclipse library archive/shared object files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
find_library (ERT_LIBRARY_GEOMETRY
|
||||||
|
NAMES "ert_geometry"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
|
DOC "Path to ERT Geometry library archive/shared object files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
find_library (ERT_LIBRARY_UTIL
|
||||||
|
NAMES "ert_util"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
|
DOC "Path to ERT Utilities library archive/shared object files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
find_library (ERT_LIBRARY_UTILXX
|
||||||
|
NAMES "ert_utilxx"
|
||||||
|
HINTS "${ERT_ROOT}"
|
||||||
|
PATHS "${PROJECT_BINARY_DIR}/../ert"
|
||||||
|
"${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert-build"
|
||||||
|
PATH_SUFFIXES "lib" "lib/Release" "lib/Debug" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
|
DOC "Path to ERT Utilities library archive/shared object files"
|
||||||
|
${_no_default_path}
|
||||||
|
)
|
||||||
|
# the "library" found here is actually a list of several files
|
||||||
|
list (APPEND ERT_INCLUDE_DIR
|
||||||
|
${ERT_ECL_INCLUDE_DIR}
|
||||||
|
${ERT_ECL_WELL_INCLUDE_DIR}
|
||||||
|
${ERT_ECLXX_INCLUDE_DIR}
|
||||||
|
${ERT_UTIL_INCLUDE_DIR}
|
||||||
|
${ERT_UTILXX_INCLUDE_DIR}
|
||||||
|
${ERT_GEN_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
list (APPEND ERT_LIBRARY
|
||||||
|
${ERT_LIBRARY_ECL}
|
||||||
|
${ERT_LIBRARY_ECLXX}
|
||||||
|
${ERT_LIBRARY_ECL_WELL}
|
||||||
|
${ERT_LIBRARY_GEOMETRY}
|
||||||
|
${ERT_LIBRARY_UTIL}
|
||||||
|
${ERT_LIBRARY_UTILXX}
|
||||||
|
)
|
||||||
|
list (APPEND ERT_LIBRARIES ${ERT_LIBRARY})
|
||||||
|
list (APPEND ERT_INCLUDE_DIRS ${ERT_INCLUDE_DIR})
|
||||||
|
|
||||||
|
# if we didn't find any files, then don't proceed through the entire dependency list
|
||||||
|
include (FindPackageHandleStandardArgs)
|
||||||
|
if (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")
|
||||||
|
find_package_handle_standard_args (ERT
|
||||||
|
DEFAULT_MSG
|
||||||
|
ERT_INCLUDE_DIR ERT_LIBRARY
|
||||||
|
)
|
||||||
|
# clear the cache so the find probe is attempted again if files becomes
|
||||||
|
# available (only upon a unsuccessful *compile* should we disable further
|
||||||
|
# probing)
|
||||||
|
set (HAVE_ERT)
|
||||||
|
unset (HAVE_ERT CACHE)
|
||||||
|
return ()
|
||||||
|
endif (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")
|
||||||
|
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
|
||||||
|
# parallel programming
|
||||||
|
include (UseOpenMP)
|
||||||
|
find_openmp (ERT)
|
||||||
|
|
||||||
|
# compression library
|
||||||
|
find_package (ZLIB ${ERT_QUIET})
|
||||||
|
if (ZLIB_FOUND)
|
||||||
|
list (APPEND ERT_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
|
||||||
|
list (APPEND ERT_LIBRARIES ${ZLIB_LIBRARIES})
|
||||||
|
endif (ZLIB_FOUND)
|
||||||
|
|
||||||
|
# numerics
|
||||||
|
find_package (BLAS ${ERT_QUIET})
|
||||||
|
if (BLAS_FOUND)
|
||||||
|
list (APPEND ERT_INCLUDE_DIRS ${BLAS_INCLUDE_DIRS})
|
||||||
|
list (APPEND ERT_LIBRARIES ${BLAS_LIBRARIES})
|
||||||
|
list (APPEND ERT_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
|
||||||
|
endif (BLAS_FOUND)
|
||||||
|
|
||||||
|
find_package (LAPACK ${ERT_QUIET})
|
||||||
|
if (LAPACK_FOUND)
|
||||||
|
list (APPEND ERT_INCLUDE_DIRS ${LAPACK_INCLUDE_DIRS})
|
||||||
|
list (APPEND ERT_LIBRARIES ${LAPACK_LIBRARIES})
|
||||||
|
list (APPEND ERT_LINKER_FLAGS ${LAPACK_LINKER_FLAGS})
|
||||||
|
endif (LAPACK_FOUND)
|
||||||
|
|
||||||
|
# math library (should exist on all unices; automatically linked on Windows)
|
||||||
|
if (UNIX)
|
||||||
|
find_library (MATH_LIBRARY
|
||||||
|
NAMES "m"
|
||||||
|
)
|
||||||
|
list (APPEND ERT_LIBRARIES ${MATH_LIBRARY})
|
||||||
|
endif (UNIX)
|
||||||
|
|
||||||
|
# if shared libraries are disabled on linux, explcitly linking to the
|
||||||
|
# pthreads library is required by ERT
|
||||||
|
find_package(Threads ${ERT_QUIET})
|
||||||
|
if (CMAKE_THREAD_LIBS_INIT)
|
||||||
|
list (APPEND ERT_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Platform specific library where dlopen with friends lives
|
||||||
|
list (APPEND ERT_LIBRARIES ${CMAKE_DL_LIBS})
|
||||||
|
|
||||||
|
# since OpenMP often implies pthreads, we need to tidy up
|
||||||
|
# (last instance of library must be left standing, thus reversing that
|
||||||
|
# list before removing duplicates)
|
||||||
|
include (Duplicates)
|
||||||
|
remove_dup_deps (ERT)
|
||||||
|
|
||||||
|
# see if we can compile a minimum example
|
||||||
|
# CMake logical test doesn't handle lists (sic)
|
||||||
|
if (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND"))
|
||||||
|
include (CMakePushCheckState)
|
||||||
|
include (CheckCSourceCompiles)
|
||||||
|
cmake_push_check_state ()
|
||||||
|
set (CMAKE_REQUIRED_INCLUDES ${ERT_INCLUDE_DIR})
|
||||||
|
set (CMAKE_REQUIRED_LIBRARIES ${ERT_LIBRARIES})
|
||||||
|
check_cxx_source_compiles (
|
||||||
|
"#include <ert/ecl/ecl_grid.h>
|
||||||
|
int main ( ) {
|
||||||
|
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 ()
|
||||||
|
else (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND"))
|
||||||
|
# clear the cache so the find probe is attempted again if files becomes
|
||||||
|
# available (only upon a unsuccessful *compile* should we disable further
|
||||||
|
# probing)
|
||||||
|
set (HAVE_ERT)
|
||||||
|
unset (HAVE_ERT CACHE)
|
||||||
|
endif (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND"))
|
||||||
|
|
||||||
|
# if the test program didn't compile, but was required to do so, bail
|
||||||
|
# out now and display an error; otherwise limp on
|
||||||
|
find_package_handle_standard_args (ERT
|
||||||
|
DEFAULT_MSG
|
||||||
|
ERT_INCLUDE_DIR ERT_LIBRARY HAVE_ERT
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
53
cmake/Modules/FindERTPython.cmake
Normal file
53
cmake/Modules/FindERTPython.cmake
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# - Find the Python wrappers for Ensemble-based Reservoir Tool (ERT)
|
||||||
|
#
|
||||||
|
# Set the cache variable ERT_PYTHON_PATH to the install location of
|
||||||
|
# the root ert package.
|
||||||
|
|
||||||
|
find_package(PythonInterp)
|
||||||
|
if(PYTHONINTERP_FOUND)
|
||||||
|
|
||||||
|
# We try to find the ert Python distribution. This is done by running
|
||||||
|
# Python code which tries to 'import ert' and prints out the path to
|
||||||
|
# the module if the import succeeds.
|
||||||
|
#
|
||||||
|
# The normal Python import machinery is employed, so if you have
|
||||||
|
# installed ert python in a default location, or alternatively set the
|
||||||
|
# PYTHONPATH variable the ert Python distribution will eventually be
|
||||||
|
# found there, independently of the alternatives which are tested with
|
||||||
|
# the ${PATH_LIST} variable.
|
||||||
|
|
||||||
|
if (EXISTS "/etc/debian_version")
|
||||||
|
set( PYTHON_PACKAGE_PATH "dist-packages")
|
||||||
|
else()
|
||||||
|
set( PYTHON_PACKAGE_PATH "site-packages")
|
||||||
|
endif()
|
||||||
|
set(PYTHON_INSTALL_PREFIX "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/${PYTHON_PACKAGE_PATH}" CACHE STRING "Subdirectory to install Python modules in")
|
||||||
|
|
||||||
|
set(PATH_LIST)
|
||||||
|
if (ERT_ROOT)
|
||||||
|
list(APPEND PATH_LIST ${ERT_ROOT})
|
||||||
|
endif()
|
||||||
|
list(APPEND PATH_LIST ${CMAKE_PREFIX_PATH})
|
||||||
|
|
||||||
|
# Add various popular sibling alternatives.
|
||||||
|
list(APPEND PATH_LIST "${PROJECT_SOURCE_DIR}/../ert/build"
|
||||||
|
"${PROJECT_BINARY_DIR}/../ert-build")
|
||||||
|
|
||||||
|
foreach( PATH ${PATH_LIST})
|
||||||
|
set( python_code "import sys; sys.path.insert(0 , '${PATH}/${PYTHON_INSTALL_PREFIX}'); import os.path; import inspect; import ert; print os.path.dirname(os.path.dirname(inspect.getfile(ert))); from ert.ecl import EclSum")
|
||||||
|
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "${python_code}"
|
||||||
|
RESULT_VARIABLE import_result
|
||||||
|
OUTPUT_VARIABLE stdout_output
|
||||||
|
ERROR_VARIABLE stderr_output
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||||
|
|
||||||
|
if (${import_result} EQUAL 0)
|
||||||
|
set( ERT_PYTHON_PATH ${stdout_output} CACHE PATH "Python path for ERT Python" )
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
find_package_handle_standard_args("ERTPython" DEFAULT_MSG ERT_PYTHON_PATH)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
# - Find the GNU Multiprecision library.
|
|
||||||
#
|
|
||||||
# Will define the following imported target for usage:
|
|
||||||
# - GMP::gmp Target for linking/compiling with C library
|
|
||||||
# - GMP::gmpxx Target for linking/compiling with C++ library
|
|
||||||
find_path(GMP_INCLUDE_DIR gmp.h)
|
|
||||||
find_library(GMP_LIBRARY gmp)
|
|
||||||
find_path(GMPXX_INCLUDE_DIR gmpxx.h)
|
|
||||||
find_library(GMPXX_LIBRARY gmpxx)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(GMP
|
|
||||||
DEFAULT_MSG
|
|
||||||
GMPXX_LIBRARY GMPXX_INCLUDE_DIR GMP_INCLUDE_DIR GMP_LIBRARY)
|
|
||||||
|
|
||||||
if(GMP_FOUND)
|
|
||||||
if(NOT TARGET GMP::gmp)
|
|
||||||
add_library(GMP::gmp UNKNOWN IMPORTED GLOBAL)
|
|
||||||
set_target_properties(GMP::gmp PROPERTIES
|
|
||||||
IMPORTED_LOCATION ${GMP_LIBRARY}
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES ${GMP_INCLUDE_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT TARGET GMP::gmpxx)
|
|
||||||
add_library(GMP::gmpxx UNKNOWN IMPORTED GLOBAL)
|
|
||||||
set_target_properties(GMP::gmpxx PROPERTIES
|
|
||||||
IMPORTED_LOCATION ${GMPXX_LIBRARY}
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES ${GMPXX_INCLUDE_DIR}
|
|
||||||
TARGET_LINK_LIBRARIES GMP::gmp)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
@@ -8,11 +8,7 @@
|
|||||||
# HAVE_METIS - like METIS_FOUND, but for the inclusion in config.h
|
# HAVE_METIS - like METIS_FOUND, but for the inclusion in config.h
|
||||||
# METIS_INCLUDE_DIRS - incude paths to use libMETIS
|
# METIS_INCLUDE_DIRS - incude paths to use libMETIS
|
||||||
# METIS_LIBRARIES - Link these to use libMETIS
|
# METIS_LIBRARIES - Link these to use libMETIS
|
||||||
# METIS::METIS - Imported metis target needed for DUNE 2.8.0
|
|
||||||
# METIS_API_VERSION - The METIS api version scotch is supporting.
|
|
||||||
|
|
||||||
set(METIS_API_VERSION 0 CACHE STRING
|
|
||||||
"METIS API version provided by METIS or scotch-metis library")
|
|
||||||
set(METIS_SEARCH_PATH "/usr" "/usr/local" "/opt" "/opt/local")
|
set(METIS_SEARCH_PATH "/usr" "/usr/local" "/opt" "/opt/local")
|
||||||
set(METIS_NO_DEFAULT_PATH "")
|
set(METIS_NO_DEFAULT_PATH "")
|
||||||
if(METIS_ROOT)
|
if(METIS_ROOT)
|
||||||
@@ -39,27 +35,9 @@ find_library(METIS_LIBRARIES
|
|||||||
${METIS_NO_DEFAULT_PATH})
|
${METIS_NO_DEFAULT_PATH})
|
||||||
|
|
||||||
set (METIS_FOUND FALSE)
|
set (METIS_FOUND FALSE)
|
||||||
|
|
||||||
if (METIS_INCLUDE_DIRS OR METIS_LIBRARIES)
|
if (METIS_INCLUDE_DIRS OR METIS_LIBRARIES)
|
||||||
set(METIS_FOUND TRUE)
|
set(METIS_FOUND TRUE)
|
||||||
set(HAVE_METIS TRUE)
|
set(HAVE_METIS TRUE)
|
||||||
file(READ "${METIS_INCLUDE_DIRS}/metis.h" metisheader)
|
|
||||||
string(REGEX MATCH "#define METIS_VER_MAJOR[ ]+([0-9]+)" METIS_MAJOR_VERSION ${metisheader})
|
|
||||||
if(NOT METIS_API_VERSION AND METIS_MAJOR_VERSION)
|
|
||||||
# string(REGEX REPLACE ".*#define METIS_VER_MAJOR[ ]+([0-9]+).*" "\\1"
|
|
||||||
# METIS_MAJOR_VERSION "${metisheader}")
|
|
||||||
if(METIS_MAJOR_VERSION GREATER_EQUAL 3 AND METIS_MAJOR_VERSION LESS 5)
|
|
||||||
set(METIS_API_VERSION "3")
|
|
||||||
else()
|
|
||||||
set(METIS_API_VERSION "${METIS_MAJOR_VERSION}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(METIS::METIS UNKNOWN IMPORTED)
|
|
||||||
set_target_properties(METIS::METIS PROPERTIES
|
|
||||||
IMPORTED_LOCATION ${METIS_LIBRARIES}
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES ${METIS_INCLUDE_DIRS}
|
|
||||||
INTERFACE_COMPILE_DEFINITIONS METIS_API_VERSION=${METIS_API_VERSION})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# print a message to indicate status of this package
|
# print a message to indicate status of this package
|
||||||
|
|||||||
@@ -16,11 +16,6 @@
|
|||||||
|
|
||||||
# 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)
|
||||||
|
|||||||
@@ -70,20 +70,6 @@ if(PTSCOTCH_FOUND)
|
|||||||
set(PTSCOCH_LINK_FLAGS "${DUNE_MPI_LINK_FLAGS}"
|
set(PTSCOCH_LINK_FLAGS "${DUNE_MPI_LINK_FLAGS}"
|
||||||
CACHE STRING "PT-Scotch link flags")
|
CACHE STRING "PT-Scotch link flags")
|
||||||
set(HAVE_PTSCOTCH 1)
|
set(HAVE_PTSCOTCH 1)
|
||||||
if(NOT TARGET PTScotch::Scotch)
|
|
||||||
add_library(PTScotch::Scotch UNKNOWN IMPORTED GLOBAL)
|
|
||||||
set_target_properties(PTScotch::Scotch PROPERTIES
|
|
||||||
IMPORTED_LOCATION "${SCOTCH_LIBRARY}"
|
|
||||||
INCLUDE_DIRECTORIES "${PTSCOTCH_INCLUDE_DIRS}"
|
|
||||||
INTERFACE_LINK_LIBRARIES "${PTSCOTCHERR_LIBRARY}")
|
|
||||||
endif()
|
|
||||||
if(NOT TARGET PTScotch::PTScotch)
|
|
||||||
add_library(PTScotch::PTScotch UNKNOWN IMPORTED GLOBAL)
|
|
||||||
set_target_properties(PTScotch::PTScotch PROPERTIES
|
|
||||||
IMPORTED_LOCATION "${PTSCOTCH_LIBRARY}"
|
|
||||||
INCLUDE_DIRECTORIES "${PTSCOTCH_INCLUDE_DIRS}"
|
|
||||||
INTERFACE_LINK_LIBRARIES "PTScotch::Scotch;${MPI_DUNE_LIBRARIES}")
|
|
||||||
endif()
|
|
||||||
# log result
|
# log result
|
||||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Determing location of PT-Scotch succeded:\n"
|
"Determing location of PT-Scotch succeded:\n"
|
||||||
|
|||||||
@@ -58,21 +58,7 @@ if(PARMETIS_INCLUDE_DIR)
|
|||||||
endif()
|
endif()
|
||||||
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${MPI_C_COMPILE_FLAGS}")
|
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${MPI_C_COMPILE_FLAGS}")
|
||||||
|
|
||||||
include(CheckIncludeFile)
|
|
||||||
check_include_file(parmetis.h PARMETIS_FOUND)
|
check_include_file(parmetis.h PARMETIS_FOUND)
|
||||||
|
|
||||||
if(NOT PARMETIS_FOUND)
|
|
||||||
# If we are using the ParMETIS bindings of PTScotch, we need
|
|
||||||
# to use the scotch include path as partmetis.h includes scotch.h
|
|
||||||
find_package(PTScotch)
|
|
||||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${PTSCOTCH_INCLUDE_DIR})
|
|
||||||
unset(PARMETIS_FOUND CACHE) # force recheck of include file
|
|
||||||
check_include_file(parmetis.h PARMETIS_FOUND)
|
|
||||||
if(PARMETIS_FOUND)
|
|
||||||
set(PARMETIS_SCOTCH_INCLUDE_DIRS ${PTSCOTCH_INCLUDE_DIRS})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
_search_parmetis_lib(PARMETIS_LIBRARY parmetis "The main ParMETIS library.")
|
_search_parmetis_lib(PARMETIS_LIBRARY parmetis "The main ParMETIS library.")
|
||||||
|
|
||||||
# behave like a CMake module is supposed to behave
|
# behave like a CMake module is supposed to behave
|
||||||
@@ -90,7 +76,7 @@ find_package_handle_standard_args(
|
|||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
|
|
||||||
if(PARMETIS_FOUND)
|
if(PARMETIS_FOUND)
|
||||||
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR} ${PARMETIS_SCOTCH_INCLUDE_DIRS})
|
set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR})
|
||||||
set(PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARIES} ${MPI_C_LIBRARIES}
|
set(PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARIES} ${MPI_C_LIBRARIES}
|
||||||
CACHE FILEPATH "All libraries needed to link programs using ParMETIS")
|
CACHE FILEPATH "All libraries needed to link programs using ParMETIS")
|
||||||
set(PARMETIS_LINK_FLAGS "${DUNE_C_LINK_FLAGS}"
|
set(PARMETIS_LINK_FLAGS "${DUNE_C_LINK_FLAGS}"
|
||||||
@@ -102,13 +88,6 @@ if(PARMETIS_FOUND)
|
|||||||
"Include directory: ${PARMETIS_INCLUDE_DIRS}\n"
|
"Include directory: ${PARMETIS_INCLUDE_DIRS}\n"
|
||||||
"Library directory: ${PARMETIS_LIBRARIES}\n\n")
|
"Library directory: ${PARMETIS_LIBRARIES}\n\n")
|
||||||
|
|
||||||
if(NOT TARGET ParMETIS::ParMETIS)
|
|
||||||
add_library(ParMETIS::ParMETIS UNKNOWN IMPORTED GLOBAL)
|
|
||||||
set_target_properties(ParMETIS::ParMETIS PROPERTIES
|
|
||||||
IMPORTED_LOCATION ${PARMETIS_LIBRARY}
|
|
||||||
INCLUDE_DIRECTORIES "${PARMETIS_INCLUDE_DIRS}"
|
|
||||||
INTERFACE_LINK_LIBRARIES "${METIS_LIBRARIES};${MPI_C_LIBRARIES}")
|
|
||||||
endif()
|
|
||||||
endif(PARMETIS_FOUND)
|
endif(PARMETIS_FOUND)
|
||||||
|
|
||||||
mark_as_advanced(PARMETIS_INCLUDE_DIRS PARMETIS_LIBRARIES HAVE_PARMETIS)
|
mark_as_advanced(PARMETIS_INCLUDE_DIRS PARMETIS_LIBRARIES HAVE_PARMETIS)
|
||||||
|
|||||||
@@ -34,11 +34,6 @@ int main(void){
|
|||||||
if (QUADMATH_FOUND)
|
if (QUADMATH_FOUND)
|
||||||
set(QUADMATH_LIBRARIES "quadmath")
|
set(QUADMATH_LIBRARIES "quadmath")
|
||||||
set(HAVE_QUAD "${QUADMATH_FOUND}")
|
set(HAVE_QUAD "${QUADMATH_FOUND}")
|
||||||
add_library(QuadMath::QuadMath INTERFACE IMPORTED)
|
|
||||||
set_target_properties(QuadMath::QuadMath PROPERTIES
|
|
||||||
INTERFACE_LINK_LIBRARIES quadmath
|
|
||||||
INTERFACE_COMPILE_DEFINITIONS _GLIBCXX_USE_FLOAT128
|
|
||||||
INTERFACE_COMPILE_OPTIONS $<$<CXX_COMPILER_ID:GNU>:-fext-numeric-literals>)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -280,32 +280,6 @@ if (SuiteSparse_LIBRARIES)
|
|||||||
list (REVERSE SuiteSparse_LIBRARIES)
|
list (REVERSE SuiteSparse_LIBRARIES)
|
||||||
endif (SuiteSparse_LIBRARIES)
|
endif (SuiteSparse_LIBRARIES)
|
||||||
|
|
||||||
if(SuiteSparse_FOUND)
|
|
||||||
if(NOT TARGET SuiteSparse::SuiteSparse)
|
|
||||||
add_library(SuiteSparse::SuiteSparse INTERFACE IMPORTED GLOBAL)
|
|
||||||
set_property(TARGET SuiteSparse::SuiteSparse PROPERTY
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES ${SuiteSparse_INCLUDE_DIRS})
|
|
||||||
if(config_LIBRARY)
|
|
||||||
set_property(TARGET SuiteSparse::SuiteSparse PROPERTY
|
|
||||||
INTERFACE_LINK_LIBRARIES ${config_LIBRARY})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
foreach(_module ${SuiteSparse_MODULES})
|
|
||||||
string (TOUPPER ${_module} _MODULE)
|
|
||||||
if(SuiteSparse_${_MODULE}_FOUND)
|
|
||||||
if(NOT TARGET SuiteSparse::${_module})
|
|
||||||
message(STATUS "Creating target SuitSparse::${_module}")
|
|
||||||
add_library(SuiteSparse::${_module} UNKNOWN IMPORTED GLOBAL)
|
|
||||||
set_target_properties(SuiteSparse::${_module} PROPERTIES
|
|
||||||
IMPORTED_LOCATION ${${_MODULE}_LIBRARY}
|
|
||||||
INCLUDE_DIRECTORIES ${${_MODULE}_INCLUDE_DIRS}
|
|
||||||
INTERFACE_LINK_LIBRARIES "${config_LIBRARY}")
|
|
||||||
target_link_libraries(SuiteSparse::SuiteSparse
|
|
||||||
INTERFACE SuiteSparse::${_module})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endforeach(_module)
|
|
||||||
endif()
|
|
||||||
# print a message to indicate status of this package
|
# print a message to indicate status of this package
|
||||||
include (FindPackageHandleStandardArgs)
|
include (FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args (SuiteSparse
|
find_package_handle_standard_args (SuiteSparse
|
||||||
|
|||||||
@@ -15,10 +15,6 @@
|
|||||||
# 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)
|
||||||
@@ -122,19 +118,6 @@ 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)
|
||||||
@@ -145,17 +128,6 @@ 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(
|
||||||
@@ -170,26 +142,10 @@ mark_as_advanced(SUPERLU_INCLUDE_DIR SUPERLU_LIBRARY)
|
|||||||
if(SUPERLU_FOUND)
|
if(SUPERLU_FOUND)
|
||||||
set(SUPERLU_INCLUDE_DIRS ${SUPERLU_INCLUDE_DIR})
|
set(SUPERLU_INCLUDE_DIRS ${SUPERLU_INCLUDE_DIR})
|
||||||
set(SUPERLU_LIBRARIES ${SUPERLU_LIBRARY})
|
set(SUPERLU_LIBRARIES ${SUPERLU_LIBRARY})
|
||||||
set(SUPERLU_INT_TYPE int)
|
|
||||||
if(SUPERLU_MIN_VERSION_4_3)
|
|
||||||
set(HAVE_SLU_DDEFS_H 1)
|
|
||||||
check_include_files(slu_sdefs.h HAVE_SLU_SDEFS_H)
|
|
||||||
check_include_files(slu_cdefs.h HAVE_SLU_CDEFS_H)
|
|
||||||
check_include_files(slu_zdefs.h HAVE_SLU_ZDEFS_H)
|
|
||||||
endif()
|
|
||||||
if (SUPERLU_BLAS_LIBRARY)
|
if (SUPERLU_BLAS_LIBRARY)
|
||||||
list(APPEND SUPERLU_LIBRARIES ${SUPERLU_BLAS_LIBRARY})
|
list(APPEND SUPERLU_LIBRARIES ${SUPERLU_BLAS_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
if(NOT TARGET SuperLU::SuperLU)
|
|
||||||
add_library(SuperLU::SuperLU UNKNOWN IMPORTED GLOBAL)
|
|
||||||
set_target_properties(SuperLU::SuperLU PROPERTIES
|
|
||||||
IMPORTED_LOCATION ${SUPERLU_LIBRARY}
|
|
||||||
INCLUDE_DIRECTORIES ${SUPERLU_INCLUDE_DIRS})
|
|
||||||
if(SUPERLU_BLAS_LIBRARY)
|
|
||||||
set_property(TARGET SuperLU::SuperLU PROPERTY
|
|
||||||
INTERFACE_LINK_LIBRARIES ${SUPERLU_BLAS_LIBRARY})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
# Poor man's FindTBB that will create the CMake targets
|
|
||||||
# used by DUNE.
|
|
||||||
# If the TBB version is new enough it will ship its own
|
|
||||||
# TBBConfig.cmake and we are good
|
|
||||||
find_package(TBB QUIET CONFIG)
|
|
||||||
|
|
||||||
if(NOT TBB_FOUND)
|
|
||||||
# Fall back to using pkgconfig
|
|
||||||
find_package(PkgConfig QUIET)
|
|
||||||
if (PKG_CONFIG_FOUND)
|
|
||||||
pkg_check_modules(PkgConfigTBB IMPORTED_TARGET GLOBAL tbb QUIET)
|
|
||||||
if(NOT TARGET PkgConfig::PkgConfigTBB)
|
|
||||||
# workaround bug in old FindPkgConfig.cmake which adds
|
|
||||||
# pkgcfg_lib_PkgConfigTBB_atomic-NOTFOUND because it cannot
|
|
||||||
# find the atomic lib of the compiler (not in platforms default
|
|
||||||
# library path. It will therefore not create the target and we
|
|
||||||
# try that manually.
|
|
||||||
string(REPLACE ";pkgcfg_lib_PkgConfigTBB_atomic-NOTFOUND" "" _find_tbb_libs "${PkgConfigTBB_LINK_LIBRARIES}")
|
|
||||||
if(_find_tbb_libs)
|
|
||||||
add_library(PkgConfig::PkgConfigTBB INTERFACE IMPORTED GLOBAL)
|
|
||||||
set_property(TARGET PkgConfig::PkgConfigTBB PROPERTY
|
|
||||||
INTERFACE_LINK_LIBRARIES "${_find_tbb_libs}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(TARGET PkgConfig::PkgConfigTBB)
|
|
||||||
if(NOT TARGET TBB::tbb)
|
|
||||||
message(STATUS "Found TBB library using pkg config")
|
|
||||||
add_library(TBB::tbb ALIAS PkgConfig::PkgConfigTBB)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif(PKG_CONFIG_FOUND)
|
|
||||||
else()
|
|
||||||
message(STATUS "Found TBB library using config mode")
|
|
||||||
endif(NOT TBB_FOUND)
|
|
||||||
37
cmake/Modules/FindTinyXML.cmake
Normal file
37
cmake/Modules/FindTinyXML.cmake
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# - 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
|
||||||
|
"")
|
||||||
@@ -16,9 +16,6 @@ if(ZOLTAN_ROOT)
|
|||||||
set(ZOLTAN_NO_DEFAULT_PATH "NO_DEFAULT_PATH")
|
set(ZOLTAN_NO_DEFAULT_PATH "NO_DEFAULT_PATH")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# We only need zoltan with MPI. Otherwise usage of alugrid is broken.
|
|
||||||
find_package(MPI)
|
|
||||||
|
|
||||||
# Make sure we have checked for the underlying partitioners.
|
# Make sure we have checked for the underlying partitioners.
|
||||||
find_package(PTScotch)
|
find_package(PTScotch)
|
||||||
#find_package(ParMETIS)
|
#find_package(ParMETIS)
|
||||||
@@ -42,23 +39,20 @@ find_library(ZOLTAN_LIBRARIES
|
|||||||
${ZOLTAN_NO_DEFAULT_PATH})
|
${ZOLTAN_NO_DEFAULT_PATH})
|
||||||
|
|
||||||
set (ZOLTAN_FOUND FALSE)
|
set (ZOLTAN_FOUND FALSE)
|
||||||
|
if (ZOLTAN_INCLUDE_DIRS OR ZOLTAN_LIBRARIES)
|
||||||
set (ZOLTAN_CONFIG_VAR HAVE_ZOLTAN)
|
set(ZOLTAN_FOUND TRUE)
|
||||||
|
|
||||||
# print a message to indicate status of this package
|
|
||||||
include (FindPackageHandleStandardArgs)
|
|
||||||
|
|
||||||
find_package_handle_standard_args(ZOLTAN
|
|
||||||
DEFAULT_MSG
|
|
||||||
ZOLTAN_LIBRARIES
|
|
||||||
ZOLTAN_INCLUDE_DIRS
|
|
||||||
MPI_FOUND
|
|
||||||
)
|
|
||||||
|
|
||||||
if (ZOLTAN_FOUND)
|
|
||||||
set(HAVE_ZOLTAN 1)
|
set(HAVE_ZOLTAN 1)
|
||||||
set(ZOLTAN_LIBRARIES ${ZOLTAN_LIBRARIES} ${PARMETIS_LIBRARIES} ${PTSCOTCH_LIBRARIES})
|
set(ZOLTAN_LIBRARIES ${ZOLTAN_LIBRARIES} ${PARMETIS_LIBRARIES} ${PTSCOTCH_LIBRARIES})
|
||||||
set(ZOLTAN_INCLUDE_DIRS ${ZOLTAN_INCLUDE_DIRS} ${PARMETIS_INCLUDE_DIRS}
|
set(ZOLTAN_INCLUDE_DIRS ${ZOLTAN_INCLUDE_DIRS} ${PARMETIS_INCLUDE_DIRS}
|
||||||
${PTSCOTCH_INCLUDE_DIRS})
|
${PTSCOTCH_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set (ZOLTAN_CONFIG_VAR HAVE_ZOLTAN)
|
||||||
|
|
||||||
|
# print a message to indicate status of this package
|
||||||
|
include (FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(ZOLTAN
|
||||||
|
DEFAULT_MSG
|
||||||
|
ZOLTAN_LIBRARIES
|
||||||
|
ZOLTAN_INCLUDE_DIRS
|
||||||
|
)
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
include (FindPackageHandleStandardArgs)
|
include (FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
if ((NOT CJSON_ROOT) AND OPM_PARSER_ROOT)
|
||||||
|
set( CJSON_ROOT ${OPM_PARSER_ROOT})
|
||||||
|
endif()
|
||||||
|
|
||||||
if (CJSON_ROOT)
|
if (CJSON_ROOT)
|
||||||
set (_no_default_path "NO_DEFAULT_PATH")
|
set (_no_default_path "NO_DEFAULT_PATH")
|
||||||
else (CJSON_ROOT)
|
else (CJSON_ROOT)
|
||||||
@@ -14,9 +18,10 @@ endif (CJSON_ROOT)
|
|||||||
|
|
||||||
|
|
||||||
find_path (CJSON_INCLUDE_DIR
|
find_path (CJSON_INCLUDE_DIR
|
||||||
NAMES "cJSON.h"
|
NAMES "cjson/cJSON.h"
|
||||||
HINTS "${CJSON_ROOT}"
|
HINTS "${CJSON_ROOT}"
|
||||||
PATH_SUFFIXES "cjson"
|
PATHS "${PROJECT_SOURCE_DIR}"
|
||||||
|
PATH_SUFFIXES "include" "external"
|
||||||
DOC "Path to cjson library header files"
|
DOC "Path to cjson library header files"
|
||||||
${_no_default_path} )
|
${_no_default_path} )
|
||||||
|
|
||||||
@@ -31,7 +36,11 @@ string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/?(.*)" "\\1" BUILD_DIR_SUFFIX "${PR
|
|||||||
find_library (CJSON_LIBRARY
|
find_library (CJSON_LIBRARY
|
||||||
NAMES "cjson"
|
NAMES "cjson"
|
||||||
HINTS "${CJSON_ROOT}"
|
HINTS "${CJSON_ROOT}"
|
||||||
|
PATHS "${PROJECT_BINARY_DIR}/../opm-parser"
|
||||||
|
"${PROJECT_BINARY_DIR}/../opm-parser${BUILD_DIR_SUFFIX}"
|
||||||
|
"${PROJECT_BINARY_DIR}/../../opm-parser/${BUILD_DIR_SUFFIX}"
|
||||||
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
|
||||||
|
"opm/json"
|
||||||
DOC "Path to cjson library archive/shared object files"
|
DOC "Path to cjson library archive/shared object files"
|
||||||
${_no_default_path} )
|
${_no_default_path} )
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ find_opm_package (
|
|||||||
# TODO: we should probe for all the HAVE_* values listed below;
|
# TODO: we should probe for all the HAVE_* values listed below;
|
||||||
# however, we don't actually use them in our implementation, so
|
# however, we don't actually use them in our implementation, so
|
||||||
# we just include them to forward here in case anyone else does
|
# we just include them to forward here in case anyone else does
|
||||||
"dune-grid REQUIRED;
|
"CXX11Features REQUIRED;
|
||||||
|
dune-grid REQUIRED;
|
||||||
ZLIB;
|
ZLIB;
|
||||||
ZOLTAN;
|
ZOLTAN;
|
||||||
METIS
|
METIS
|
||||||
|
|||||||
@@ -16,12 +16,11 @@ find_opm_package (
|
|||||||
"dune-common"
|
"dune-common"
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
"BLAS REQUIRED;
|
"CXX11Features REQUIRED;
|
||||||
|
BLAS REQUIRED;
|
||||||
LAPACK REQUIRED;
|
LAPACK REQUIRED;
|
||||||
CxaDemangle;
|
CxaDemangle;
|
||||||
MPI;
|
MPI
|
||||||
TBB;
|
|
||||||
GMP
|
|
||||||
"
|
"
|
||||||
# header to search for
|
# header to search for
|
||||||
"dune/common/fvector.hh"
|
"dune/common/fvector.hh"
|
||||||
@@ -30,7 +29,7 @@ find_opm_package (
|
|||||||
"dunecommon"
|
"dunecommon"
|
||||||
|
|
||||||
# defines to be added to compilations
|
# defines to be added to compilations
|
||||||
""
|
"DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD=1"
|
||||||
|
|
||||||
# test program
|
# test program
|
||||||
"#include <dune/common/fvector.hh>
|
"#include <dune/common/fvector.hh>
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ find_opm_package (
|
|||||||
# TODO: we should probe for all the HAVE_* values listed below;
|
# TODO: we should probe for all the HAVE_* values listed below;
|
||||||
# however, we don't actually use them in our implementation, so
|
# however, we don't actually use them in our implementation, so
|
||||||
# we just include them to forward here in case anyone else does
|
# we just include them to forward here in case anyone else does
|
||||||
"dune-common REQUIRED;
|
"CXX11Features REQUIRED;
|
||||||
|
dune-common REQUIRED;
|
||||||
dune-grid REQUIRED;
|
dune-grid REQUIRED;
|
||||||
dune-alugrid;
|
dune-alugrid;
|
||||||
ZLIB;
|
ZLIB;
|
||||||
ZOLTAN;
|
ZOLTAN;
|
||||||
METIS;
|
METIS
|
||||||
Quadmath
|
|
||||||
"
|
"
|
||||||
# header to search for
|
# header to search for
|
||||||
"dune/fem/space/shapefunctionset/legendre.hh"
|
"dune/fem/space/shapefunctionset/legendre.hh"
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ find_opm_package (
|
|||||||
# TODO: we should probe for all the HAVE_* values listed below;
|
# TODO: we should probe for all the HAVE_* values listed below;
|
||||||
# however, we don't actually use them in our implementation, so
|
# however, we don't actually use them in our implementation, so
|
||||||
# we just include them to forward here in case anyone else does
|
# we just include them to forward here in case anyone else does
|
||||||
"dune-common REQUIRED
|
"CXX11Features REQUIRED;
|
||||||
|
dune-common REQUIRED
|
||||||
"
|
"
|
||||||
# header to search for
|
# header to search for
|
||||||
"dune/geometry/quadraturerules.hh"
|
"dune/geometry/quadraturerules.hh"
|
||||||
@@ -33,7 +34,8 @@ find_opm_package (
|
|||||||
# test program
|
# test program
|
||||||
"#include <dune/geometry/quadraturerules.hh>
|
"#include <dune/geometry/quadraturerules.hh>
|
||||||
int main (void) {
|
int main (void) {
|
||||||
Dune::GeometryType gt = Dune::GeometryTypes::quadrilateral;
|
Dune::GeometryType gt;
|
||||||
|
gt.makeQuadrilateral();
|
||||||
Dune::QuadratureRules<double, 2>::rule(gt, 2).size();
|
Dune::QuadratureRules<double, 2>::rule(gt, 2).size();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,12 +22,11 @@ find_opm_package (
|
|||||||
# TODO: we should probe for all the HAVE_* values listed below;
|
# TODO: we should probe for all the HAVE_* values listed below;
|
||||||
# however, we don't actually use them in our implementation, so
|
# however, we don't actually use them in our implementation, so
|
||||||
# we just include them to forward here in case anyone else does
|
# we just include them to forward here in case anyone else does
|
||||||
"dune-common REQUIRED;
|
"CXX11Features REQUIRED;
|
||||||
|
dune-common REQUIRED;
|
||||||
dune-geometry REQUIRED;
|
dune-geometry REQUIRED;
|
||||||
dune-uggrid;
|
|
||||||
MPI;
|
MPI;
|
||||||
UG;
|
UG
|
||||||
Alberta
|
|
||||||
"
|
"
|
||||||
# header to search for
|
# header to search for
|
||||||
"dune/grid/onedgrid.hh"
|
"dune/grid/onedgrid.hh"
|
||||||
@@ -55,8 +54,7 @@ int main (void) {
|
|||||||
HAVE_AMIRAMESH;
|
HAVE_AMIRAMESH;
|
||||||
HAVE_ALBERTA;
|
HAVE_ALBERTA;
|
||||||
HAVE_STDINT_H;
|
HAVE_STDINT_H;
|
||||||
DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS;
|
DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS
|
||||||
DUNE_ALBERTA_VERSION
|
|
||||||
")
|
")
|
||||||
|
|
||||||
#debug_find_vars ("dune-grid")
|
#debug_find_vars ("dune-grid")
|
||||||
|
|||||||
@@ -52,14 +52,7 @@ int main (void) {
|
|||||||
HAVE_PARMETIS;
|
HAVE_PARMETIS;
|
||||||
HAVE_SUPERLU;
|
HAVE_SUPERLU;
|
||||||
HAVE_UMFPACK;
|
HAVE_UMFPACK;
|
||||||
HAVE_SUITESPARSE_UMFPACK;
|
|
||||||
SUPERLU_INT_TYPE;
|
|
||||||
HAVE_SLU_CDEFS_H;
|
|
||||||
HAVE_SLU_DDEFS_H;
|
|
||||||
HAVE_SLU_SDEFS_H;
|
|
||||||
HAVE_SLU_ZDEFS_H;
|
|
||||||
SUPERLU_MIN_VERSION_4_3;
|
SUPERLU_MIN_VERSION_4_3;
|
||||||
SUPERLU_MIN_VERSION_5;
|
|
||||||
SUPERLU_POST_2005_VERSION
|
SUPERLU_POST_2005_VERSION
|
||||||
")
|
")
|
||||||
#debug_find_vars ("dune-istl")
|
#debug_find_vars ("dune-istl")
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
include (OpmPackage)
|
|
||||||
|
|
||||||
find_opm_package (
|
|
||||||
# module name
|
|
||||||
"dune-uggrid"
|
|
||||||
|
|
||||||
# dependencies
|
|
||||||
# TODO: we should probe for all the HAVE_* values listed below;
|
|
||||||
# however, we don't actually use them in our implementation, so
|
|
||||||
"dune-common REQUIRED
|
|
||||||
"
|
|
||||||
# header to search for
|
|
||||||
""
|
|
||||||
|
|
||||||
# library to search for
|
|
||||||
"duneuggrid"
|
|
||||||
|
|
||||||
# defines to be added to compilations
|
|
||||||
""
|
|
||||||
|
|
||||||
# test program
|
|
||||||
""
|
|
||||||
# config variable
|
|
||||||
"")
|
|
||||||
|
|
||||||
#debug_find_vars ("dune-uggrid")
|
|
||||||
|
|
||||||
# make version number available in config.h
|
|
||||||
include (UseDuneVer)
|
|
||||||
find_dune_version ("dune" "uggrid")
|
|
||||||
|
|
||||||
# deactivate search for UG
|
|
||||||
set(UG_FOUND ${dune-uggrid_FOUND})
|
|
||||||
42
cmake/Modules/Findewoms.cmake
Normal file
42
cmake/Modules/Findewoms.cmake
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# - Find OPM eWoms module
|
||||||
|
#
|
||||||
|
# Defines the following variables:
|
||||||
|
# ewoms_INCLUDE_DIRS Directory of header files
|
||||||
|
# ewoms_LIBRARIES Directory of shared object files
|
||||||
|
# ewoms_DEFINITIONS Defines that must be set to compile
|
||||||
|
# ewoms_CONFIG_VARS List of defines that should be in config.h
|
||||||
|
# HAVE_EWOMS Binary value to use in config.h
|
||||||
|
|
||||||
|
# Copyright (C) 2012 Uni Research AS
|
||||||
|
# This code is licensed under The GNU General Public License v3.0
|
||||||
|
|
||||||
|
# use the generic find routine
|
||||||
|
include (ewoms-prereqs)
|
||||||
|
include (OpmPackage)
|
||||||
|
find_opm_package (
|
||||||
|
# module name
|
||||||
|
"ewoms"
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
"${ewoms_DEPS}"
|
||||||
|
|
||||||
|
# header to search for
|
||||||
|
"ewoms/common/start.hh"
|
||||||
|
|
||||||
|
# library to search for
|
||||||
|
""
|
||||||
|
|
||||||
|
# defines to be added to compilations
|
||||||
|
""
|
||||||
|
|
||||||
|
# test program
|
||||||
|
"#include <ewoms/common/start.hh>
|
||||||
|
int main (void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
# config variables
|
||||||
|
"${ewoms_CONFIG_VAR}"
|
||||||
|
)
|
||||||
|
#include (UseDynamicBoost)
|
||||||
|
#debug_find_vars ("ewoms")
|
||||||
43
cmake/Modules/Findopm-common.cmake
Normal file
43
cmake/Modules/Findopm-common.cmake
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# - Find the opm-common module
|
||||||
|
#
|
||||||
|
# Defines the following variables:
|
||||||
|
# opm-common_INCLUDE_DIRS Directory of header files
|
||||||
|
# opm-common_LIBRARIES Directory of shared object files
|
||||||
|
# opm-common_DEFINITIONS Defines that must be set to compile
|
||||||
|
# opm-common_CONFIG_VARS List of defines that should be in config.h
|
||||||
|
# HAVE_OPM_COMMON Binary value to use in config.h
|
||||||
|
|
||||||
|
# Copyright (C) 2013 Uni Research AS
|
||||||
|
# This code is licensed under The GNU General Public License v3.0
|
||||||
|
|
||||||
|
# use the generic find routine
|
||||||
|
include (opm-common-prereqs)
|
||||||
|
include (OpmPackage)
|
||||||
|
find_opm_package (
|
||||||
|
# module name
|
||||||
|
"opm-common"
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
"${opm-common_DEPS}"
|
||||||
|
|
||||||
|
# header to search for
|
||||||
|
"opm/common/utility/platform_dependent/disable_warnings.h"
|
||||||
|
|
||||||
|
# library to search for
|
||||||
|
"opmcommon"
|
||||||
|
|
||||||
|
# defines to be added to compilations
|
||||||
|
""
|
||||||
|
|
||||||
|
# test program
|
||||||
|
"#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
||||||
|
int main (void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
|
||||||
|
# config variables
|
||||||
|
"${opm-common_CONFIG_VAR}"
|
||||||
|
)
|
||||||
|
include (UseDynamicBoost)
|
||||||
|
#debug_find_vars ("opm-common")
|
||||||
46
cmake/Modules/Findopm-core.cmake
Normal file
46
cmake/Modules/Findopm-core.cmake
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# - Find OPM core library
|
||||||
|
#
|
||||||
|
# Defines the following variables:
|
||||||
|
# opm-core_INCLUDE_DIRS Directory of header files
|
||||||
|
# opm-core_LIBRARIES Directory of shared object files
|
||||||
|
# opm-core_DEFINITIONS Defines that must be set to compile
|
||||||
|
# opm-core_CONFIG_VARS List of defines that should be in config.h
|
||||||
|
# HAVE_OPM_CORE Binary value to use in config.h
|
||||||
|
|
||||||
|
# Copyright (C) 2012 Uni Research AS
|
||||||
|
# This code is licensed under The GNU General Public License v3.0
|
||||||
|
|
||||||
|
# use the generic find routine
|
||||||
|
include (opm-core-prereqs)
|
||||||
|
include (OpmPackage)
|
||||||
|
find_opm_package (
|
||||||
|
# module name
|
||||||
|
"opm-core"
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
"${opm-core_DEPS}"
|
||||||
|
|
||||||
|
# header to search for
|
||||||
|
"opm/core/wells.h"
|
||||||
|
|
||||||
|
# library to search for
|
||||||
|
"opmcore"
|
||||||
|
|
||||||
|
# defines to be added to compilations
|
||||||
|
""
|
||||||
|
|
||||||
|
# test program
|
||||||
|
"
|
||||||
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
Opm::parameter::ParameterGroup parameters;
|
||||||
|
parameters.insertParameter(\"number\", \"7\");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
# config variables
|
||||||
|
"${opm-core_CONFIG_VAR}"
|
||||||
|
)
|
||||||
|
include (UseDynamicBoost)
|
||||||
|
#debug_find_vars ("opm-core")
|
||||||
24
cmake/Modules/Findopm-data.cmake
Normal file
24
cmake/Modules/Findopm-data.cmake
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# This module searches for the opm-data repository. Since the opm-data
|
||||||
|
# has no libraries or header files the find implementation is quite
|
||||||
|
# naive.
|
||||||
|
#
|
||||||
|
# If the opm-data repository is found, the following variables are set:
|
||||||
|
#
|
||||||
|
# HAVE_OPM_DATA
|
||||||
|
# OPM_DATA_ROOT
|
||||||
|
|
||||||
|
if (OPM_DATA_ROOT)
|
||||||
|
set( _opm_data_root ${OPM_DATA_ROOT})
|
||||||
|
else()
|
||||||
|
set( _opm_data_root "${PROJECT_SOURCE_DIR}/../opm-data")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (EXISTS "${_opm_data_root}/norne/NORNE_ATW2013.DATA")
|
||||||
|
set( HAVE_OPM_DATA True )
|
||||||
|
set( OPM_DATA_ROOT ${_opm_data_root} )
|
||||||
|
message(STATUS "Setting OPM_DATA_ROOT: ${OPM_DATA_ROOT}")
|
||||||
|
else()
|
||||||
|
set( HAVE_OPM_DATA False )
|
||||||
|
message(WARNING "opm-data not found - integration tests using opm-data will be skipped.")
|
||||||
|
endif()
|
||||||
42
cmake/Modules/Findopm-grid.cmake
Normal file
42
cmake/Modules/Findopm-grid.cmake
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# - Find OPM corner-point grid library
|
||||||
|
#
|
||||||
|
# Defines the following variables:
|
||||||
|
# opm-grid_INCLUDE_DIRS Directory of header files
|
||||||
|
# opm-grid_LIBRARIES Directory of shared object files
|
||||||
|
# opm-grid_DEFINITIONS Defines that must be set to compile
|
||||||
|
# opm-grid_CONFIG_VARS List of defines that should be in config.h
|
||||||
|
# HAVE_OPM_GRID Binary value to use in config.h
|
||||||
|
|
||||||
|
# Copyright (C) 2013 Uni Research AS
|
||||||
|
# This code is licensed under The GNU General Public License v3.0
|
||||||
|
|
||||||
|
include (opm-grid-prereqs)
|
||||||
|
include (OpmPackage)
|
||||||
|
find_opm_package (
|
||||||
|
# module name
|
||||||
|
"opm-grid"
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
"${opm-grid_DEPS}"
|
||||||
|
|
||||||
|
# header to search for
|
||||||
|
"dune/grid/CpGrid.hpp"
|
||||||
|
|
||||||
|
# library to search for
|
||||||
|
"opmgrid"
|
||||||
|
|
||||||
|
# defines to be added to compilations
|
||||||
|
"HAVE_OPM_GRID"
|
||||||
|
|
||||||
|
# test program
|
||||||
|
"#include <dune/grid/CpGrid.hpp>
|
||||||
|
int main (void) {
|
||||||
|
Dune::CpGrid g;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
# config variables
|
||||||
|
"${opm-grid_CONFIG_VAR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
#debug_find_vars ("opm-grid")
|
||||||
43
cmake/Modules/Findopm-material.cmake
Normal file
43
cmake/Modules/Findopm-material.cmake
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# - Find OPM materials library
|
||||||
|
#
|
||||||
|
# Defines the following variables:
|
||||||
|
# opm-material_INCLUDE_DIRS Directory of header files
|
||||||
|
# opm-material_LIBRARIES Directory of shared object files
|
||||||
|
# opm-material_DEFINITIONS Defines that must be set to compile
|
||||||
|
# opm-material_CONFIG_VARS List of defines that should be in config.h
|
||||||
|
# HAVE_OPM_MATERIAL Binary value to use in config.h
|
||||||
|
|
||||||
|
# Copyright (C) 2013 Uni Research AS
|
||||||
|
# This code is licensed under The GNU General Public License v3.0
|
||||||
|
|
||||||
|
# use the generic find routine
|
||||||
|
include (opm-material-prereqs)
|
||||||
|
include (OpmPackage)
|
||||||
|
find_opm_package (
|
||||||
|
# module name
|
||||||
|
"opm-material"
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
"${opm-material_DEPS}"
|
||||||
|
|
||||||
|
# header to search for
|
||||||
|
"opm/material/Constants.hpp"
|
||||||
|
|
||||||
|
# library to search for
|
||||||
|
""
|
||||||
|
|
||||||
|
# defines to be added to compilations
|
||||||
|
""
|
||||||
|
|
||||||
|
# test program
|
||||||
|
"#include <opm/material/Constants.hpp>
|
||||||
|
int main (void) {
|
||||||
|
double c = Opm::Constants<double>::c;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
# config variables
|
||||||
|
"${opm-material_CONFIG_VAR}"
|
||||||
|
)
|
||||||
|
include (UseDynamicBoost)
|
||||||
|
#debug_find_vars ("opm-material")
|
||||||
55
cmake/Modules/Findopm-output.cmake
Normal file
55
cmake/Modules/Findopm-output.cmake
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# - Find OPM output library
|
||||||
|
#
|
||||||
|
# Defines the following variables:
|
||||||
|
# opm-output_INCLUDE_DIRS Directory of header files
|
||||||
|
# opm-output_LIBRARIES Directory of shared object files
|
||||||
|
# opm-output_DEFINITIONS Defines that must be set to compile
|
||||||
|
# opm-output_CONFIG_VARS List of defines that should be in config.h
|
||||||
|
# HAVE_OPM_OUTPUT Binary value to use in config.h
|
||||||
|
|
||||||
|
# Copyright (C) 2012 Uni Research AS
|
||||||
|
# This code is licensed under The GNU General Public License v3.0
|
||||||
|
|
||||||
|
# use the generic find routine
|
||||||
|
include (opm-output-prereqs)
|
||||||
|
include (OpmPackage)
|
||||||
|
find_opm_package (
|
||||||
|
# module name
|
||||||
|
"opm-output"
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
"${opm-output_DEPS}"
|
||||||
|
|
||||||
|
# header to search for
|
||||||
|
"opm/output/OutputWriter.hpp"
|
||||||
|
|
||||||
|
# library to search for
|
||||||
|
"opmoutput"
|
||||||
|
|
||||||
|
# defines to be added to compilations
|
||||||
|
""
|
||||||
|
|
||||||
|
# test program
|
||||||
|
"#include <opm/output/eclipse/Summary.hpp>
|
||||||
|
int main (void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
# config variables
|
||||||
|
"${opm-output_CONFIG_VAR}"
|
||||||
|
)
|
||||||
|
include (UseDynamicBoost)
|
||||||
|
#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()
|
||||||
|
|
||||||
184
cmake/Modules/Findopm-parser.cmake
Normal file
184
cmake/Modules/Findopm-parser.cmake
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
# Find the OPM Eclipse input parser.
|
||||||
|
#
|
||||||
|
# Set the cache variable OPM_PARSER_ROOT to the install location of the
|
||||||
|
# library, or OPM_ROOT to the parent directory of the build tree.
|
||||||
|
#
|
||||||
|
# If found, it sets these variables:
|
||||||
|
#
|
||||||
|
# HAVE_OPM_PARSER Defined if a test program compiled
|
||||||
|
# OPM_PARSER_INCLUDE_DIRS Header file directories
|
||||||
|
# OPM_PARSER_LIBRARIES Archives and shared objects
|
||||||
|
|
||||||
|
include (FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
# variables to pass on to other packages
|
||||||
|
if (FIND_QUIETLY)
|
||||||
|
set (OPM_PARSER_QUIET "QUIET")
|
||||||
|
else ()
|
||||||
|
set (OPM_PARSER_QUIET "")
|
||||||
|
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
|
||||||
|
if ((NOT OPM_PARSER_ROOT) AND OPM_ROOT)
|
||||||
|
set (OPM_PARSER_ROOT "${OPM_ROOT}/opm-parser")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Detect the build dir suffix or subdirectory
|
||||||
|
string(REGEX REPLACE "${PROJECT_SOURCE_DIR}/?(.*)" "\\1" BUILD_DIR_SUFFIX "${PROJECT_BINARY_DIR}")
|
||||||
|
|
||||||
|
# if a root is specified, then don't search in system directories
|
||||||
|
# or in relative directories to this one
|
||||||
|
if (OPM_PARSER_ROOT)
|
||||||
|
set (_no_default_path "NO_DEFAULT_PATH")
|
||||||
|
set (_opm_parser_source "")
|
||||||
|
set (_opm_parser_build "")
|
||||||
|
else ()
|
||||||
|
set (_no_default_path "")
|
||||||
|
set (_opm_parser_source
|
||||||
|
"${PROJECT_SOURCE_DIR}/../opm-parser")
|
||||||
|
set (_opm_parser_build
|
||||||
|
"${PROJECT_BINARY_DIR}/../opm-parser"
|
||||||
|
"${PROJECT_BINARY_DIR}/../opm-parser${BUILD_DIR_SUFFIX}"
|
||||||
|
"${PROJECT_BINARY_DIR}/../../opm-parser/${BUILD_DIR_SUFFIX}")
|
||||||
|
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
|
||||||
|
NAMES "opm/parser/eclipse/Parser/ParserKeywords.hpp"
|
||||||
|
HINTS "${OPM_PARSER_ROOT}"
|
||||||
|
PATHS ${_opm_parser_build}
|
||||||
|
PATH_SUFFIXES "generated-source/include" "include"
|
||||||
|
DOC "Path to OPM parser generated header files"
|
||||||
|
${_no_default_path} )
|
||||||
|
|
||||||
|
|
||||||
|
# backup: if we didn't find any headers there, but a CMakeCache.txt,
|
||||||
|
# then it is probably a build directory; read the CMake cache of
|
||||||
|
# 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
|
||||||
|
)
|
||||||
|
|
||||||
|
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)
|
||||||
44
cmake/Modules/Findopm-simulators.cmake
Normal file
44
cmake/Modules/Findopm-simulators.cmake
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# - Find OPM automatic differentiation library
|
||||||
|
#
|
||||||
|
# Defines the following variables:
|
||||||
|
# opm-simulators_INCLUDE_DIRS Directory of header files
|
||||||
|
# opm-simulators_LIBRARIES Directory of shared object files
|
||||||
|
# opm-simulators_DEFINITIONS Defines that must be set to compile
|
||||||
|
# opm-simulators_CONFIG_VARS List of defines that should be in config.h
|
||||||
|
# HAVE_OPM_SIMULATORS Binary value to use in config.h
|
||||||
|
|
||||||
|
# Copyright (C) 2012 Uni Research AS
|
||||||
|
# This code is licensed under The GNU General Public License v3.0
|
||||||
|
|
||||||
|
# use the generic find routine
|
||||||
|
include (opm-simulators-prereqs)
|
||||||
|
include (OpmPackage)
|
||||||
|
find_opm_package (
|
||||||
|
# module name
|
||||||
|
"opm-simulators"
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
"${opm-simulators_DEPS}"
|
||||||
|
|
||||||
|
# header to search for
|
||||||
|
"opm/autodiff/AutoDiff.hpp"
|
||||||
|
|
||||||
|
# library to search for
|
||||||
|
"opmsimulators"
|
||||||
|
|
||||||
|
# defines to be added to compilations
|
||||||
|
""
|
||||||
|
|
||||||
|
# test program
|
||||||
|
"#include <opm/autodiff/AutoDiff.hpp>
|
||||||
|
int main (void) {
|
||||||
|
Opm::AutoDiff<double> x = Opm::AutoDiff<double>::constant(42.);
|
||||||
|
(void) x;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
# config variables
|
||||||
|
"${opm-simulators_CONFIG_VAR}"
|
||||||
|
)
|
||||||
|
include (UseDynamicBoost)
|
||||||
|
#debug_find_vars ("opm-simulators")
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
# This module searches for the opm-tests repository. Since opm-tests
|
|
||||||
# has no libraries or header files the find implementation is quite
|
|
||||||
# naive.
|
|
||||||
#
|
|
||||||
# If the opm-tests repository is found, the following variables are set:
|
|
||||||
#
|
|
||||||
# HAVE_OPM_TESTS
|
|
||||||
# OPM_TESTS_ROOT
|
|
||||||
|
|
||||||
if (OPM_TESTS_ROOT)
|
|
||||||
set( _opm_tests_root ${OPM_TESTS_ROOT})
|
|
||||||
else()
|
|
||||||
set( _opm_tests_root "${PROJECT_SOURCE_DIR}/../opm-tests")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
if (EXISTS "${_opm_tests_root}/norne/NORNE_ATW2013.DATA")
|
|
||||||
set( HAVE_OPM_DATA True )
|
|
||||||
set( HAVE_OPM_TESTS True )
|
|
||||||
set( OPM_TESTS_ROOT ${_opm_tests_root} )
|
|
||||||
set( OPM_DATA_ROOT ${_opm_tests_root} )
|
|
||||||
message(STATUS "Setting OPM_TESTS_ROOT: ${OPM_TESTS_ROOT}")
|
|
||||||
else()
|
|
||||||
set( HAVE_OPM_TESTS False )
|
|
||||||
set( HAVE_OPM_DATA False )
|
|
||||||
message(WARNING "opm-tests not found - integration tests using opm-tests will be skipped.")
|
|
||||||
endif()
|
|
||||||
@@ -16,36 +16,7 @@ function (linker_cmdline what INTO outvar FROM)
|
|||||||
# (you get an error message about argument not parsed). translate each
|
# (you get an error message about argument not parsed). translate each
|
||||||
# of the libraries into a linker option
|
# of the libraries into a linker option
|
||||||
set (deplib_list "")
|
set (deplib_list "")
|
||||||
set (deplib_list_tmp "")
|
|
||||||
foreach (deplib IN LISTS ARGN)
|
foreach (deplib IN LISTS ARGN)
|
||||||
# resolve imported targets
|
|
||||||
string(FIND ${deplib} "::" _sep)
|
|
||||||
if (_sep GREATER "-1")
|
|
||||||
set(_lib "")
|
|
||||||
# the code below does not really work for imported interface library
|
|
||||||
# as cmake will error out whene querying IMPORTED_LOCATION, because the
|
|
||||||
# property is not whitelisted. I have no idea how to determine if
|
|
||||||
# a library is an imported interface library
|
|
||||||
# At least it works for resolving OpenMP::OpenMP_CXX
|
|
||||||
#
|
|
||||||
# get_property(_def TARGET ${deplib} PROPERTY IMPORTED_LOCATION DEFINED)
|
|
||||||
# if (_def)
|
|
||||||
# get_property(_def TARGET ${deplib} PROPERTY IMPORTED_LOCATION SET)
|
|
||||||
# if (_def)
|
|
||||||
# get_target_property(_tmp_lib ${deplib} IMPORTED_LOCATION)
|
|
||||||
# list(APPEND _lib ${_tmp_lib})
|
|
||||||
# endif()
|
|
||||||
# endif()
|
|
||||||
get_property(_def TARGET ${deplib} PROPERTY INTERFACE_LINK_LIBRARIES SET)
|
|
||||||
if (_def)
|
|
||||||
get_target_property(_tmp_lib ${deplib} INTERFACE_LINK_LIBRARIES)
|
|
||||||
list(APPEND _lib ${_tmp_lib})
|
|
||||||
endif()
|
|
||||||
set(deplib ${_lib})
|
|
||||||
endif()
|
|
||||||
list(APPEND deplib_list_tmp ${deplib})
|
|
||||||
endforeach()
|
|
||||||
foreach (deplib IN LISTS deplib_list_tmp)
|
|
||||||
# starts with a hyphen already? then just add it
|
# starts with a hyphen already? then just add it
|
||||||
string (SUBSTRING ${deplib} 0 1 dash)
|
string (SUBSTRING ${deplib} 0 1 dash)
|
||||||
if (${dash} STREQUAL "-")
|
if (${dash} STREQUAL "-")
|
||||||
@@ -73,20 +44,18 @@ function (linker_cmdline what INTO outvar FROM)
|
|||||||
# is more or less lost. remove system default path, to lessen the
|
# is more or less lost. remove system default path, to lessen the
|
||||||
# chance that we pick the wrong library
|
# chance that we pick the wrong library
|
||||||
if (NOT ((deplib_dir STREQUAL "/usr/lib") OR
|
if (NOT ((deplib_dir STREQUAL "/usr/lib") OR
|
||||||
(deplib_dir STREQUAL "") OR
|
(deplib_dir STREQUAL "/usr/${CMAKE_INSTALL_LIBDIR}")))
|
||||||
(deplib_dir STREQUAL "/usr/${CMAKE_INSTALL_LIBDIR}")))
|
list (APPEND deplib_list "-L${deplib_dir}")
|
||||||
list (APPEND deplib_list "-L${deplib_dir}")
|
endif (NOT ((deplib_dir STREQUAL "/usr/lib") OR
|
||||||
endif ()
|
(deplib_dir STREQUAL "/usr/${CMAKE_INSTALL_LIBDIR}")))
|
||||||
# if there was no translation of the name, the library is named
|
# if there was no translation of the name, the library is named
|
||||||
# unconventionally (.so.3gf, I'm looking at you), so pass this
|
# unconventionally (.so.3gf, I'm looking at you), so pass this
|
||||||
# name unmodified to the linker switch
|
# name unmodified to the linker switch
|
||||||
if (deplib_orig STREQUAL deplib_name AND
|
if (deplib_orig STREQUAL deplib_name)
|
||||||
NOT deplib_orig STREQUAL "stdc++fs")
|
|
||||||
list (APPEND deplib_list "-l:${deplib_orig}")
|
list (APPEND deplib_list "-l:${deplib_orig}")
|
||||||
else ()
|
else (deplib_orig STREQUAL deplib_name)
|
||||||
list (APPEND deplib_list "-l${deplib_name}")
|
list (APPEND deplib_list "-l${deplib_name}")
|
||||||
endif (deplib_orig STREQUAL deplib_name AND
|
endif (deplib_orig STREQUAL deplib_name)
|
||||||
NOT deplib_orig STREQUAL "stdc++fs")
|
|
||||||
endif (${dash} STREQUAL "-")
|
endif (${dash} STREQUAL "-")
|
||||||
endforeach (deplib)
|
endforeach (deplib)
|
||||||
# caller determines whether we want it returned as a list or a string
|
# caller determines whether we want it returned as a list or a string
|
||||||
@@ -154,7 +123,7 @@ function (configure_la name target)
|
|||||||
mark_as_advanced (libtool_MAIN)
|
mark_as_advanced (libtool_MAIN)
|
||||||
# notify the user if it not found after we explicitly searched
|
# notify the user if it not found after we explicitly searched
|
||||||
if (NOT libtool_MAIN)
|
if (NOT libtool_MAIN)
|
||||||
message (STATUS "Not generating libtool archive (.la) since libtool was not found")
|
message (STATUS "Libtool not found!")
|
||||||
endif (NOT libtool_MAIN)
|
endif (NOT libtool_MAIN)
|
||||||
endif (NOT libtool_MAIN)
|
endif (NOT libtool_MAIN)
|
||||||
if (libtool_MAIN)
|
if (libtool_MAIN)
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ 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)
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
# Installs bash tab completion for a product
|
|
||||||
macro(opm_add_bash_completion binary)
|
|
||||||
option(USE_BASH_COMPLETIONS_DIR
|
|
||||||
"Whether to use the new bash completion dir (/usr/share/bash-completion/completions) with load on demand"
|
|
||||||
OFF)
|
|
||||||
if(USE_BASH_COMPLETIONS_DIR)
|
|
||||||
set(_BASH_COMPLETION_FILE ${binary})
|
|
||||||
set(_BASH_COMPLETION_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/bash-completion/completions)
|
|
||||||
else()
|
|
||||||
set(_BASH_COMPLETION_FILE ${binary}_bash_completion.sh)
|
|
||||||
set(_BASH_COMPLETION_INSTALL_DIR ${CMAKE_INSTALL_SYSCONFDIR}/bash_completion.d)
|
|
||||||
endif()
|
|
||||||
set(PRODUCT ${binary})
|
|
||||||
configure_file(${OPM_MACROS_ROOT}/etc/opm_bash_completion.sh.in ${_BASH_COMPLETION_FILE} @ONLY)
|
|
||||||
install(FILES ${PROJECT_BINARY_DIR}/${_BASH_COMPLETION_FILE} DESTINATION ${_BASH_COMPLETION_INSTALL_DIR})
|
|
||||||
endmacro()
|
|
||||||
@@ -18,8 +18,6 @@ macro (opm_compile opm)
|
|||||||
if (SILENCE_CROSSMODULE_WARNINGS)
|
if (SILENCE_CROSSMODULE_WARNINGS)
|
||||||
include_directories("${PROJECT_SOURCE_DIR}")
|
include_directories("${PROJECT_SOURCE_DIR}")
|
||||||
include_directories (SYSTEM ${${opm}_INCLUDE_DIRS})
|
include_directories (SYSTEM ${${opm}_INCLUDE_DIRS})
|
||||||
set (${opm}_INCLUDE_DIR "${PROJECT_SOURCE_DIR}")
|
|
||||||
set (${opm}_INCLUDE_DIRS ${${opm}_INCLUDE_DIR} ${${opm}_INCLUDE_DIRS})
|
|
||||||
else()
|
else()
|
||||||
set (${opm}_INCLUDE_DIR "${PROJECT_SOURCE_DIR}")
|
set (${opm}_INCLUDE_DIR "${PROJECT_SOURCE_DIR}")
|
||||||
set (${opm}_INCLUDE_DIRS ${${opm}_INCLUDE_DIR} ${${opm}_INCLUDE_DIRS})
|
set (${opm}_INCLUDE_DIRS ${${opm}_INCLUDE_DIR} ${${opm}_INCLUDE_DIRS})
|
||||||
@@ -29,43 +27,22 @@ macro (opm_compile opm)
|
|||||||
|
|
||||||
# create this library, if there are any compilation units
|
# create this library, if there are any compilation units
|
||||||
link_directories (${${opm}_LIBRARY_DIRS})
|
link_directories (${${opm}_LIBRARY_DIRS})
|
||||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.12")
|
add_definitions (${${opm}_DEFINITIONS})
|
||||||
# Some modules may still export definitions using -D, strip it
|
|
||||||
string(REGEX REPLACE "-D" "" _clean_defs "${${opm}_DEFINITIONS}")
|
|
||||||
add_compile_definitions(${_clean_defs})
|
|
||||||
else()
|
|
||||||
add_definitions(${${opm}_DEFINITIONS})
|
|
||||||
endif()
|
|
||||||
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}
|
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
|
||||||
)
|
)
|
||||||
if (${${opm}_LIBRARY_TYPE} STREQUAL "SHARED")
|
target_link_libraries (${${opm}_TARGET} ${${opm}_LIBRARIES})
|
||||||
# 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)
|
||||||
|
|||||||
@@ -1,104 +0,0 @@
|
|||||||
# Check for various compiler extensions
|
|
||||||
|
|
||||||
# HAVE_ATTRIBUTE_ALWAYS_INLINE True if attribute always inline is supported
|
|
||||||
# HAS_ATTRIBUTE_UNUSED True if attribute unused is supported
|
|
||||||
# HAS_ATTRIBUTE_DEPRECATED True if attribute deprecated is supported
|
|
||||||
# HAS_ATTRIBUTE_DEPRECATED_MSG True if attribute deprecated("msg") is supported
|
|
||||||
|
|
||||||
include(CheckCXXSourceCompiles)
|
|
||||||
|
|
||||||
# __attribute__((always_inline))
|
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
|
||||||
void __attribute__((always_inline)) foo(void) {}
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
foo();
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
" HAVE_ATTRIBUTE_ALWAYS_INLINE
|
|
||||||
)
|
|
||||||
|
|
||||||
# __attribute__((unused))
|
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
int __attribute__((unused)) foo;
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
" HAS_ATTRIBUTE_UNUSED
|
|
||||||
)
|
|
||||||
|
|
||||||
# __attribute__((deprecated))
|
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
|
||||||
#define DEP __attribute__((deprecated))
|
|
||||||
class bar
|
|
||||||
{
|
|
||||||
bar() DEP;
|
|
||||||
};
|
|
||||||
|
|
||||||
class peng { } DEP;
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
class t_bar
|
|
||||||
{
|
|
||||||
t_bar() DEP;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
class t_peng {
|
|
||||||
t_peng() {};
|
|
||||||
} DEP;
|
|
||||||
|
|
||||||
void foo() DEP;
|
|
||||||
|
|
||||||
void foo() {};
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
" HAS_ATTRIBUTE_DEPRECATED
|
|
||||||
)
|
|
||||||
|
|
||||||
# __attribute__((deprecated("msg")))
|
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
|
||||||
#define DEP __attribute__((deprecated(\"message\")))
|
|
||||||
class bar {
|
|
||||||
bar() DEP;
|
|
||||||
};
|
|
||||||
|
|
||||||
class peng { } DEP;
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
class t_bar
|
|
||||||
{
|
|
||||||
t_bar() DEP;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
class t_peng
|
|
||||||
{
|
|
||||||
t_peng() {};
|
|
||||||
} DEP;
|
|
||||||
|
|
||||||
void foo() DEP;
|
|
||||||
|
|
||||||
void foo() {};
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
" HAS_ATTRIBUTE_DEPRECATED_MSG
|
|
||||||
)
|
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
|
|
||||||
list(APPEND ${project}_LIBRARIES stdc++fs)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(OPM_CLANG_WITH_STDC++FS "Using libstdc++ with clang and we want to link to stdc++fs" OFF)
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND OPM_CLANG_WITH_STDC++FS)
|
|
||||||
list(APPEND ${project}_LIBRARIES stdc++fs)
|
|
||||||
endif()
|
|
||||||
@@ -5,8 +5,6 @@ is_compiler_gcc_compatible ()
|
|||||||
include(TestCXXAcceptsFlag)
|
include(TestCXXAcceptsFlag)
|
||||||
|
|
||||||
macro (opm_defaults opm)
|
macro (opm_defaults opm)
|
||||||
|
|
||||||
message("Processing opm_defaults ${opm}")
|
|
||||||
# if we are installing a development version (default when checking out of
|
# if we are installing a development version (default when checking out of
|
||||||
# VCS), then remember which directories were used when configuring. package
|
# VCS), then remember which directories were used when configuring. package
|
||||||
# distribution should disable this option.
|
# distribution should disable this option.
|
||||||
@@ -49,7 +47,7 @@ macro (opm_defaults opm)
|
|||||||
endif(NOT PRECOMPILE_HEADERS)
|
endif(NOT PRECOMPILE_HEADERS)
|
||||||
|
|
||||||
# Use of OpenMP is considered experimental
|
# Use of OpenMP is considered experimental
|
||||||
set (USE_OPENMP_DEFAULT ON)
|
set (USE_OPENMP_DEFAULT OFF)
|
||||||
|
|
||||||
# if we are on a system where CMake 2.6 is the default (Hi RHEL 6!),
|
# if we are on a system where CMake 2.6 is the default (Hi RHEL 6!),
|
||||||
# the configuration files for Boost will trip up the library paths
|
# the configuration files for Boost will trip up the library paths
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
macro (opm_out_dirs)
|
macro (opm_out_dirs)
|
||||||
# put libraries in lib/ (no multi-arch support in build tree)
|
# put libraries in lib/ (no multi-arch support in build tree)
|
||||||
if(MAIN_SOURCE_FILES)
|
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
|
||||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
|
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
|
||||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
|
|
||||||
endif()
|
|
||||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
|
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
|
||||||
set (CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles")
|
set (CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles")
|
||||||
endmacro (opm_out_dirs)
|
endmacro (opm_out_dirs)
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
# )
|
# )
|
||||||
|
|
||||||
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
|
||||||
@@ -54,6 +53,18 @@ foreach (name IN LISTS _opm_proj_vars)
|
|||||||
endif (NOT DEFINED ${CMAKE_PROJECT_NAME}_${name})
|
endif (NOT DEFINED ${CMAKE_PROJECT_NAME}_${name})
|
||||||
endforeach (name)
|
endforeach (name)
|
||||||
|
|
||||||
|
# these dependencies must always be handled by the find module
|
||||||
|
set (_opm_proj_exemptions
|
||||||
|
dune-common
|
||||||
|
dune-istl
|
||||||
|
dune-grid
|
||||||
|
dune-geometry
|
||||||
|
opm-parser
|
||||||
|
)
|
||||||
|
|
||||||
|
# although a DUNE module, it is delivered in the OPM suite
|
||||||
|
set (opm-core_SUITE "opm")
|
||||||
|
set (ewoms_SUITE "opm")
|
||||||
|
|
||||||
# insert this boilerplate whenever we are going to find a new package
|
# insert this boilerplate whenever we are going to find a new package
|
||||||
macro (find_and_append_package_to prefix name)
|
macro (find_and_append_package_to prefix name)
|
||||||
@@ -104,66 +115,44 @@ macro (find_and_append_package_to prefix name)
|
|||||||
endif (EXISTS ${${NAME}_ROOT}/${name}-config.cmake OR EXISTS ${${NAME}_ROOT}/${name}Config.cmake)
|
endif (EXISTS ${${NAME}_ROOT}/${name}-config.cmake OR EXISTS ${${NAME}_ROOT}/${name}Config.cmake)
|
||||||
endif (NOT DEFINED ${name}_DIR AND (DEFINED ${name}_ROOT OR DEFINED ${NAME}_ROOT))
|
endif (NOT DEFINED ${name}_DIR AND (DEFINED ${name}_ROOT OR DEFINED ${NAME}_ROOT))
|
||||||
|
|
||||||
|
# these libraries need special handling which is not provided in
|
||||||
|
# the -config.cmake file, but which must be provided by this project,
|
||||||
|
# something which is done in our find module
|
||||||
|
list (FIND _opm_proj_exemptions "${name}" _${name}_exempted)
|
||||||
|
if ((NOT (_${name}_exempted EQUAL -1)) AND (DEFINED ${name}_DIR))
|
||||||
|
set (${name}_ROOT "${${name}_DIR}")
|
||||||
|
# store this for later, in case we reconfigure
|
||||||
|
set (${name}_ROOT "${${name}_ROOT}" CACHE LOCATION "Path to ${name}")
|
||||||
|
# clear this to not use config mode
|
||||||
|
unset (${name}_DIR)
|
||||||
|
# variables that are given on the command-line is also put in the cache
|
||||||
|
# removing the local copy only "unshadows" this one
|
||||||
|
unset (${name}_DIR CACHE)
|
||||||
|
endif ((NOT (_${name}_exempted EQUAL -1)) AND (DEFINED ${name}_DIR))
|
||||||
|
|
||||||
# if we're told not to look for the package, pretend it was never found
|
# if we're told not to look for the package, pretend it was never found
|
||||||
if (CMAKE_DISABLE_FIND_PACKAGE_${name})
|
if (CMAKE_DISABLE_FIND_PACKAGE_${name})
|
||||||
# If required send an error
|
set (${name}_FOUND FALSE)
|
||||||
cmake_parse_arguments(FIND "REQUIRED" "" "" ${ARGN} )
|
set (${NAME}_FOUND FALSE)
|
||||||
set (${name}_FOUND FALSE)
|
|
||||||
set (${NAME}_FOUND FALSE)
|
|
||||||
if (FIND_REQUIRED)
|
|
||||||
message(SEND_ERROR "package ${name} but disable with CMAKE_DISABLE_FIND_PACKAGE_${name}")
|
|
||||||
endif ()
|
|
||||||
else ()
|
else ()
|
||||||
# List of components might differ for every module. Therefore we will
|
# using config mode is better than using module (aka. find) mode
|
||||||
# need to research for a library multiple times. _search_components
|
# because then the package has already done all its probes and
|
||||||
# will hold the index of the string COMPONENTS in the list
|
# stored them in the config file for us
|
||||||
set(_ARGN_LIST ${ARGN}) # Create a real list to use with list commands
|
if (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND)
|
||||||
list(FIND _ARGN_LIST "COMPONENTS" _search_components)
|
if (${name}_DIR)
|
||||||
|
message (STATUS "Finding package ${name} using config mode")
|
||||||
# using config mode is better than using module (aka. find) mode
|
find_package (${name} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
|
||||||
# because then the package has already done all its probes and
|
else ()
|
||||||
# stored them in the config file for us
|
message (STATUS "Finding package ${name} using module mode")
|
||||||
# For dune and opm modules and exempted packages we force module mode.
|
find_package (${name} ${ARGN})
|
||||||
# For dune and opm it will use config mode underneath.
|
endif ()
|
||||||
# We even need to repeat the search for opm-common once as this is done
|
endif ()
|
||||||
# in the top most CMakeLists.txt without querying defines, setting dependencies
|
if (NOT DEFINED ${name}_FOUND)
|
||||||
# and the likes which is only done via opm_find_package
|
set (${name}_FOUND "${${NAME}_FOUND}")
|
||||||
if ( (NOT DEFINED ${name}_FOUND AND NOT DEFINED ${NAME}_FOUND )
|
endif ()
|
||||||
OR _search_components GREATER -1)
|
if (NOT DEFINED ${NAME}_FOUND)
|
||||||
string(REGEX MATCH "(opm)-.*" _is_opm ${name})
|
set (${NAME}_FOUND "${${name}_FOUND}")
|
||||||
if(NOT _is_opm)
|
endif ()
|
||||||
# When using Boost >= 1.70 and e.g. CMake 3.18 we need to make sure that
|
|
||||||
# subsequent searches are using config mode too. Otherwise the library
|
|
||||||
# list will be completely messed up. We use a set Boost_Dir to detect that
|
|
||||||
# previous searches were done using config mode.
|
|
||||||
if("${name}" STREQUAL "Boost" AND Boost_DIR)
|
|
||||||
set(_CONFIG_MODE CONFIG)
|
|
||||||
else()
|
|
||||||
set(_CONFIG_MODE "")
|
|
||||||
endif()
|
|
||||||
find_package (${name} ${ARGN} ${_CONFIG_MODE})
|
|
||||||
else()
|
|
||||||
if(${name}_DIR)
|
|
||||||
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE PATHS ${${name}_DIR} NO_DEFAULT_PATH)
|
|
||||||
else()
|
|
||||||
find_package (${name} ${${prefix}_VERSION_MAJOR}.${${prefix}_VERSION_MINOR} ${ARGN} NO_MODULE)
|
|
||||||
endif()
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
if(${name}_FOUND AND ${name}_LIBRARY STREQUAL "")
|
|
||||||
find_package_handle_standard_args(${name}
|
|
||||||
REQUIRED_VARS ${name}_INCLUDE_DIRS)
|
|
||||||
else()
|
|
||||||
find_package_handle_standard_args(${name}
|
|
||||||
REQUIRED_VARS ${name}_LIBRARY)
|
|
||||||
endif()
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
if (NOT DEFINED ${name}_FOUND)
|
|
||||||
set (${name}_FOUND "${${NAME}_FOUND}")
|
|
||||||
endif ()
|
|
||||||
if (NOT DEFINED ${NAME}_FOUND)
|
|
||||||
set (${NAME}_FOUND "${${name}_FOUND}")
|
|
||||||
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
|
||||||
@@ -172,21 +161,7 @@ macro (find_and_append_package_to prefix name)
|
|||||||
string (REPLACE "-" "_" NAME "${NAME}")
|
string (REPLACE "-" "_" NAME "${NAME}")
|
||||||
|
|
||||||
if (${name}_FOUND OR ${NAME}_FOUND)
|
if (${name}_FOUND OR ${NAME}_FOUND)
|
||||||
foreach (var IN LISTS _opm_proj_vars)
|
foreach (var IN LISTS _opm_proj_vars)
|
||||||
if("${var}" STREQUAL "DEFINITIONS"
|
|
||||||
AND CMAKE_VERSION VERSION_LESS "3.12")
|
|
||||||
# For old Cmake versions we use add_definitions which
|
|
||||||
# requires -D qualifier add that
|
|
||||||
set(_defs)
|
|
||||||
foreach(_def IN LISTS ${name}_${var})
|
|
||||||
if(_def MATCHES "^[a-zA-Z].*")
|
|
||||||
list(APPEND _defs "-D${_def}")
|
|
||||||
else()
|
|
||||||
list(APPEND _defs "${_def}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
set(${name}_${var} "${_defs}")
|
|
||||||
endif()
|
|
||||||
if (DEFINED ${name}_${var})
|
if (DEFINED ${name}_${var})
|
||||||
list (APPEND ${prefix}_${var} ${${name}_${var}})
|
list (APPEND ${prefix}_${var} ${${name}_${var}})
|
||||||
# some packages define an uppercase version of their own name
|
# some packages define an uppercase version of their own name
|
||||||
|
|||||||
@@ -12,59 +12,6 @@
|
|||||||
# This module should be the first to be included in the project,
|
# This module should be the first to be included in the project,
|
||||||
# because most of the others (OpmXxx.cmake) use these variables.
|
# because most of the others (OpmXxx.cmake) use these variables.
|
||||||
|
|
||||||
# for CMake >= 3.0, we need to change a few policies:
|
|
||||||
#
|
|
||||||
# - CMP0026 to allow access to the LOCATION target property
|
|
||||||
# - CMP0048 to indicate that we want to deal with the *VERSION*
|
|
||||||
# variables ourselves
|
|
||||||
# - CMP0064 to indicate that we want TEST if conditions to be evaluated
|
|
||||||
# - CMP0074 to indicate that <PackageName>_ROOT can be used to find package
|
|
||||||
# config files
|
|
||||||
macro(OpmSetPolicies)
|
|
||||||
if (POLICY CMP0026)
|
|
||||||
# Needed as we query LOCATION in OpmCompile.cmake and OpmSatellites.cmake
|
|
||||||
cmake_policy(SET CMP0026 OLD)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (POLICY CMP0048)
|
|
||||||
# We do not set version. Hence NEW should work and this can be removed later
|
|
||||||
cmake_policy(SET CMP0048 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(POLICY CMP0064)
|
|
||||||
cmake_policy(SET CMP0064 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# set the behavior of the policy 0054 to NEW. (i.e. do not implicitly
|
|
||||||
# expand variables in if statements)
|
|
||||||
if (POLICY CMP0054)
|
|
||||||
cmake_policy(SET CMP0054 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# set the behavior of policy 0074 to new as we always used <PackageName>_ROOT as the
|
|
||||||
# root of the installation
|
|
||||||
if(POLICY CMP0074)
|
|
||||||
cmake_policy(SET CMP0074 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# include special
|
|
||||||
if (CMAKE_VERSION VERSION_LESS "2.8.3")
|
|
||||||
message (STATUS "Enabling compatibility modules for CMake 2.8.3")
|
|
||||||
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.3")
|
|
||||||
endif (CMAKE_VERSION VERSION_LESS "2.8.3")
|
|
||||||
|
|
||||||
if (CMAKE_VERSION VERSION_LESS "2.8.5")
|
|
||||||
message (STATUS "Enabling compatibility modules for CMake 2.8.5")
|
|
||||||
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.5")
|
|
||||||
endif (CMAKE_VERSION VERSION_LESS "2.8.5")
|
|
||||||
|
|
||||||
if (CMAKE_VERSION VERSION_LESS "2.8.7")
|
|
||||||
message (STATUS "Enabling compatibility modules for CMake 2.8.7")
|
|
||||||
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.7")
|
|
||||||
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
|
|
||||||
# helper macro to retrieve a single field of a dune.module file
|
# helper macro to retrieve a single field of a dune.module file
|
||||||
macro(OpmGetDuneModuleDirective field variable contents)
|
macro(OpmGetDuneModuleDirective field variable contents)
|
||||||
string (REGEX MATCH ".*${field}:[ ]*([^\n]+).*" ${variable} "${contents}")
|
string (REGEX MATCH ".*${field}:[ ]*([^\n]+).*" ${variable} "${contents}")
|
||||||
@@ -113,9 +60,6 @@ endmacro ()
|
|||||||
OpmInitProjVars ()
|
OpmInitProjVars ()
|
||||||
OpmInitDirVars ()
|
OpmInitDirVars ()
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
|
|
||||||
include(OpmPackage)
|
|
||||||
|
|
||||||
# if we are backporting this release to a system which already have an
|
# if we are backporting this release to a system which already have an
|
||||||
# earlier version, set this flag to have everything scoped into a directory
|
# earlier version, set this flag to have everything scoped into a directory
|
||||||
# which incorporates the label of the release. this is done by interjecting
|
# which incorporates the label of the release. this is done by interjecting
|
||||||
@@ -127,24 +71,3 @@ if (USE_VERSIONED_DIR)
|
|||||||
else ()
|
else ()
|
||||||
set (${project}_VER_DIR "")
|
set (${project}_VER_DIR "")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# parallel computing must be explicitly enabled
|
|
||||||
# This needs to be in OpmInit as prereqs is called before OpmLibMain is included.
|
|
||||||
option (USE_MPI "Use Message Passing Interface for parallel computing" OFF)
|
|
||||||
if (NOT USE_MPI)
|
|
||||||
set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# Compiler standard version needs to be requested here as prereqs is included
|
|
||||||
# before OpmLibMain and some tests need/use CXX_STANDARD_VERSION (e.g. pybind11)
|
|
||||||
# Languages and global compiler settings
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
||||||
|
|
||||||
# quadmath must be explicitly enabled
|
|
||||||
# This needs to be in OpmInit as prereqs is called before OpmLibMain is included.
|
|
||||||
option (USE_QUADMATH "Use high precision floating point library (slow)" OFF)
|
|
||||||
if (NOT USE_QUADMATH)
|
|
||||||
set (CMAKE_DISABLE_FIND_PACKAGE_QuadMath TRUE)
|
|
||||||
endif ()
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# _TARGET CMake target which builds the library
|
# _TARGET CMake target which builds the library
|
||||||
# _LIBRARY_TYPE Static or shared library
|
# _LIBRARY_TYPE Static or shared library
|
||||||
# _DEBUG File containing debug symbols
|
# _DEBUG File containing debug symbols
|
||||||
include (GNUInstallDirs)
|
include (UseMultiArch)
|
||||||
|
|
||||||
macro (opm_install opm)
|
macro (opm_install opm)
|
||||||
foreach (_hdr IN LISTS ${opm}_HEADERS)
|
foreach (_hdr IN LISTS ${opm}_HEADERS)
|
||||||
@@ -20,16 +20,10 @@ macro (opm_install opm)
|
|||||||
)
|
)
|
||||||
endforeach (_hdr)
|
endforeach (_hdr)
|
||||||
install (
|
install (
|
||||||
TARGETS ${${opm}_TARGET} ${${opm}_EXTRA_TARGETS}
|
TARGETS ${${opm}_TARGET}
|
||||||
EXPORT ${opm}-targets
|
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${${opm}_VER_DIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${${opm}_VER_DIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${${opm}_VER_DIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${${opm}_VER_DIR}
|
||||||
)
|
)
|
||||||
if(NOT "${${opm}_TARGET}" STREQUAL "")
|
|
||||||
export(TARGETS ${${opm}_TARGET} ${${opm}_EXTRA_TARGETS}
|
|
||||||
FILE ${opm}-targets.cmake)
|
|
||||||
install(EXPORT ${opm}-targets DESTINATION "share/cmake/${opm}")
|
|
||||||
endif()
|
|
||||||
# only /usr/lib/debug seems to be searched for debug info; if we have
|
# only /usr/lib/debug seems to be searched for debug info; if we have
|
||||||
# write access to that directory (package installation), then default
|
# write access to that directory (package installation), then default
|
||||||
# to use it; otherwise put the debug files together with the library
|
# to use it; otherwise put the debug files together with the library
|
||||||
@@ -40,7 +34,7 @@ macro (opm_install opm)
|
|||||||
set (_sys_dbg_def OFF)
|
set (_sys_dbg_def OFF)
|
||||||
endif (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
|
endif (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
|
||||||
option (SYSTEM_DEBUG "Put .debug files in GDB debug file directory" ${_sys_dbg_def})
|
option (SYSTEM_DEBUG "Put .debug files in GDB debug file directory" ${_sys_dbg_def})
|
||||||
set (DEBUG_FILE_DIRECTORY /usr/lib/debug CACHE PATH "GDB debug file directory")
|
set (DEBUG_FILE_DIRECTORY /usr/lib/debug CACHE LOCATION "GDB debug file directory")
|
||||||
mark_as_advanced (DEBUG_FILE_DIRECTORY)
|
mark_as_advanced (DEBUG_FILE_DIRECTORY)
|
||||||
if (SYSTEM_DEBUG AND NOT APPLE)
|
if (SYSTEM_DEBUG AND NOT APPLE)
|
||||||
set (_dbg_prefix "${DEBUG_FILE_DIRECTORY}/")
|
set (_dbg_prefix "${DEBUG_FILE_DIRECTORY}/")
|
||||||
@@ -65,10 +59,6 @@ macro (opm_install opm)
|
|||||||
# multiarch-aware and will thus put in lib64/ on RHEL and lib/ on Debian
|
# multiarch-aware and will thus put in lib64/ on RHEL and lib/ on Debian
|
||||||
install (
|
install (
|
||||||
FILES ${PROJECT_SOURCE_DIR}/dune.module
|
FILES ${PROJECT_SOURCE_DIR}/dune.module
|
||||||
DESTINATION lib/${${opm}_VER_DIR}/dunecontrol/${${opm}_NAME}
|
DESTINATION ${LIBDIR_MULTIARCH_UNAWARE}${${opm}_VER_DIR}/dunecontrol/${${opm}_NAME}
|
||||||
)
|
)
|
||||||
install (
|
|
||||||
FILES ${PROJECT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}-prereqs.cmake
|
|
||||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/opm/cmake/Modules
|
|
||||||
)
|
|
||||||
endmacro (opm_install opm)
|
endmacro (opm_install opm)
|
||||||
|
|||||||
@@ -15,13 +15,49 @@
|
|||||||
# tests_hook Do special processing before tests are compiled
|
# tests_hook Do special processing before tests are compiled
|
||||||
# files_hook Do special processing before final targets are added
|
# files_hook Do special processing before final targets are added
|
||||||
|
|
||||||
|
# for CMake >= 3.0, we need to change a few policies:
|
||||||
|
#
|
||||||
|
# - CMP0026 to allow access to the LOCATION target property
|
||||||
|
# - CMP0048 to indicate that we want to deal with the *VERSION*
|
||||||
|
# variables ourselves
|
||||||
|
if (POLICY CMP0026)
|
||||||
|
cmake_policy(SET CMP0026 OLD)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (POLICY CMP0048)
|
||||||
|
cmake_policy(SET CMP0048 OLD)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# set the behavior of the policy 0054 to NEW. (i.e. do not implicitly
|
||||||
|
# expand variables in if statements)
|
||||||
|
if (POLICY CMP0054)
|
||||||
|
cmake_policy(SET CMP0054 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# include special
|
||||||
|
if (CMAKE_VERSION VERSION_LESS "2.8.3")
|
||||||
|
message (STATUS "Enabling compatibility modules for CMake 2.8.3")
|
||||||
|
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.3")
|
||||||
|
endif (CMAKE_VERSION VERSION_LESS "2.8.3")
|
||||||
|
|
||||||
|
if (CMAKE_VERSION VERSION_LESS "2.8.5")
|
||||||
|
message (STATUS "Enabling compatibility modules for CMake 2.8.5")
|
||||||
|
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.5")
|
||||||
|
endif (CMAKE_VERSION VERSION_LESS "2.8.5")
|
||||||
|
|
||||||
|
if (CMAKE_VERSION VERSION_LESS "2.8.7")
|
||||||
|
message (STATUS "Enabling compatibility modules for CMake 2.8.7")
|
||||||
|
list (APPEND CMAKE_MODULE_PATH "${OPM_MACROS_ROOT}/cmake/Modules/compat-2.8.7")
|
||||||
|
endif (CMAKE_VERSION VERSION_LESS "2.8.7")
|
||||||
|
|
||||||
# don't write default flags into the cache, preserve that for user set values
|
# don't write default flags into the cache, preserve that for user set values
|
||||||
include (AddOptions)
|
include (AddOptions)
|
||||||
no_default_options ()
|
no_default_options ()
|
||||||
|
|
||||||
# Various compiler extension checks
|
# C++ project
|
||||||
include(OpmCompilerChecks)
|
project (${${project}_NAME})
|
||||||
|
enable_language (C)
|
||||||
|
enable_language (CXX)
|
||||||
|
|
||||||
# print system information to better pinpoint issues from log alone
|
# print system information to better pinpoint issues from log alone
|
||||||
include (UseSystemInfo)
|
include (UseSystemInfo)
|
||||||
@@ -52,10 +88,13 @@ include (UseOptimization)
|
|||||||
|
|
||||||
# turn on all warnings; this must be done before adding any
|
# turn on all warnings; this must be done before adding any
|
||||||
# dependencies, in case they alter the list of warnings
|
# dependencies, in case they alter the list of warnings
|
||||||
option(OPM_DISABLE_WARNINGS "Disable warning flags" OFF)
|
include (UseWarnings)
|
||||||
if(NOT OPM_DISABLE_WARNINGS)
|
|
||||||
include (UseWarnings)
|
# parallel computing must be explicitly enabled
|
||||||
endif()
|
option (USE_MPI "Use Message Passing Interface for parallel computing" OFF)
|
||||||
|
if (NOT USE_MPI)
|
||||||
|
set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
|
||||||
|
endif (NOT USE_MPI)
|
||||||
|
|
||||||
# parallel programming
|
# parallel programming
|
||||||
include (UseOpenMP)
|
include (UseOpenMP)
|
||||||
@@ -63,16 +102,6 @@ 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 ()
|
||||||
@@ -99,7 +128,7 @@ include (UseDebugSymbols)
|
|||||||
include (UseDynamicBoost)
|
include (UseDynamicBoost)
|
||||||
|
|
||||||
# needed for Debian installation scheme
|
# needed for Debian installation scheme
|
||||||
include (GNUInstallDirs)
|
include (UseMultiArch)
|
||||||
|
|
||||||
# Run conditional file hook
|
# Run conditional file hook
|
||||||
files_hook()
|
files_hook()
|
||||||
@@ -223,13 +252,9 @@ macro (cond_disable_test name)
|
|||||||
endif ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
|
endif ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
|
||||||
endmacro (cond_disable_test name)
|
endmacro (cond_disable_test name)
|
||||||
|
|
||||||
# use this target to run all tests, with parallel execution
|
# use this target to run all tests
|
||||||
cmake_host_system_information(RESULT TESTJOBS QUERY NUMBER_OF_PHYSICAL_CORES)
|
|
||||||
if(TESTJOBS EQUAL 0)
|
|
||||||
set(TESTJOBS 1)
|
|
||||||
endif()
|
|
||||||
add_custom_target (check
|
add_custom_target (check
|
||||||
COMMAND ${CMAKE_CTEST_COMMAND} -j${TESTJOBS}
|
COMMAND ${CMAKE_CTEST_COMMAND}
|
||||||
DEPENDS test-suite
|
DEPENDS test-suite
|
||||||
COMMENT "Checking if library is functional"
|
COMMENT "Checking if library is functional"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
@@ -241,11 +266,10 @@ if (COMMAND tests_hook)
|
|||||||
endif (COMMAND tests_hook)
|
endif (COMMAND tests_hook)
|
||||||
|
|
||||||
# make datafiles necessary for tests available in output directory
|
# make datafiles necessary for tests available in output directory
|
||||||
opm_data (tests datafiles "${tests_DIR}")
|
if (BUILD_TESTING)
|
||||||
if(NOT BUILD_TESTING)
|
opm_data (tests datafiles "${tests_DIR}")
|
||||||
set(excl_all EXCLUDE_FROM_ALL)
|
opm_compile_satellites (${project} tests "" "${tests_REGEXP}")
|
||||||
endif()
|
endif (BUILD_TESTING)
|
||||||
opm_compile_satellites (${project} tests "${excl_all}" "${tests_REGEXP}")
|
|
||||||
|
|
||||||
# use this target to check local git commits
|
# use this target to check local git commits
|
||||||
add_custom_target(check-commits
|
add_custom_target(check-commits
|
||||||
@@ -259,6 +283,9 @@ add_custom_target(check-commits
|
|||||||
include (OpmDoc)
|
include (OpmDoc)
|
||||||
opm_doc (${project} ${doxy_dir})
|
opm_doc (${project} ${doxy_dir})
|
||||||
|
|
||||||
|
# provide compatibility with using this build in dunecontrol
|
||||||
|
include (DuneCompat)
|
||||||
|
|
||||||
### clean in-source builds ###
|
### clean in-source builds ###
|
||||||
include (OpmDistClean)
|
include (OpmDistClean)
|
||||||
opm_dist_clean (${project})
|
opm_dist_clean (${project})
|
||||||
|
|||||||
@@ -37,7 +37,9 @@
|
|||||||
# <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)
|
||||||
@@ -55,11 +57,8 @@ 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 ()
|
return ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# variables to pass on to other packages
|
# variables to pass on to other packages
|
||||||
@@ -74,119 +73,210 @@ 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)
|
||||||
|
|
||||||
create_module_dir_var(${module})
|
# see if there is a pkg-config entry for this package, and use those
|
||||||
|
# settings as a starting point
|
||||||
|
find_package (PkgConfig)
|
||||||
|
pkg_check_modules (PkgConf_${module} QUIET ${module})
|
||||||
|
|
||||||
# This will also set all the needed variables with the exception of
|
# these variables have non-standard names in FindPkgConfig (sic)
|
||||||
# ${module}_CONFIG_VARS for dune modules.
|
set (${module}_DEFINITIONS ${PkgConf_${module}_CFLAGS_OTHER})
|
||||||
find_package(${module} ${_${module}_quiet} ${_${module}_required} CONFIG)
|
set (${module}_LINKER_FLAG ${PkgConf_${module}_LDFLAGS_OTHER})
|
||||||
|
|
||||||
if(NOT ${module}_DEPS)
|
# try to figure out whether we are in a subdir build tree, and attempt
|
||||||
# set the dependencies used in find_package_deps
|
# to put the same name as the appropriate build tree for the module
|
||||||
set(${module}_DEPS "${deps}")
|
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()
|
endif()
|
||||||
find_package_deps(${module})
|
if(${module}_ROOT})
|
||||||
|
set(workaround_cmake_bug 1)
|
||||||
# since find_and_append_package_to is a macro, this variable have
|
|
||||||
# probably been overwritten (due to its common name); it is now
|
|
||||||
# this module's last dependency instead of the name of the module
|
|
||||||
# itself, so it must be restored
|
|
||||||
string (TOUPPER "${module}" MODULE_UPPER)
|
|
||||||
string (REPLACE "-" "_" MODULE "${MODULE_UPPER}")
|
|
||||||
|
|
||||||
# compile with this option to avoid avalanche of warnings
|
|
||||||
set (${module}_DEFINITIONS "${${module}_DEFINITIONS}")
|
|
||||||
# -D to compile definitions for older CMake versions
|
|
||||||
set (_D_PREFIX "")
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "3.12")
|
|
||||||
set(_D_PREFIX "-D")
|
|
||||||
endif()
|
endif()
|
||||||
foreach (_def IN ITEMS ${defs})
|
if(${MODULE}_ROOT})
|
||||||
if(_def MATCHES "^[A-Za-z].*")
|
set(workaround_cmake_bug 1)
|
||||||
list (APPEND ${module}_DEFINITIONS "${_D_PREFIX}${_def}")
|
endif()
|
||||||
endif()
|
if (NOT workaround_cmake_bug)
|
||||||
endforeach (_def)
|
string (TOLOWER "${module}" _module_lower)
|
||||||
|
set (_guess
|
||||||
|
"../${module}"
|
||||||
|
"../${_module_lower}"
|
||||||
|
)
|
||||||
|
set (_guess_bin_only
|
||||||
|
"../${module}-build"
|
||||||
|
"../${_module_lower}-build"
|
||||||
|
)
|
||||||
|
|
||||||
list (APPEND ${module}_DEFINITIONS ${defs})
|
# 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)
|
||||||
|
|
||||||
# tidy the lists before returning them
|
# generate items that are in the build, not source dir
|
||||||
remove_dup_deps (${module})
|
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 ()
|
||||||
|
|
||||||
# these defines are used in dune/${module} headers, and should be put
|
# by specifying _guess in the HINTS section, it gets searched before
|
||||||
# in config.h when we include those
|
# the system locations as well. the CMake documentation has a cloudy
|
||||||
foreach (_var IN ITEMS ${conf})
|
# recommendation, but it ends up like this: if NO_DEFAULT_PATH is
|
||||||
# massage the name to remove source code formatting
|
# specified, then PATHS is used. Otherwise, it looks in HINTS, then in
|
||||||
string (REGEX REPLACE "^[\n\t\ ]+" "" _var "${_var}")
|
# system paths, and the finally in PATHS (!)
|
||||||
string (REGEX REPLACE "[\n\t\ ]+$" "" _var "${_var}")
|
if (SIBLING_SEARCH)
|
||||||
list (APPEND ${module}_CONFIG_VARS ${_var})
|
set (_guess_hints ${_guess})
|
||||||
endforeach (_var)
|
set (_guess_hints_bin ${_guess_bin})
|
||||||
|
else (SIBLING_SEARCH)
|
||||||
|
set (_guess_hints)
|
||||||
|
set (_guess_hints_bin)
|
||||||
|
endif (SIBLING_SEARCH)
|
||||||
|
|
||||||
# these are the defines that should be set when compiling
|
# if an include directory is specified directly (e.g. OPM_CORE_INCLUDE_DIR=
|
||||||
# without config.h
|
# /usr/include/opm-2013.03) then this overrides everything else. Notice that
|
||||||
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
|
# 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 ()
|
||||||
|
|
||||||
if(prog)
|
# search for this include and library file to get the installation
|
||||||
# check that we can compile a small test-program
|
# directory of the package; hints are searched before the system locations,
|
||||||
include (CMakePushCheckState)
|
# paths are searched afterwards
|
||||||
cmake_push_check_state ()
|
find_path (${module}_INCLUDE_DIR
|
||||||
include (CheckCXXSourceCompiles)
|
NAMES "${header}"
|
||||||
# only add these if they are actually found; otherwise it won't
|
PATHS ${_guess}
|
||||||
# compile and the variable won't be set
|
HINTS ${PkgConf_${module}_INCLUDE_DIRS} ${_guess_hints}
|
||||||
append_found (${module}_INCLUDE_DIRS CMAKE_REQUIRED_INCLUDES)
|
PATH_SUFFIXES "include"
|
||||||
append_found (${module}_LIBRARIES CMAKE_REQUIRED_LIBRARIES)
|
${_no_system_incl}
|
||||||
# since we don't have any config.h yet
|
)
|
||||||
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_DEFINITIONS})
|
|
||||||
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_CMD_CONFIG})
|
|
||||||
check_cxx_source_compiles ("${prog}" HAVE_${MODULE})
|
|
||||||
cmake_pop_check_state ()
|
|
||||||
else(prog)
|
|
||||||
if(${module}_FOUND)
|
|
||||||
# No test code provided, mark compilation as successful
|
|
||||||
# if module was founf
|
|
||||||
set(HAVE_${MODULE} 1)
|
|
||||||
endif(${module}_FOUND)
|
|
||||||
endif(prog)
|
|
||||||
|
|
||||||
# write status message in the same manner as everyone else
|
# some modules are all in headers
|
||||||
include (FindPackageHandleStandardArgs)
|
if (NOT "${lib}" STREQUAL "")
|
||||||
find_package_handle_standard_args (
|
if (CMAKE_SIZEOF_VOID_P)
|
||||||
${module}
|
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
|
||||||
DEFAULT_MSG
|
endif (CMAKE_SIZEOF_VOID_P)
|
||||||
${module}_INCLUDE_DIRS ${module}_LIBRARIES ${module}_FOUND ${module}_ALL_PREREQS HAVE_${MODULE}
|
|
||||||
)
|
|
||||||
|
|
||||||
# some genius that coded the FindPackageHandleStandardArgs figured out
|
# again, we may directly override the location of the library alone by
|
||||||
# that the module name should be in uppercase (?!)
|
# specifying e.g. OPM_CORE_LIB_DIR. notice that this is a *directory*
|
||||||
set (${module}_FOUND "${${MODULE_UPPER}_FOUND}")
|
# and not the name of the library
|
||||||
set (${MODULE}_FOUND "${${MODULE_UPPER}_FOUND}")
|
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 ()
|
||||||
|
|
||||||
# This variable is used by UseDuneVer
|
# if there is more than one library, then look for all of them, putting
|
||||||
list(GET ${module}_INCLUDE_DIRS 0 ${module}_INCLUDE_DIR)
|
# them in variables with the name of the library appended. however, the
|
||||||
# print everything out if we're asked to
|
# first entry is assumed to be the "primary" library and will be named
|
||||||
if (${module}_DEBUG)
|
# like the module. thus, with a lib entry of "foo;bar", the first library
|
||||||
debug_find_vars (${module})
|
# is called ${module}_LIBRARY and the second ${module}_LIBRARY_bar
|
||||||
endif (${module}_DEBUG)
|
foreach (_lib IN ITEMS ${lib})
|
||||||
endmacro (find_opm_package module deps header lib defs prog conf)
|
# 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 "")
|
||||||
|
|
||||||
macro (find_package_deps module)
|
# 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 ".")
|
||||||
foreach (_dep IN ITEMS ${${module}_DEPS})
|
foreach (_dep IN ITEMS ${deps})
|
||||||
separate_arguments (_${module}_args UNIX_COMMAND "${_dep}")
|
separate_arguments (_${module}_args UNIX_COMMAND ${_dep})
|
||||||
if (_${module}_args)
|
if (_${module}_args)
|
||||||
# keep REQUIRED in the arguments only if we were required ourself
|
# keep REQUIRED in the arguments only if we were required ourself
|
||||||
# "required-ness" is not transitive as far as CMake is concerned
|
# "required-ness" is not transitive as far as CMake is concerned
|
||||||
# (i.e. if an optional package requests a package to be required,
|
# (i.e. if an optional package requests a package to be required,
|
||||||
# the build will fail if it's not found)
|
# the build will fail if it's not found)
|
||||||
string (REPLACE "REQUIRED" "${_${module}_required}" _args_req "${_${module}_args}")
|
string (REPLACE "REQUIRED" "${_${module}_required}" _args_req "${_${module}_args}")
|
||||||
if(_dep MATCHES "opm-")
|
find_and_append_package_to (${module} ${_args_req} ${_${module}_quiet})
|
||||||
set(deplist ${_dep})
|
|
||||||
string(STRIP "${_dep}" _dep)
|
|
||||||
string(REPLACE " " ";" deplist "${_dep}")
|
|
||||||
list(GET deplist 0 depname)
|
|
||||||
create_module_dir_var(${depname})
|
|
||||||
endif()
|
|
||||||
find_and_append_package_to (${module} ${_${module}_args} ${_${module}_quiet})
|
|
||||||
list (GET _${module}_args 0 _name_only)
|
list (GET _${module}_args 0 _name_only)
|
||||||
string (TOUPPER "${_name_only}" _NAME_ONLY)
|
string (TOUPPER "${_name_only}" _NAME_ONLY)
|
||||||
string (REPLACE "-" "_" _NAME_ONLY "${_NAME_ONLY}")
|
string (REPLACE "-" "_" _NAME_ONLY "${_NAME_ONLY}")
|
||||||
@@ -200,29 +290,101 @@ macro (find_package_deps module)
|
|||||||
endif ()
|
endif ()
|
||||||
endforeach (_dep)
|
endforeach (_dep)
|
||||||
|
|
||||||
|
# since find_and_append_package_to is a macro, this variable have
|
||||||
|
# probably been overwritten (due to its common name); it is now
|
||||||
|
# this module's last dependency instead of the name of the module
|
||||||
|
# itself, so it must be restored
|
||||||
|
string (TOUPPER "${module}" MODULE_UPPER)
|
||||||
|
string (REPLACE "-" "_" MODULE "${MODULE_UPPER}")
|
||||||
|
|
||||||
|
# compile with this option to avoid avalanche of warnings
|
||||||
|
set (${module}_DEFINITIONS "${${module}_DEFINITIONS}")
|
||||||
|
foreach (_def IN ITEMS ${defs})
|
||||||
|
list (APPEND ${module}_DEFINITIONS "-D${_def}")
|
||||||
|
endforeach (_def)
|
||||||
|
|
||||||
# tidy the lists before returning them
|
# tidy the lists before returning them
|
||||||
remove_dup_deps (${module})
|
remove_dup_deps (${module})
|
||||||
|
|
||||||
# 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
|
||||||
# without config.h
|
# without config.h
|
||||||
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
|
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
|
||||||
|
|
||||||
# This variable is used by UseDuneVer
|
# check that we can compile a small test-program
|
||||||
list(GET ${module}_INCLUDE_DIRS 0 ${module}_INCLUDE_DIR)
|
include (CMakePushCheckState)
|
||||||
|
cmake_push_check_state ()
|
||||||
|
include (CheckCXXSourceCompiles)
|
||||||
|
# only add these if they are actually found; otherwise it won't
|
||||||
|
# compile and the variable won't be set
|
||||||
|
append_found (${module}_INCLUDE_DIRS CMAKE_REQUIRED_INCLUDES)
|
||||||
|
append_found (${module}_LIBRARIES CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
# since we don't have any config.h yet
|
||||||
|
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_DEFINITIONS})
|
||||||
|
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_CMD_CONFIG})
|
||||||
|
check_cxx_source_compiles ("${prog}" HAVE_${MODULE})
|
||||||
|
cmake_pop_check_state ()
|
||||||
|
|
||||||
|
# write status message in the same manner as everyone else
|
||||||
|
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 (
|
||||||
|
${module}
|
||||||
|
DEFAULT_MSG
|
||||||
|
${module}_INCLUDE_DIR ${_lib_var} HAVE_${MODULE} ${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
|
||||||
|
# that the module name should be in uppercase (?!)
|
||||||
|
set (${module}_FOUND "${${MODULE_UPPER}_FOUND}")
|
||||||
|
set (${MODULE}_FOUND "${${MODULE_UPPER}_FOUND}")
|
||||||
|
|
||||||
# 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})
|
||||||
endif (${module}_DEBUG)
|
endif (${module}_DEBUG)
|
||||||
endmacro ()
|
endmacro (find_opm_package module deps header lib defs prog conf)
|
||||||
|
|
||||||
# print all variables defined by the above macro
|
# print all variables defined by the above macro
|
||||||
function (debug_find_vars module)
|
function (debug_find_vars module)
|
||||||
@@ -233,7 +395,7 @@ function (debug_find_vars module)
|
|||||||
message (STATUS "${module}_CONFIG_VARS = ${${module}_CONFIG_VARS}")
|
message (STATUS "${module}_CONFIG_VARS = ${${module}_CONFIG_VARS}")
|
||||||
message (STATUS "${module}_LINKER_FLAGS = ${${module}_LINKER_FLAGS}")
|
message (STATUS "${module}_LINKER_FLAGS = ${${module}_LINKER_FLAGS}")
|
||||||
string (TOUPPER ${module} MODULE)
|
string (TOUPPER ${module} MODULE)
|
||||||
string (REPLACE "-" "_" MODULE ${MODULE})
|
string (REPLACE "-" "_" MODULE ${MODULE})
|
||||||
message (STATUS "HAVE_${MODULE} = ${HAVE_${MODULE}}")
|
message (STATUS "HAVE_${MODULE} = ${HAVE_${MODULE}}")
|
||||||
endfunction (debug_find_vars module)
|
endfunction (debug_find_vars module)
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ function (configure_pc_file name source dest prefix libdir includedir)
|
|||||||
set (minor "${${name}_VERSION_MINOR}")
|
set (minor "${${name}_VERSION_MINOR}")
|
||||||
set (target "${${name}_LIBRARY}")
|
set (target "${${name}_LIBRARY}")
|
||||||
linker_cmdline (STRING INTO target from ${target})
|
linker_cmdline (STRING INTO target from ${target})
|
||||||
|
|
||||||
configure_file (${source} ${dest} @ONLY)
|
configure_file (${source} ${dest} @ONLY)
|
||||||
endfunction (configure_pc_file name source dist prefix libdir includedir)
|
endfunction (configure_pc_file name source dist prefix libdir includedir)
|
||||||
|
|
||||||
@@ -55,9 +56,6 @@ function (configure_cmake_file name variant version)
|
|||||||
set (opm-project_${suffix} "${${name}_${suffix}}")
|
set (opm-project_${suffix} "${${name}_${suffix}}")
|
||||||
endforeach (suffix)
|
endforeach (suffix)
|
||||||
set (opm-project_NAME "${${name}_NAME}")
|
set (opm-project_NAME "${${name}_NAME}")
|
||||||
set (opm-project_NAME_UC "${${name}_NAME}")
|
|
||||||
string(TOUPPER "${opm-project_NAME}" opm-project_NAME_UC)
|
|
||||||
string(REPLACE "-" "_" opm-project_NAME_UC "${opm-project_NAME_UC}")
|
|
||||||
|
|
||||||
# make the file substitutions
|
# make the file substitutions
|
||||||
configure_file (
|
configure_file (
|
||||||
@@ -75,9 +73,7 @@ function (opm_cmake_config name)
|
|||||||
set (template_dir "${OPM_MACROS_ROOT}/cmake/Templates")
|
set (template_dir "${OPM_MACROS_ROOT}/cmake/Templates")
|
||||||
|
|
||||||
# write configuration file to locate library
|
# write configuration file to locate library
|
||||||
set(DUNE_PREFIX ${PROJECT_SOURCE_DIR})
|
|
||||||
set(OPM_PROJECT_EXTRA_CODE ${OPM_PROJECT_EXTRA_CODE_INTREE})
|
set(OPM_PROJECT_EXTRA_CODE ${OPM_PROJECT_EXTRA_CODE_INTREE})
|
||||||
set(PREREQ_LOCATION "${PROJECT_SOURCE_DIR}")
|
|
||||||
configure_cmake_file (${name} "config" "")
|
configure_cmake_file (${name} "config" "")
|
||||||
configure_cmake_file (${name} "config" "-version")
|
configure_cmake_file (${name} "config" "-version")
|
||||||
configure_vars (
|
configure_vars (
|
||||||
@@ -91,33 +87,18 @@ function (opm_cmake_config name)
|
|||||||
${template_dir}/opm-project.pc.in
|
${template_dir}/opm-project.pc.in
|
||||||
${PROJECT_BINARY_DIR}/${${name}_NAME}.pc
|
${PROJECT_BINARY_DIR}/${${name}_NAME}.pc
|
||||||
${PROJECT_BINARY_DIR}
|
${PROJECT_BINARY_DIR}
|
||||||
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
|
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
|
||||||
${PROJECT_SOURCE_DIR}
|
${PROJECT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
# The next replace will result in bogus entries if install directory is
|
# replace the build directory with the target directory in the
|
||||||
# a subdirectory of source tree,
|
# variables that contains build paths
|
||||||
# and we have existing entries pointing to that install directory.
|
string (REPLACE
|
||||||
# Since they will yield a duplicate in next replace anyways, we filter them out first
|
"${PROJECT_SOURCE_DIR}"
|
||||||
# to get avoid those the bogus entries.
|
"${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}"
|
||||||
# First with trailing / to change /usr/include/package to package and not /package
|
${name}_INCLUDE_DIRS
|
||||||
# Fixes broken pkg-config files for Debian/Ubuntu packaging.
|
"${${name}_INCLUDE_DIRS}"
|
||||||
string(FIND "${${name}_INCLUDE_DIRS}" "${PROJECT_SOURCE_DIR}" _source_in_include)
|
)
|
||||||
|
|
||||||
if(_source_in_include GREATER "-1")
|
|
||||||
string(REGEX REPLACE "${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}[;$]" "" ${name}_INCLUDE_DIRS "${${name}_INCLUDE_DIRS}")
|
|
||||||
# Get rid of empty entries
|
|
||||||
string(REPLACE ";;" ";" ${name}_INCLUDE_DIRS "${${name}_INCLUDE_DIRS}")
|
|
||||||
|
|
||||||
# replace the build directory with the target directory in the
|
|
||||||
# variables that contains build paths
|
|
||||||
string (REPLACE
|
|
||||||
"${PROJECT_SOURCE_DIR}"
|
|
||||||
"${CMAKE_INSTALL_PREFIX}/include${${name}_VER_DIR}"
|
|
||||||
${name}_INCLUDE_DIRS
|
|
||||||
"${${name}_INCLUDE_DIRS}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
string (REPLACE
|
string (REPLACE
|
||||||
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
|
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
|
||||||
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${${name}_VER_DIR}"
|
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}${${name}_VER_DIR}"
|
||||||
@@ -130,8 +111,6 @@ function (opm_cmake_config name)
|
|||||||
# create a config mode file which targets the install directory instead
|
# create a config mode file which targets the install directory instead
|
||||||
# of the build directory (using the same input template)
|
# of the build directory (using the same input template)
|
||||||
set(OPM_PROJECT_EXTRA_CODE ${OPM_PROJECT_EXTRA_CODE_INSTALLED})
|
set(OPM_PROJECT_EXTRA_CODE ${OPM_PROJECT_EXTRA_CODE_INSTALLED})
|
||||||
set(PREREQ_LOCATION "${CMAKE_INSTALL_PREFIX}/share/opm/cmake/Modules")
|
|
||||||
set(DUNE_PREFIX ${CMAKE_INSTALL_PREFIX})
|
|
||||||
configure_cmake_file (${name} "install" "")
|
configure_cmake_file (${name} "install" "")
|
||||||
configure_vars (
|
configure_vars (
|
||||||
FILE CMAKE "${PROJECT_BINARY_DIR}/${${name}_NAME}-install.cmake"
|
FILE CMAKE "${PROJECT_BINARY_DIR}/${${name}_NAME}-install.cmake"
|
||||||
@@ -165,7 +144,7 @@ function (opm_cmake_config name)
|
|||||||
if (${name}_TARGET)
|
if (${name}_TARGET)
|
||||||
set (_pkg_dir ${CMAKE_INSTALL_LIBDIR})
|
set (_pkg_dir ${CMAKE_INSTALL_LIBDIR})
|
||||||
else ()
|
else ()
|
||||||
set (_pkg_dir lib)
|
set (_pkg_dir ${LIBDIR_MULTIARCH_UNAWARE})
|
||||||
endif ()
|
endif ()
|
||||||
install (
|
install (
|
||||||
FILES ${PROJECT_BINARY_DIR}/${${name}_NAME}-install.pc
|
FILES ${PROJECT_BINARY_DIR}/${${name}_NAME}-install.pc
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# - Build satellites that are dependent of main library
|
# - Build satellites that are dependent of main library
|
||||||
|
|
||||||
|
option(ADD_DISABLED_CTESTS "Add the tests which are disabled due to failed preconditions to the ctest output (this makes ctest return an error if such a test is present)" ON)
|
||||||
|
mark_as_advanced(ADD_DISABLED_CTESTS)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Enumerate all source code in a "satellite" directory such as tests/,
|
# Enumerate all source code in a "satellite" directory such as tests/,
|
||||||
# compile each of them and optionally set them as a test for CTest to
|
# compile each of them and optionally set them as a test for CTest to
|
||||||
@@ -8,139 +11,135 @@
|
|||||||
# The following suffices must be defined for the opm prefix passed as
|
# The following suffices must be defined for the opm prefix passed as
|
||||||
# parameter:
|
# parameter:
|
||||||
#
|
#
|
||||||
# _LINKER_FLAGS Necessary flags to link with this library
|
# _LINKER_FLAGS Necessary flags to link with this library
|
||||||
# _TARGET CMake target which creates the library
|
# _TARGET CMake target which creates the library
|
||||||
# _LIBRARIES Other dependencies that must also be linked
|
# _LIBRARIES Other dependencies that must also be linked
|
||||||
|
|
||||||
# Synopsis:
|
# Synopsis:
|
||||||
# opm_compile_satellites (opm satellite excl_all test_regexp)
|
# opm_compile_satellites (opm satellite excl_all test_regexp)
|
||||||
#
|
#
|
||||||
# Parameters:
|
# Parameters:
|
||||||
# opm Prefix of the variable which contain information
|
# opm Prefix of the variable which contain information
|
||||||
# about the library these satellites depends on, e.g.
|
# about the library these satellites depends on, e.g.
|
||||||
# pass "opm-core" if opm-core_TARGET is the name of
|
# pass "opm-core" if opm-core_TARGET is the name of
|
||||||
# the target the builds this library. Variables with
|
# the target the builds this library. Variables with
|
||||||
# suffixes _TARGET and _LIBRARIES must exist.
|
# suffixes _TARGET and _LIBRARIES must exist.
|
||||||
#
|
#
|
||||||
# satellite Prefix of variable which contain the names of the
|
# satellite Prefix of variable which contain the names of the
|
||||||
# files, e.g. pass "tests" if the files are in the
|
# files, e.g. pass "tests" if the files are in the
|
||||||
# variable tests_SOURCES. Variables with suffixes
|
# variable tests_SOURCES. Variables with suffixes
|
||||||
# _DATAFILES, _SOURCES and _DIR should exist. This
|
# _DATAFILES, _SOURCES and _DIR should exist. This
|
||||||
# name is also used as name of the target that builds
|
# name is also used as name of the target that builds
|
||||||
# all these files.
|
# all these files.
|
||||||
#
|
#
|
||||||
# excl_all EXCLUDE_FROM_ALL if these targets should not be built by
|
# excl_all EXCLUDE_FROM_ALL if these targets should not be built by
|
||||||
# default, otherwise empty string.
|
# default, otherwise empty string.
|
||||||
#
|
#
|
||||||
# test_regexp Regular expression which picks the name of a test
|
# test_regexp Regular expression which picks the name of a test
|
||||||
# out of the filename, or blank if no test should be
|
# out of the filename, or blank if no test should be
|
||||||
# setup.
|
# setup.
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# opm_compile_satellites (opm-core test "" "^test_([^/]*)$")
|
# opm_compile_satellites (opm-core test "" "^test_([^/]*)$")
|
||||||
#
|
#
|
||||||
macro (opm_compile_satellites opm satellite excl_all test_regexp)
|
macro (opm_compile_satellites opm satellite excl_all test_regexp)
|
||||||
# if we are going to build the tests always, then make sure that
|
# if we are going to build the tests always, then make sure that
|
||||||
# the datafiles are present too
|
# the datafiles are present too
|
||||||
if (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
if (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
||||||
set (_incl_all "ALL")
|
set (_incl_all "ALL")
|
||||||
else (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
else (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
||||||
set (_incl_all "")
|
set (_incl_all "")
|
||||||
endif (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
endif (NOT (${excl_all} MATCHES "EXCLUDE_FROM_ALL"))
|
||||||
|
|
||||||
# if a set of datafiles has been setup, pull those in
|
# if a set of datafiles has been setup, pull those in
|
||||||
add_custom_target (${satellite} ${_incl_all})
|
add_custom_target (${satellite} ${_incl_all})
|
||||||
if (${satellite}_DATAFILES)
|
if (${satellite}_DATAFILES)
|
||||||
add_dependencies (${satellite} ${${satellite}_DATAFILES})
|
add_dependencies (${satellite} ${${satellite}_DATAFILES})
|
||||||
endif (${satellite}_DATAFILES)
|
endif (${satellite}_DATAFILES)
|
||||||
|
|
||||||
# compile each of these separately
|
# compile each of these separately
|
||||||
foreach (_sat_FILE IN LISTS ${satellite}_SOURCES)
|
foreach (_sat_FILE IN LISTS ${satellite}_SOURCES)
|
||||||
if (NOT "${test_regexp}" STREQUAL "" AND NOT Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)
|
||||||
continue()
|
add_executable (${_sat_NAME} ${excl_all} ${_sat_FILE})
|
||||||
endif()
|
add_dependencies (${satellite} ${_sat_NAME})
|
||||||
get_filename_component (_sat_NAME "${_sat_FILE}" NAME_WE)
|
set_target_properties (${_sat_NAME} PROPERTIES
|
||||||
add_executable (${_sat_NAME} ${excl_all} ${_sat_FILE})
|
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}"
|
||||||
add_dependencies (${satellite} ${_sat_NAME})
|
)
|
||||||
set_target_properties (${_sat_NAME} PROPERTIES
|
# are we building a test? luckily, the testing framework doesn't
|
||||||
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}")
|
# require anything else, so we don't have to figure out where it
|
||||||
if(HAVE_DYNAMIC_BOOST_TEST)
|
# should go in the library list
|
||||||
set_target_properties (${_sat_NAME} PROPERTIES
|
if (NOT "${test_regexp}" STREQUAL "")
|
||||||
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
|
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
|
||||||
endif()
|
else (NOT "${test_regexp}" STREQUAL "")
|
||||||
# are we building a test? luckily, the testing framework doesn't
|
set (_test_lib "")
|
||||||
# require anything else, so we don't have to figure out where it
|
endif (NOT "${test_regexp}" STREQUAL "")
|
||||||
# should go in the library list
|
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
|
||||||
if (NOT "${test_regexp}" STREQUAL "")
|
if (STRIP_DEBUGGING_SYMBOLS)
|
||||||
set (_test_lib "${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}")
|
strip_debug_symbols (${_sat_NAME} _sat_DEBUG)
|
||||||
else (NOT "${test_regexp}" STREQUAL "")
|
list (APPEND ${satellite}_DEBUG ${_sat_DEBUG})
|
||||||
set (_test_lib "")
|
|
||||||
add_static_analysis_tests(_sat_FILE ${opm}_INCLUDE_DIRS)
|
|
||||||
endif (NOT "${test_regexp}" STREQUAL "")
|
|
||||||
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES} ${_test_lib})
|
|
||||||
if (STRIP_DEBUGGING_SYMBOLS)
|
|
||||||
strip_debug_symbols (${_sat_NAME} _sat_DEBUG)
|
|
||||||
list (APPEND ${satellite}_DEBUG ${_sat_DEBUG})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# variable with regular expression doubles as a flag for
|
|
||||||
# whether tests should be setup or not
|
|
||||||
set(_sat_FANCY)
|
|
||||||
if (NOT "${test_regexp}" STREQUAL "")
|
|
||||||
foreach (_regexp IN ITEMS ${test_regexp})
|
|
||||||
if ("${_sat_NAME}" MATCHES "${_regexp}")
|
|
||||||
string (REGEX REPLACE "${_regexp}" "\\1" _sat_FANCY "${_sat_NAME}")
|
|
||||||
elseif(NOT _sat_FANCY)
|
|
||||||
set(_sat_FANCY ${_sat_NAME})
|
|
||||||
endif()
|
endif()
|
||||||
endforeach (_regexp)
|
|
||||||
get_target_property (_sat_LOC ${_sat_NAME} LOCATION)
|
|
||||||
# Run tests through mpi-run. Ubuntu 14.04 provided mpi libs will crash
|
|
||||||
# in the MPI_Finalize() call otherwise.
|
|
||||||
if(MPI_FOUND)
|
|
||||||
set(_sat_LOC ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${_sat_LOC})
|
|
||||||
endif()
|
|
||||||
if (CMAKE_VERSION VERSION_LESS "2.8.4")
|
|
||||||
add_test (NAME ${_sat_FANCY}
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_BINARY_DIR}/${${satellite}_DIR}" ${_sat_LOC})
|
|
||||||
else (CMAKE_VERSION VERSION_LESS "2.8.4")
|
|
||||||
add_test (${_sat_FANCY} ${_sat_LOC})
|
|
||||||
# run the test in the directory where the data files are
|
|
||||||
set_tests_properties (${_sat_FANCY} PROPERTIES
|
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${${satellite}_DIR})
|
|
||||||
endif (CMAKE_VERSION VERSION_LESS "2.8.4")
|
|
||||||
if(NOT TARGET test-suite)
|
|
||||||
add_custom_target(test-suite)
|
|
||||||
endif()
|
|
||||||
add_dependencies(test-suite "${_sat_NAME}")
|
|
||||||
endif(NOT "${test_regexp}" STREQUAL "")
|
|
||||||
|
|
||||||
# if this program on the list of files that should be distributed?
|
# variable with regular expression doubles as a flag for
|
||||||
# we check by the name of the source file
|
# whether tests should be setup or not
|
||||||
list (FIND ${satellite}_SOURCES_DIST "${_sat_FILE}" _is_util)
|
if (NOT "${test_regexp}" STREQUAL "")
|
||||||
if (NOT (_is_util EQUAL -1))
|
foreach (_regexp IN ITEMS ${test_regexp})
|
||||||
install (TARGETS ${_sat_NAME} RUNTIME
|
if ("${_sat_NAME}" MATCHES "${_regexp}")
|
||||||
DESTINATION bin${${opm}_VER_DIR}/)
|
string (REGEX REPLACE "${_regexp}" "\\1" _sat_FANCY "${_sat_NAME}")
|
||||||
endif (NOT (_is_util EQUAL -1))
|
endif ("${_sat_NAME}" MATCHES "${_regexp}")
|
||||||
|
endforeach (_regexp)
|
||||||
|
get_target_property (_sat_LOC ${_sat_NAME} LOCATION)
|
||||||
|
# Run tests through mpi-run. Ubuntu 14.04 provided mpi libs will crash
|
||||||
|
# in the MPI_Finalize() call otherwise.
|
||||||
|
if(MPI_FOUND)
|
||||||
|
set(_sat_LOC ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${_sat_LOC})
|
||||||
|
endif()
|
||||||
|
if (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||||
|
add_test (
|
||||||
|
NAME ${_sat_FANCY}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E chdir "${PROJECT_BINARY_DIR}/${${satellite}_DIR}" ${_sat_LOC}
|
||||||
|
)
|
||||||
|
else (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||||
|
add_test (${_sat_FANCY} ${_sat_LOC})
|
||||||
|
# run the test in the directory where the data files are
|
||||||
|
set_tests_properties (${_sat_FANCY} PROPERTIES
|
||||||
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${${satellite}_DIR}
|
||||||
|
)
|
||||||
|
endif (CMAKE_VERSION VERSION_LESS "2.8.4")
|
||||||
|
if(NOT TARGET test-suite)
|
||||||
|
add_custom_target(test-suite)
|
||||||
|
endif()
|
||||||
|
add_dependencies(test-suite "${_sat_NAME}")
|
||||||
|
endif(NOT "${test_regexp}" STREQUAL "")
|
||||||
|
|
||||||
|
# if this program on the list of files that should be distributed?
|
||||||
|
# we check by the name of the source file
|
||||||
|
list (FIND ${satellite}_SOURCES_DIST "${_sat_FILE}" _is_util)
|
||||||
|
if (NOT (_is_util EQUAL -1))
|
||||||
|
install (TARGETS ${_sat_NAME} RUNTIME
|
||||||
|
DESTINATION bin${${opm}_VER_DIR}/
|
||||||
|
)
|
||||||
|
endif (NOT (_is_util EQUAL -1))
|
||||||
endforeach (_sat_FILE)
|
endforeach (_sat_FILE)
|
||||||
endmacro (opm_compile_satellites opm prefix)
|
endmacro (opm_compile_satellites opm prefix)
|
||||||
|
|
||||||
# Synopsis:
|
# Synopsis:
|
||||||
# opm_data (satellite target dirname files)
|
# opm_data (satellite target dirname files)
|
||||||
#
|
#
|
||||||
# provides these output variables:
|
# provides these output variables:
|
||||||
#
|
#
|
||||||
# ${satellite}_INPUT_FILES List of all files that are copied
|
# ${satellite}_INPUT_FILES List of all files that are copied
|
||||||
# ${satellite}_DATAFILES Name of target which copies these files
|
# ${satellite}_DATAFILES Name of target which copies these files
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
#
|
#
|
||||||
# opm_data (tests datafiles "tests/")
|
# opm_data (tests datafiles "tests/")
|
||||||
#
|
#
|
||||||
macro (opm_data satellite target dirname)
|
macro (opm_data satellite target dirname)
|
||||||
# even if there are no datafiles, create the directory so the
|
# even if there are no datafiles, create the directory so the
|
||||||
# satellite programs have a homedir to run in
|
# satellite programs have a homedir to run in
|
||||||
execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${dirname})
|
execute_process (
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${dirname}
|
||||||
|
)
|
||||||
|
|
||||||
# if ever huge test datafiles are necessary, then change this
|
# if ever huge test datafiles are necessary, then change this
|
||||||
# into "create_symlink" (on UNIX only, apparently)
|
# into "create_symlink" (on UNIX only, apparently)
|
||||||
@@ -150,27 +149,26 @@ macro (opm_data satellite target dirname)
|
|||||||
# to a tests/ directory in the output tree (if different)
|
# to a tests/ directory in the output tree (if different)
|
||||||
set (${satellite}_INPUT_FILES)
|
set (${satellite}_INPUT_FILES)
|
||||||
if (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
if (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||||
foreach (input_datafile IN LISTS ${satellite}_DATA)
|
foreach (input_datafile IN LISTS ${satellite}_DATA)
|
||||||
if (IS_ABSOLUTE ${input_datafile})
|
file (RELATIVE_PATH rel_datafile "${PROJECT_SOURCE_DIR}" ${input_datafile})
|
||||||
file (RELATIVE_PATH rel_datafile "${PROJECT_SOURCE_DIR}" ${input_datafile})
|
set (output_datafile "${PROJECT_BINARY_DIR}/${rel_datafile}")
|
||||||
else()
|
add_custom_command (
|
||||||
set(rel_datafile ${input_datafile})
|
OUTPUT ${output_datafile}
|
||||||
endif()
|
COMMAND ${CMAKE_COMMAND}
|
||||||
set (output_datafile "${PROJECT_BINARY_DIR}/${rel_datafile}")
|
ARGS -E ${make_avail} ${input_datafile} ${output_datafile}
|
||||||
add_custom_command (OUTPUT ${output_datafile}
|
DEPENDS ${input_datafile}
|
||||||
COMMAND ${CMAKE_COMMAND}
|
VERBATIM
|
||||||
ARGS -E ${make_avail} ${input_datafile} ${output_datafile}
|
)
|
||||||
DEPENDS ${input_datafile}
|
list (APPEND ${satellite}_INPUT_FILES "${output_datafile}")
|
||||||
VERBATIM)
|
endforeach (input_datafile)
|
||||||
list (APPEND ${satellite}_INPUT_FILES "${output_datafile}")
|
|
||||||
endforeach (input_datafile)
|
|
||||||
endif(NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
endif(NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
||||||
|
|
||||||
# setup a target which does all the copying
|
# setup a target which does all the copying
|
||||||
set (${satellite}_DATAFILES "${target}")
|
set (${satellite}_DATAFILES "${target}")
|
||||||
add_custom_target (${${satellite}_DATAFILES}
|
add_custom_target (${${satellite}_DATAFILES}
|
||||||
DEPENDS ${${satellite}_INPUT_FILES}
|
DEPENDS ${${satellite}_INPUT_FILES}
|
||||||
COMMENT "Making \"${satellite}\" data available in output tree")
|
COMMENT "Making \"${satellite}\" data available in output tree"
|
||||||
|
)
|
||||||
if(NOT TARGET test-suite)
|
if(NOT TARGET test-suite)
|
||||||
add_custom_target(test-suite)
|
add_custom_target(test-suite)
|
||||||
endif()
|
endif()
|
||||||
@@ -185,7 +183,6 @@ endmacro (opm_data satellite target dirname files)
|
|||||||
# Parameters:
|
# Parameters:
|
||||||
# TestName Name of test
|
# TestName Name of test
|
||||||
# ONLY_COMPILE Only build test but do not run it (optional)
|
# ONLY_COMPILE Only build test but do not run it (optional)
|
||||||
# DEFAULT_ENABLE_IF Only enable by default if a given condition is true (optional)
|
|
||||||
# ALWAYS_ENABLE Force enabling test even if -DBUILD_TESTING=OFF was set (optional)
|
# ALWAYS_ENABLE Force enabling test even if -DBUILD_TESTING=OFF was set (optional)
|
||||||
# EXE_NAME Name of test executable (optional, default: ./bin/${TestName})
|
# EXE_NAME Name of test executable (optional, default: ./bin/${TestName})
|
||||||
# CONDITION Condition to enable test (optional, cmake code)
|
# CONDITION Condition to enable test (optional, cmake code)
|
||||||
@@ -198,7 +195,6 @@ endmacro (opm_data satellite target dirname files)
|
|||||||
# TEST_DEPENDS Other tests which must be run before running this test (optional, default: None)
|
# TEST_DEPENDS Other tests which must be run before running this test (optional, default: None)
|
||||||
# LIBRARIES Libraries to link test against (optional)
|
# LIBRARIES Libraries to link test against (optional)
|
||||||
# WORKING_DIRECTORY Working directory for test (optional, default: ${PROJECT_BINARY_DIR})
|
# WORKING_DIRECTORY Working directory for test (optional, default: ${PROJECT_BINARY_DIR})
|
||||||
# CONFIGURATION Configuration to add test to
|
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
#
|
#
|
||||||
@@ -212,8 +208,8 @@ include(CMakeParseArguments)
|
|||||||
macro(opm_add_test TestName)
|
macro(opm_add_test TestName)
|
||||||
cmake_parse_arguments(CURTEST
|
cmake_parse_arguments(CURTEST
|
||||||
"NO_COMPILE;ONLY_COMPILE;ALWAYS_ENABLE" # flags
|
"NO_COMPILE;ONLY_COMPILE;ALWAYS_ENABLE" # flags
|
||||||
"EXE_NAME;PROCESSORS;WORKING_DIRECTORY;CONFIGURATION" # one value args
|
"EXE_NAME;PROCESSORS;WORKING_DIRECTORY" # one value args
|
||||||
"CONDITION;DEFAULT_ENABLE_IF;TEST_DEPENDS;DRIVER;DRIVER_ARGS;DEPENDS;TEST_ARGS;SOURCES;LIBRARIES" # multi-value args
|
"CONDITION;TEST_DEPENDS;DRIVER;DRIVER_ARGS;DEPENDS;TEST_ARGS;SOURCES;LIBRARIES" # multi-value args
|
||||||
${ARGN})
|
${ARGN})
|
||||||
|
|
||||||
set(BUILD_TESTING "${BUILD_TESTING}")
|
set(BUILD_TESTING "${BUILD_TESTING}")
|
||||||
@@ -223,13 +219,6 @@ macro(opm_add_test TestName)
|
|||||||
set(CURTEST_EXE_NAME ${TestName})
|
set(CURTEST_EXE_NAME ${TestName})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Strip test_ prefix from name
|
|
||||||
if ("${TestName}" MATCHES "^test_([^/]*)$")
|
|
||||||
string (REGEX REPLACE "^test_([^/]*)$" "\\1" _FANCY "${TestName}")
|
|
||||||
else()
|
|
||||||
set(_FANCY ${TestName})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# try to auto-detect the name of the source file if SOURCES are not
|
# try to auto-detect the name of the source file if SOURCES are not
|
||||||
# explicitly specified.
|
# explicitly specified.
|
||||||
if (NOT CURTEST_SOURCES)
|
if (NOT CURTEST_SOURCES)
|
||||||
@@ -261,11 +250,6 @@ macro(opm_add_test TestName)
|
|||||||
# case. They can still be build using 'make test-suite' and they can
|
# case. They can still be build using 'make test-suite' and they can
|
||||||
# be build and run using 'make check'
|
# be build and run using 'make check'
|
||||||
set(CURTEST_EXCLUDE_FROM_ALL "")
|
set(CURTEST_EXCLUDE_FROM_ALL "")
|
||||||
if (NOT "AND OR ${CURTEST_DEFAULT_ENABLE_IF}" STREQUAL "AND OR ")
|
|
||||||
if (NOT ${CURTEST_DEFAULT_ENABLE_IF})
|
|
||||||
set(CURTEST_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if (NOT BUILD_TESTING AND NOT CURTEST_ALWAYS_ENABLE)
|
if (NOT BUILD_TESTING AND NOT CURTEST_ALWAYS_ENABLE)
|
||||||
set(CURTEST_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
|
set(CURTEST_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
|
||||||
endif()
|
endif()
|
||||||
@@ -282,7 +266,7 @@ macro(opm_add_test TestName)
|
|||||||
|
|
||||||
# the libraries to link against
|
# the libraries to link against
|
||||||
if (NOT CURTEST_LIBRARIES)
|
if (NOT CURTEST_LIBRARIES)
|
||||||
SET(CURTEST_LIBRARIES "${${project}_LIBRARIES}")
|
SET(CURTEST_LIBRARIES "${${CMAKE_PROJECT_NAME}_LIBRARIES}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# determine if the test should be completely ignored, i.e., the
|
# determine if the test should be completely ignored, i.e., the
|
||||||
@@ -303,12 +287,7 @@ macro(opm_add_test TestName)
|
|||||||
# only compile the binary but do not run it as a test
|
# only compile the binary but do not run it as a test
|
||||||
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
|
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
|
||||||
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
|
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
|
||||||
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
|
|
||||||
add_static_analysis_tests(CURTEST_SOURCES dirs)
|
|
||||||
|
|
||||||
if(TARGET ${project}_prepare)
|
|
||||||
add_dependencies("${CURTEST_EXE_NAME}" ${project}_prepare)
|
|
||||||
endif()
|
|
||||||
if(CURTEST_DEPENDS)
|
if(CURTEST_DEPENDS)
|
||||||
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
|
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
|
||||||
endif()
|
endif()
|
||||||
@@ -318,20 +297,16 @@ macro(opm_add_test TestName)
|
|||||||
# run-only case occurs if the binary is already compiled by an
|
# run-only case occurs if the binary is already compiled by an
|
||||||
# earlier test.)
|
# earlier test.)
|
||||||
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
|
add_executable("${CURTEST_EXE_NAME}" ${CURTEST_EXCLUDE_FROM_ALL} ${CURTEST_SOURCES})
|
||||||
if(HAVE_DYNAMIC_BOOST_TEST)
|
|
||||||
set_target_properties (${CURTEST_EXE_NAME} PROPERTIES
|
|
||||||
COMPILE_DEFINITIONS BOOST_TEST_DYN_LINK)
|
|
||||||
endif()
|
|
||||||
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
|
target_link_libraries (${CURTEST_EXE_NAME} ${CURTEST_LIBRARIES})
|
||||||
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
|
|
||||||
add_static_analysis_tests(CURTEST_SOURCES dirs)
|
|
||||||
|
|
||||||
if(CURTEST_DEPENDS)
|
if(CURTEST_DEPENDS)
|
||||||
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
|
add_dependencies("${CURTEST_EXE_NAME}" ${CURTEST_DEPENDS})
|
||||||
endif()
|
endif()
|
||||||
if(TARGET ${project}_prepare)
|
|
||||||
add_dependencies("${CURTEST_EXE_NAME}" ${project}_prepare)
|
if(NOT TARGET test-suite)
|
||||||
|
add_custom_target(test-suite)
|
||||||
endif()
|
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
|
||||||
@@ -346,27 +321,28 @@ macro(opm_add_test TestName)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_test(NAME ${_FANCY}
|
add_test(NAME ${TestName}
|
||||||
WORKING_DIRECTORY "${CURTEST_WORKING_DIRECTORY}"
|
WORKING_DIRECTORY "${CURTEST_WORKING_DIRECTORY}"
|
||||||
COMMAND ${CURTEST_COMMAND}
|
COMMAND ${CURTEST_COMMAND})
|
||||||
CONFIGURATIONS ${CURTEST_CONFIGURATION})
|
|
||||||
|
|
||||||
# specify the dependencies between the tests
|
# specify the dependencies between the tests
|
||||||
if (CURTEST_TEST_DEPENDS)
|
if (CURTEST_TEST_DEPENDS)
|
||||||
set_tests_properties(${_FANCY} PROPERTIES DEPENDS "${CURTEST_TEST_DEPENDS}")
|
set_tests_properties(${TestName} PROPERTIES DEPENDS "${CURTEST_TEST_DEPENDS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# tell ctest how many cores it should reserve to run the test
|
# tell ctest how many cores it should reserve to run the test
|
||||||
if (CURTEST_PROCESSORS)
|
if (CURTEST_PROCESSORS)
|
||||||
set_tests_properties(${_FANCY} PROPERTIES PROCESSORS "${CURTEST_PROCESSORS}")
|
set_tests_properties(${TestName} PROPERTIES PROCESSORS "${CURTEST_PROCESSORS}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT CURTEST_NO_COMPILE)
|
else() # test is skipped
|
||||||
if(NOT TARGET test-suite)
|
|
||||||
add_custom_target(test-suite)
|
# the following causes the test to appear as 'skipped' in the
|
||||||
endif()
|
# CDash dashboard. it this is removed, the test is just silently
|
||||||
add_dependencies(test-suite "${CURTEST_EXE_NAME}")
|
# ignored.
|
||||||
|
if (NOT CURTEST_ONLY_COMPILE AND ADD_DISABLED_CTESTS)
|
||||||
|
add_test(${TestName} skip_test_dummy)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
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)
|
|
||||||
set(_clone_dir "${module}")
|
|
||||||
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} AND
|
|
||||||
EXISTS ${_parent_full_dir}/${_clone_dir}/CMakeCache.txt)
|
|
||||||
# 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()
|
|
||||||
@@ -50,7 +50,7 @@ macro(opm_static_add_dependencies target)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
include(GNUInstallDirs)
|
include(UseMultiArch)
|
||||||
|
|
||||||
# Defaults to building master
|
# Defaults to building master
|
||||||
if(NOT OPM_BENCHMARK_VERSION)
|
if(NOT OPM_BENCHMARK_VERSION)
|
||||||
|
|||||||
@@ -14,19 +14,139 @@
|
|||||||
# Add these variables to ${project}_CONFIG_IMPL_VARS in CMakeLists.txt
|
# Add these variables to ${project}_CONFIG_IMPL_VARS in CMakeLists.txt
|
||||||
# if you need these in the code.
|
# if you need these in the code.
|
||||||
|
|
||||||
|
include (UseMultiArch)
|
||||||
|
|
||||||
function (find_dune_version suite module)
|
function (find_dune_version suite module)
|
||||||
# CMake's find_package will set <package>_VERSION_(MAJOR|MINOR|REVISION)
|
# the _ROOT variable may or may not be set, but the include
|
||||||
# we simply rely on that.
|
# variable should always be; get the prefix from the header path
|
||||||
|
# if we have a multilib installation where the package maintainer
|
||||||
|
# have installed it in e.g. /usr/include/dune-2.2/dune/istl, then
|
||||||
|
# stash this extra indirection and add it back later in lib/
|
||||||
|
set (_inc_path "${${suite}-${module}_INCLUDE_DIR}")
|
||||||
|
file (TO_CMAKE_PATH _inc_path "${_inc_path}")
|
||||||
|
set (_multilib_regexp "(.*)/include(/${suite}[^/]+)?")
|
||||||
|
if (_inc_path MATCHES "${_multilib_regexp}")
|
||||||
|
set (_orig_inc "${_inc_path}")
|
||||||
|
string (REGEX REPLACE "${_multilib_regexp}" "\\1" _inc_path "${_orig_inc}")
|
||||||
|
# only get the second group if it is really there (there is
|
||||||
|
# probably a better way to do this in CMake)
|
||||||
|
if ("${_inc_path}/include" STREQUAL "${_orig_inc}")
|
||||||
|
set (_multilib "")
|
||||||
|
else ()
|
||||||
|
string (REGEX REPLACE "${_multilib_regexp}" "\\2" _multilib "${_orig_inc}")
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
set (_multilib "")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# some modules does not have a library, use the directory of the
|
||||||
|
# header files to find what would be the library dir.
|
||||||
|
# note that when we refer to a build tree, then the libraries always
|
||||||
|
# go into lib/, but we don't care about that because in that case,
|
||||||
|
# dune.module isn't in the lib/ directory anyway but must be retrieved
|
||||||
|
# from the source. hence, we only have to worry about the library
|
||||||
|
# directory of a system installation here.
|
||||||
|
if (NOT ${suite}-${module}_LIBRARY)
|
||||||
|
# this suffix is gotten from UseMultiArch.cmake
|
||||||
|
set (_lib_path "${_inc_path}/${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
else ()
|
||||||
|
get_filename_component (_lib_path "${${suite}-${module}_LIBRARY}" PATH)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# if we have a source tree, dune.module is available there
|
||||||
|
set (_dune_mod "${_inc_path}/dune.module")
|
||||||
|
if (NOT EXISTS "${_dune_mod}")
|
||||||
|
set (_last_dune_mod_src "${_dune_mod}")
|
||||||
|
set (_dune_mod "")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT _dune_mod)
|
||||||
|
# look for the build tree; if we found the library, then the
|
||||||
|
# dune.module file should be in a sub-directory
|
||||||
|
get_filename_component (_immediate "${_lib_path}" NAME)
|
||||||
|
if ("${_immediate}" STREQUAL ".libs")
|
||||||
|
# remove autotools internal path
|
||||||
|
get_filename_component (_lib_path "${_lib_path}" PATH)
|
||||||
|
endif ()
|
||||||
|
get_filename_component (_immediate "${_lib_path}" NAME)
|
||||||
|
if ("${_immediate}" STREQUAL "${CMAKE_LIBRARY_ARCHITECTURE}")
|
||||||
|
# remove multi-arch part of the library path to get parent
|
||||||
|
get_filename_component (_lib_path "${_lib_path}" PATH)
|
||||||
|
endif ()
|
||||||
|
get_filename_component (_immediate "${_lib_path}" NAME)
|
||||||
|
if (("${_immediate}" STREQUAL "${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
OR ("${_immediate}" STREQUAL "lib")
|
||||||
|
OR ("${_immediate}" STREQUAL "${LIBDIR_MULTIARCH_UNAWARE}"))
|
||||||
|
# remove library part of the path; this also undo the suffix
|
||||||
|
# we added if we used the library as a standin
|
||||||
|
get_filename_component (_lib_path "${_lib_path}" PATH)
|
||||||
|
endif ()
|
||||||
|
# from this point on, _lib_path does not contain an architecture-
|
||||||
|
# specific component anymore; dune.module is always put in straight
|
||||||
|
# noarch lib/ since it does not contain any paths to binaries
|
||||||
|
set (_suffix "${_multilib}/dunecontrol/${suite}-${module}/dune.module")
|
||||||
|
set (_dune_mod "${_lib_path}/${LIBDIR_MULTIARCH_UNAWARE}${_suffix}")
|
||||||
|
if (NOT EXISTS "${_dune_mod}")
|
||||||
|
set (_last_dune_mod_bld "${_dune_mod}")
|
||||||
|
# one more try, if we have a private install, then it doesn't use
|
||||||
|
# e.g. lib64 but always lib (!)
|
||||||
|
if ("${LIBDIR_MULTIARCH_UNAWARE}" STREQUAL "lib")
|
||||||
|
set (_dune_mod "")
|
||||||
|
else ()
|
||||||
|
set (_dune_mod "${_lib_path}/lib${_suffix}")
|
||||||
|
if (NOT EXISTS "${_dune_mod}")
|
||||||
|
set (_last_dune_mod_pri "${_dune_mod}")
|
||||||
|
# use the name itself as a flag for whether it was found or not
|
||||||
|
set (_dune_mod "")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# if it is not available, it may make havoc having empty defines in the source
|
||||||
|
# code later, so we bail out early
|
||||||
|
if (NOT _dune_mod)
|
||||||
|
if (${suite}-${module}_FOUND)
|
||||||
|
set (_searched_paths "\"${_last_dune_mod_src}\"")
|
||||||
|
if (NOT ("${_last_dune_mod_bld}" STREQUAL ""))
|
||||||
|
set (_searched_paths "either ${_searched_paths} or \"${_last_dune_mod_bld}\"")
|
||||||
|
endif ()
|
||||||
|
if (NOT ("${_last_dune_mod_pri}" STREQUAL ""))
|
||||||
|
set (_searched_paths "${_searched_paths} or \"${_last_dune_mod_pri}\"")
|
||||||
|
endif ()
|
||||||
|
message (FATAL_ERROR "Failed to locate dune.module for ${suite}-${module} (looking for ${_searched_paths})")
|
||||||
|
else ()
|
||||||
|
return ()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# parse the file for the Version: field
|
||||||
|
set (_ver_regexp "[ ]*Version:[ ]*([0-9]+)\\.([0-9]+)(.*)")
|
||||||
|
file (STRINGS "${_dune_mod}" _ver_field REGEX "${_ver_regexp}")
|
||||||
|
string (REGEX REPLACE "${_ver_regexp}" "\\1" _major "${_ver_field}")
|
||||||
|
string (REGEX REPLACE "${_ver_regexp}" "\\2" _minor "${_ver_field}")
|
||||||
|
string (REGEX REPLACE "${_ver_regexp}" "\\3" _revision "${_ver_field}")
|
||||||
|
|
||||||
|
# revision may or may not be there
|
||||||
|
set (_rev_regexp "\\.([0-9]+).*")
|
||||||
|
if (_revision MATCHES "${_rev_regexp}")
|
||||||
|
string (REGEX REPLACE "${_rev_regexp}" "\\1" _revision "${_revision}")
|
||||||
|
else ()
|
||||||
|
set (_revision "0")
|
||||||
|
endif ()
|
||||||
|
|
||||||
# generate variable for what we have found
|
# generate variable for what we have found
|
||||||
string (TOUPPER "${suite}" _SUITE)
|
string (TOUPPER "${suite}" _SUITE)
|
||||||
string (TOUPPER "${module}" _MODULE)
|
string (TOUPPER "${module}" _MODULE)
|
||||||
string (REPLACE "-" "_" _MODULE "${_MODULE}")
|
string (REPLACE "-" "_" _MODULE "${_MODULE}")
|
||||||
set (${_SUITE}_${_MODULE}_VERSION_MAJOR "${${suite}-${module}_VERSION_MAJOR}" PARENT_SCOPE)
|
if ((NOT DEFINED ${_SUITE}_${_MODULE}_VERSION_MAJOR) AND
|
||||||
set (${_SUITE}_${_MODULE}_VERSION_MINOR "${${suite}-${module}_VERSION_MINOR}" PARENT_SCOPE)
|
(NOT DEFINED ${_SUITE}_${_MODULE}_VERSION_MINOR) AND
|
||||||
set (${_SUITE}_${_MODULE}_VERSION_REVISION "${${suite}-${module}_VERSION_PATCH}" PARENT_SCOPE)
|
(NOT DEFINED ${_SUITE}_${_MODULE}_VERSION_REVISION))
|
||||||
|
set (${_SUITE}_${_MODULE}_VERSION_MAJOR "${_major}" PARENT_SCOPE)
|
||||||
|
set (${_SUITE}_${_MODULE}_VERSION_MINOR "${_minor}" PARENT_SCOPE)
|
||||||
|
set (${_SUITE}_${_MODULE}_VERSION_REVISION "${_revision}" PARENT_SCOPE)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if( ${suite}-${module}_FOUND )
|
# print the version number we detected in the configuration log
|
||||||
# print the version number we detected in the configuration log
|
message (STATUS "Version ${_major}.${_minor}.${_revision} of ${suite}-${module} from ${_dune_mod}")
|
||||||
message (STATUS "Version ${${suite}-${module}_VERSION_MAJOR}.${${suite}-${module}_VERSION_MINOR}.${${suite}-${module}_VERSION_PATCH} of ${suite}-${module} from ${${suite}-${module}_DIR}")
|
|
||||||
endif()
|
|
||||||
endfunction (find_dune_version suite module)
|
endfunction (find_dune_version suite module)
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
# When using Boost >= 1.70 and e.g. CMake 3.18 we need to make sure that
|
if (NOT Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
||||||
# subsequent searches are using config mode too. Otherwise the library
|
find_package (Boost 1.44.0 COMPONENTS unit_test_framework QUIET)
|
||||||
# list will be completely messed up. We use a set Boost_Dir to detect that
|
endif ()
|
||||||
# previous searches were done using config mode.
|
|
||||||
if(Boost_DIR)
|
|
||||||
set(_Boost_CONFIG_MODE CONFIG)
|
|
||||||
endif()
|
|
||||||
find_package (Boost 1.44.0 COMPONENTS unit_test_framework QUIET ${_Boost_CONFIG_MODE})
|
|
||||||
|
|
||||||
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
if (Boost_UNIT_TEST_FRAMEWORK_FOUND)
|
||||||
# setup to do a test compile
|
# setup to do a test compile
|
||||||
|
|||||||
35
cmake/Modules/UseMultiArch.cmake
Normal file
35
cmake/Modules/UseMultiArch.cmake
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# - Multiarch support in object code library directories
|
||||||
|
#
|
||||||
|
# This module sets the following variable
|
||||||
|
# CMAKE_INSTALL_LIBDIR to lib, lib64 or lib/x86_64-linux-gnu
|
||||||
|
# depending on the platform; use this path
|
||||||
|
# for platform-specific binaries.
|
||||||
|
#
|
||||||
|
# Note that it will override the results of GNUInstallDirs if included after
|
||||||
|
# that module.
|
||||||
|
|
||||||
|
# default if we need to put something in the library directory for a
|
||||||
|
# component that is *not* multiarch-aware
|
||||||
|
set (LIBDIR_MULTIARCH_UNAWARE "lib")
|
||||||
|
|
||||||
|
# Fedora uses lib64/ for 64-bit systems, Debian uses lib/x86_64-linux-gnu
|
||||||
|
if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||||
|
# Debian or Ubuntu?
|
||||||
|
if (EXISTS "/etc/debian_version")
|
||||||
|
set (_libdir_def "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
|
||||||
|
else (EXISTS "/etc/debian_version")
|
||||||
|
# 64-bit system?
|
||||||
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
set (_libdir_def "lib64")
|
||||||
|
set (LIBDIR_MULTIARCH_UNAWARE "${_libdir_def}")
|
||||||
|
else (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
set (_libdir_def "lib")
|
||||||
|
endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
endif (EXISTS "/etc/debian_version")
|
||||||
|
else ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||||
|
set (_libdir_def "lib")
|
||||||
|
endif ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
|
||||||
|
|
||||||
|
# let the user override if somewhere else is desirable
|
||||||
|
set (CMAKE_INSTALL_LIBDIR "${_libdir_def}" CACHE PATH "Object code libraries")
|
||||||
|
mark_as_advanced (CMAKE_INSTALL_LIBDIR)
|
||||||
@@ -42,13 +42,7 @@ macro (find_openmp opm)
|
|||||||
# enabling OpenMP is supposedly enough to make the compiler link with
|
# enabling OpenMP is supposedly enough to make the compiler link with
|
||||||
# the appropriate libraries
|
# the appropriate libraries
|
||||||
find_package (OpenMP ${${opm}_QUIET})
|
find_package (OpenMP ${${opm}_QUIET})
|
||||||
|
list (APPEND ${opm}_LIBRARIES ${OpenMP_LIBRARIES})
|
||||||
if(OpenMP_CXX_FOUND)
|
|
||||||
list (APPEND ${opm}_LIBRARIES OpenMP::OpenMP_CXX)
|
|
||||||
else()
|
|
||||||
list (APPEND ${opm}_LIBRARIES ${OpenMP_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (OPENMP_FOUND)
|
if (OPENMP_FOUND)
|
||||||
add_options (C ALL_BUILDS "${OpenMP_C_FLAGS}")
|
add_options (C ALL_BUILDS "${OpenMP_C_FLAGS}")
|
||||||
add_options (CXX ALL_BUILDS "${OpenMP_CXX_FLAGS}")
|
add_options (CXX ALL_BUILDS "${OpenMP_CXX_FLAGS}")
|
||||||
|
|||||||
@@ -21,28 +21,10 @@ if (CXX_COMPAT_GCC)
|
|||||||
# disabled due to widespread bugs in the linker plugin
|
# disabled due to widespread bugs in the linker plugin
|
||||||
option (WHOLE_PROG_OPTIM "Whole program optimization (lto)" OFF)
|
option (WHOLE_PROG_OPTIM "Whole program optimization (lto)" OFF)
|
||||||
if (WHOLE_PROG_OPTIM)
|
if (WHOLE_PROG_OPTIM)
|
||||||
check_cxx_accepts_flag ("-flto" HAVE_LINK_OPTS)
|
check_cxx_accepts_flag ("-flto" HAVE_LINK_OPTS)
|
||||||
check_cxx_accepts_flag ("-fuse-linker-plugin" HAVE_LINK_PLUGIN)
|
if (HAVE_LINK_OPTS)
|
||||||
if (HAVE_LINK_OPTS)
|
list (APPEND _opt_flags "-flto")
|
||||||
list (APPEND _opt_flags "-flto")
|
endif (HAVE_LINK_OPTS)
|
||||||
endif (HAVE_LINK_OPTS)
|
|
||||||
if (HAVE_LINK_PLUGIN)
|
|
||||||
list (APPEND _opt_flags "-fuse-linker-plugin")
|
|
||||||
endif (HAVE_LINK_PLUGIN)
|
|
||||||
if(HAVE_LINK_OPTS AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
||||||
string(REPLACE "." ";" VERSION_LIST "${CMAKE_C_COMPILER_VERSION}")
|
|
||||||
list(GET VERSION_LIST 0 VER_MAJOR)
|
|
||||||
find_program(LTO_AR_COMMAND NAMES ${CMAKE_C_COMPILER}-ar gcc-ar-${VER_MAJOR} gcc-ar)
|
|
||||||
find_program(LTO_RANLIB_COMMAND NAMES ${CMAKE_C_COMPILER}-ranlib gcc-ranlib-${VER_MAJOR} gcc-ranlib)
|
|
||||||
if(LTO_AR_COMMAND)
|
|
||||||
set(CMAKE_AR ${LTO_AR_COMMAND})
|
|
||||||
message(STATUS "Using LTO-enabled ar: ${CMAKE_AR}")
|
|
||||||
endif()
|
|
||||||
if(LTO_RANLIB_COMMAND)
|
|
||||||
set(CMAKE_RANLIB ${LTO_RANLIB_COMMAND})
|
|
||||||
message(STATUS "Using LTO-enabled ranlib: ${CMAKE_RANLIB}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif (WHOLE_PROG_OPTIM)
|
endif (WHOLE_PROG_OPTIM)
|
||||||
|
|
||||||
# native instruction set tuning
|
# native instruction set tuning
|
||||||
@@ -56,17 +38,13 @@ 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 "-O3" "(^|\ )-O")
|
set_default_option (CXX _opt_rel "-O2" "(^|\ )-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")
|
||||||
|
|
||||||
# use these options for release builds - full optimization
|
# use these options for release builds - full optimization
|
||||||
add_options (ALL_LANGUAGES "${_prof_RELEASE}" ${_opt_rel} ${_opt_flags})
|
add_options (ALL_LANGUAGES "${_prof_RELEASE}" ${_opt_rel} "-DNDEBUG" ${_opt_flags})
|
||||||
option(WITH_NDEBUG "Disable asserts in release mode" OFF)
|
|
||||||
if(NOT WITH_NDEBUG)
|
|
||||||
add_options (ALL_LANGUAGES "${_prof_RELEASE}" -UNDEBUG)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
else ()
|
else ()
|
||||||
# default information from system
|
# default information from system
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
# 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}})
|
|
||||||
if(src MATCHES "TARGET_OBJECTS:")
|
|
||||||
string(REGEX REPLACE "\\$<TARGET_OBJECTS:(.*)>" "\\1" TGT ${src})
|
|
||||||
get_target_property(src ${TGT} SOURCES)
|
|
||||||
endif()
|
|
||||||
if(IS_ABSOLUTE ${src})
|
|
||||||
file(RELATIVE_PATH name ${PROJECT_SOURCE_DIR} ${src})
|
|
||||||
else()
|
|
||||||
set(name ${src})
|
|
||||||
set(src ${PROJECT_SOURCE_DIR}/${src})
|
|
||||||
endif()
|
|
||||||
if(CPPCHECK_FOUND)
|
|
||||||
if(NOT TEST cppcheck+${name})
|
|
||||||
add_test(NAME cppcheck+${name}
|
|
||||||
COMMAND bin/cppcheck-test.sh ${CPPCHECK_PROGRAM} ${src} ${IPATHS}
|
|
||||||
CONFIGURATIONS analyze cppcheck)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(CLANGCHECK_FOUND AND CMAKE_EXPORT_COMPILE_COMMANDS)
|
|
||||||
if(NOT TEST clang-check+${name})
|
|
||||||
add_test(NAME clang-check+${name}
|
|
||||||
COMMAND bin/clang-check-test.sh ${CLANGCHECK_PROGRAM} ${src}
|
|
||||||
CONFIGURATIONS analyze clang-check)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
@@ -14,7 +14,6 @@
|
|||||||
# makes changes to any of the unit tests.
|
# makes changes to any of the unit tests.
|
||||||
|
|
||||||
message("-- Writing version information to local header project-version.h")
|
message("-- Writing version information to local header project-version.h")
|
||||||
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
|
|
||||||
|
|
||||||
string (TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_upper_)
|
string (TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_upper_)
|
||||||
if (cmake_build_type_upper_ MATCHES DEBUG)
|
if (cmake_build_type_upper_ MATCHES DEBUG)
|
||||||
@@ -26,14 +25,6 @@ if (cmake_build_type_upper_ MATCHES DEBUG)
|
|||||||
"#define PROJECT_VERSION \"${${project}_LABEL} (debug)\"\n"
|
"#define PROJECT_VERSION \"${${project}_LABEL} (debug)\"\n"
|
||||||
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Write header file with build timestamp
|
|
||||||
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
|
|
||||||
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
|
||||||
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
|
||||||
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
|
|
||||||
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
|
||||||
)
|
|
||||||
else ()
|
else ()
|
||||||
if (NOT GIT_FOUND)
|
if (NOT GIT_FOUND)
|
||||||
find_package (Git)
|
find_package (Git)
|
||||||
@@ -52,13 +43,6 @@ else ()
|
|||||||
"#define PROJECT_VERSION \"${${project}_LABEL} (unknown git version)\"\n"
|
"#define PROJECT_VERSION \"${${project}_LABEL} (unknown git version)\"\n"
|
||||||
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
"#endif // OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||||
)
|
)
|
||||||
# Write header file with build timestamp
|
|
||||||
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
|
|
||||||
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
|
||||||
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
|
||||||
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
|
|
||||||
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
|
||||||
)
|
|
||||||
else ()
|
else ()
|
||||||
add_custom_target (update-version ALL
|
add_custom_target (update-version ALL
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ is_compiler_gcc_compatible ()
|
|||||||
|
|
||||||
if (CXX_COMPAT_GCC)
|
if (CXX_COMPAT_GCC)
|
||||||
# default warnings flags, if not set by user
|
# default warnings flags, if not set by user
|
||||||
set_default_option (CXX _warn_flag "-Wall -Wextra -Wshadow" "(^|\ )-W")
|
set_default_option (CXX _warn_flag "-Wall" "(^|\ )-W")
|
||||||
if (_warn_flag)
|
if (_warn_flag)
|
||||||
message (STATUS "All warnings enabled: ${_warn_flag}")
|
message (STATUS "All warnings enabled: ${_warn_flag}")
|
||||||
add_options (ALL_LANGUAGES ALL_BUILDS "${_warn_flag}")
|
add_options (ALL_LANGUAGES ALL_BUILDS "${_warn_flag}")
|
||||||
|
|||||||
138
cmake/Modules/compat-2.8.3/CMakeParseArguments.cmake
Normal file
138
cmake/Modules/compat-2.8.3/CMakeParseArguments.cmake
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
|
||||||
|
#
|
||||||
|
# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
|
||||||
|
# parsing the arguments given to that macro or function.
|
||||||
|
# It processes the arguments and defines a set of variables which hold the
|
||||||
|
# values of the respective options.
|
||||||
|
#
|
||||||
|
# The <options> argument contains all options for the respective macro,
|
||||||
|
# i.e. keywords which can be used when calling the macro without any value
|
||||||
|
# following, like e.g. the OPTIONAL keyword of the install() command.
|
||||||
|
#
|
||||||
|
# The <one_value_keywords> argument contains all keywords for this macro
|
||||||
|
# which are followed by one value, like e.g. DESTINATION keyword of the
|
||||||
|
# install() command.
|
||||||
|
#
|
||||||
|
# The <multi_value_keywords> argument contains all keywords for this macro
|
||||||
|
# which can be followed by more than one value, like e.g. the TARGETS or
|
||||||
|
# FILES keywords of the install() command.
|
||||||
|
#
|
||||||
|
# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
|
||||||
|
# keywords listed in <options>, <one_value_keywords> and
|
||||||
|
# <multi_value_keywords> a variable composed of the given <prefix>
|
||||||
|
# followed by "_" and the name of the respective keyword.
|
||||||
|
# These variables will then hold the respective value from the argument list.
|
||||||
|
# For the <options> keywords this will be TRUE or FALSE.
|
||||||
|
#
|
||||||
|
# All remaining arguments are collected in a variable
|
||||||
|
# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
|
||||||
|
# your macro was called with unrecognized parameters.
|
||||||
|
#
|
||||||
|
# As an example here a my_install() macro, which takes similar arguments as the
|
||||||
|
# real install() command:
|
||||||
|
#
|
||||||
|
# function(MY_INSTALL)
|
||||||
|
# set(options OPTIONAL FAST)
|
||||||
|
# set(oneValueArgs DESTINATION RENAME)
|
||||||
|
# set(multiValueArgs TARGETS CONFIGURATIONS)
|
||||||
|
# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||||
|
# ...
|
||||||
|
#
|
||||||
|
# Assume my_install() has been called like this:
|
||||||
|
# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
|
||||||
|
#
|
||||||
|
# After the cmake_parse_arguments() call the macro will have set the following
|
||||||
|
# variables:
|
||||||
|
# MY_INSTALL_OPTIONAL = TRUE
|
||||||
|
# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
|
||||||
|
# MY_INSTALL_DESTINATION = "bin"
|
||||||
|
# MY_INSTALL_RENAME = "" (was not used)
|
||||||
|
# MY_INSTALL_TARGETS = "foo;bar"
|
||||||
|
# MY_INSTALL_CONFIGURATIONS = "" (was not used)
|
||||||
|
# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
|
||||||
|
#
|
||||||
|
# You can the continue and process these variables.
|
||||||
|
#
|
||||||
|
# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
|
||||||
|
# another recognized keyword follows, this is interpreted as the beginning of
|
||||||
|
# the new option.
|
||||||
|
# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
|
||||||
|
# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
|
||||||
|
# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
|
||||||
|
if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
|
||||||
|
|
||||||
|
|
||||||
|
function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
|
||||||
|
# first set all result variables to empty/FALSE
|
||||||
|
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
|
||||||
|
set(${prefix}_${arg_name})
|
||||||
|
endforeach(arg_name)
|
||||||
|
|
||||||
|
foreach(option ${_optionNames})
|
||||||
|
set(${prefix}_${option} FALSE)
|
||||||
|
endforeach(option)
|
||||||
|
|
||||||
|
set(${prefix}_UNPARSED_ARGUMENTS)
|
||||||
|
|
||||||
|
set(insideValues FALSE)
|
||||||
|
set(currentArgName)
|
||||||
|
|
||||||
|
# now iterate over all arguments and fill the result variables
|
||||||
|
foreach(currentArg ${ARGN})
|
||||||
|
list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
|
||||||
|
list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
|
||||||
|
list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
|
||||||
|
|
||||||
|
if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
|
||||||
|
if(insideValues)
|
||||||
|
if("${insideValues}" STREQUAL "SINGLE")
|
||||||
|
set(${prefix}_${currentArgName} ${currentArg})
|
||||||
|
set(insideValues FALSE)
|
||||||
|
elseif("${insideValues}" STREQUAL "MULTI")
|
||||||
|
list(APPEND ${prefix}_${currentArgName} ${currentArg})
|
||||||
|
endif()
|
||||||
|
else(insideValues)
|
||||||
|
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
|
||||||
|
endif(insideValues)
|
||||||
|
else()
|
||||||
|
if(NOT ${optionIndex} EQUAL -1)
|
||||||
|
set(${prefix}_${currentArg} TRUE)
|
||||||
|
set(insideValues FALSE)
|
||||||
|
elseif(NOT ${singleArgIndex} EQUAL -1)
|
||||||
|
set(currentArgName ${currentArg})
|
||||||
|
set(${prefix}_${currentArgName})
|
||||||
|
set(insideValues "SINGLE")
|
||||||
|
elseif(NOT ${multiArgIndex} EQUAL -1)
|
||||||
|
set(currentArgName ${currentArg})
|
||||||
|
set(${prefix}_${currentArgName})
|
||||||
|
set(insideValues "MULTI")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endforeach(currentArg)
|
||||||
|
|
||||||
|
# propagate the result variables to the caller:
|
||||||
|
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
|
||||||
|
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
|
||||||
|
endforeach(arg_name)
|
||||||
|
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
|
||||||
|
|
||||||
|
endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)
|
||||||
47
cmake/Modules/compat-2.8.5/FindGit.cmake
Normal file
47
cmake/Modules/compat-2.8.5/FindGit.cmake
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# The module defines the following variables:
|
||||||
|
# GIT_EXECUTABLE - path to git command line client
|
||||||
|
# GIT_FOUND - true if the command line client was found
|
||||||
|
# Example usage:
|
||||||
|
# find_package(Git)
|
||||||
|
# if(GIT_FOUND)
|
||||||
|
# message("git found: ${GIT_EXECUTABLE}")
|
||||||
|
# endif()
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2010 Kitware, Inc.
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
# Look for 'git' or 'eg' (easy git)
|
||||||
|
#
|
||||||
|
set(git_names git eg)
|
||||||
|
|
||||||
|
# Prefer .cmd variants on Windows unless running in a Makefile
|
||||||
|
# in the MSYS shell.
|
||||||
|
#
|
||||||
|
if(WIN32)
|
||||||
|
if(NOT CMAKE_GENERATOR MATCHES "MSYS")
|
||||||
|
set(git_names git.cmd git eg.cmd eg)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_program(GIT_EXECUTABLE
|
||||||
|
NAMES ${git_names}
|
||||||
|
PATH_SUFFIXES Git/cmd Git/bin
|
||||||
|
DOC "git command line client"
|
||||||
|
)
|
||||||
|
mark_as_advanced(GIT_EXECUTABLE)
|
||||||
|
|
||||||
|
# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE)
|
||||||
61
cmake/Modules/compat-2.8.7/CMakePushCheckState.cmake
Normal file
61
cmake/Modules/compat-2.8.7/CMakePushCheckState.cmake
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# This module defines two macros:
|
||||||
|
# CMAKE_PUSH_CHECK_STATE()
|
||||||
|
# and
|
||||||
|
# CMAKE_POP_CHECK_STATE()
|
||||||
|
# These two macros can be used to save and restore the state of the variables
|
||||||
|
# CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS, CMAKE_REQUIRED_LIBRARIES
|
||||||
|
# and CMAKE_REQUIRED_INCLUDES used by the various Check-files coming with CMake,
|
||||||
|
# like e.g. check_function_exists() etc.
|
||||||
|
# The variable contents are pushed on a stack, pushing multiple times is supported.
|
||||||
|
# This is useful e.g. when executing such tests in a Find-module, where they have to be set,
|
||||||
|
# but after the Find-module has been executed they should have the same value
|
||||||
|
# as they had before.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# cmake_push_check_state()
|
||||||
|
# set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
|
||||||
|
# check_function_exists(...)
|
||||||
|
# cmake_pop_check_state()
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2006-2011 Alexander Neundorf, <neundorf@kde.org>
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
|
||||||
|
MACRO(CMAKE_PUSH_CHECK_STATE)
|
||||||
|
|
||||||
|
IF(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
|
||||||
|
SET(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
|
||||||
|
|
||||||
|
SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
|
||||||
|
SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
|
||||||
|
SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
|
||||||
|
SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
|
||||||
|
ENDMACRO(CMAKE_PUSH_CHECK_STATE)
|
||||||
|
|
||||||
|
MACRO(CMAKE_POP_CHECK_STATE)
|
||||||
|
|
||||||
|
# don't pop more than we pushed
|
||||||
|
IF("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
|
||||||
|
|
||||||
|
SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
|
SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
|
SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
|
|
||||||
|
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ENDMACRO(CMAKE_POP_CHECK_STATE)
|
||||||
624
cmake/Modules/compat-2.8.7/FindBLAS.cmake
Normal file
624
cmake/Modules/compat-2.8.7/FindBLAS.cmake
Normal file
@@ -0,0 +1,624 @@
|
|||||||
|
# - Find BLAS library
|
||||||
|
# This module finds an installed fortran library that implements the BLAS
|
||||||
|
# linear-algebra interface (see http://www.netlib.org/blas/).
|
||||||
|
# The list of libraries searched for is taken
|
||||||
|
# from the autoconf macro file, acx_blas.m4 (distributed at
|
||||||
|
# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
|
||||||
|
#
|
||||||
|
# This module sets the following variables:
|
||||||
|
# BLAS_FOUND - set to true if a library implementing the BLAS interface
|
||||||
|
# is found
|
||||||
|
# BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
|
||||||
|
# and -L).
|
||||||
|
# BLAS_LIBRARIES - uncached list of libraries (using full path name) to
|
||||||
|
# link against to use BLAS
|
||||||
|
# BLAS95_LIBRARIES - uncached list of libraries (using full path name)
|
||||||
|
# to link against to use BLAS95 interface
|
||||||
|
# BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
|
||||||
|
# is found
|
||||||
|
# BLA_STATIC if set on this determines what kind of linkage we do (static)
|
||||||
|
# BLA_VENDOR if set checks only the specified vendor, if not set checks
|
||||||
|
# all the possibilities
|
||||||
|
# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
|
||||||
|
##########
|
||||||
|
### List of vendors (BLA_VENDOR) valid in this module
|
||||||
|
## Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model),
|
||||||
|
## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic
|
||||||
|
# C/CXX should be enabled to use Intel mkl
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2007-2009 Kitware, Inc.
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
include(CheckFunctionExists)
|
||||||
|
include(CheckFortranFunctionExists)
|
||||||
|
|
||||||
|
set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
|
||||||
|
# Check the language being used
|
||||||
|
get_property( _LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES )
|
||||||
|
if( _LANGUAGES_ MATCHES Fortran )
|
||||||
|
set( _CHECK_FORTRAN TRUE )
|
||||||
|
elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) )
|
||||||
|
set( _CHECK_FORTRAN FALSE )
|
||||||
|
else()
|
||||||
|
if(BLAS_FIND_REQUIRED)
|
||||||
|
message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.")
|
||||||
|
else(BLAS_FIND_REQUIRED)
|
||||||
|
message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)")
|
||||||
|
return()
|
||||||
|
endif(BLAS_FIND_REQUIRED)
|
||||||
|
endif( )
|
||||||
|
|
||||||
|
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
|
||||||
|
# This macro checks for the existence of the combination of fortran libraries
|
||||||
|
# given by _list. If the combination is found, this macro checks (using the
|
||||||
|
# Check_Fortran_Function_Exists macro) whether can link against that library
|
||||||
|
# combination using the name of a routine given by _name using the linker
|
||||||
|
# flags given by _flags. If the combination of libraries is found and passes
|
||||||
|
# the link test, LIBRARIES is set to the list of complete library paths that
|
||||||
|
# have been found. Otherwise, LIBRARIES is set to FALSE.
|
||||||
|
|
||||||
|
# N.B. _prefix is the prefix applied to the names of all cached variables that
|
||||||
|
# are generated internally and marked advanced by this macro.
|
||||||
|
|
||||||
|
set(_libdir ${ARGN})
|
||||||
|
|
||||||
|
set(_libraries_work TRUE)
|
||||||
|
set(${LIBRARIES})
|
||||||
|
set(_combined_name)
|
||||||
|
if (NOT _libdir)
|
||||||
|
if (WIN32)
|
||||||
|
set(_libdir ENV LIB)
|
||||||
|
elseif (APPLE)
|
||||||
|
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH)
|
||||||
|
else ()
|
||||||
|
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
foreach(_library ${_list})
|
||||||
|
set(_combined_name ${_combined_name}_${_library})
|
||||||
|
|
||||||
|
if(_libraries_work)
|
||||||
|
if (BLA_STATIC)
|
||||||
|
if (WIN32)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
endif ( WIN32 )
|
||||||
|
if (APPLE)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
else (APPLE)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
endif (APPLE)
|
||||||
|
else (BLA_STATIC)
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
# for ubuntu's libblas3gf and liblapack3gf packages
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
|
||||||
|
endif ()
|
||||||
|
endif (BLA_STATIC)
|
||||||
|
find_library(${_prefix}_${_library}_LIBRARY
|
||||||
|
NAMES ${_library}
|
||||||
|
PATHS ${_libdir}
|
||||||
|
)
|
||||||
|
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
|
||||||
|
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
||||||
|
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
|
||||||
|
endif(_libraries_work)
|
||||||
|
endforeach(_library ${_list})
|
||||||
|
if(_libraries_work)
|
||||||
|
# Test this combination of libraries.
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads})
|
||||||
|
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
|
if (_CHECK_FORTRAN)
|
||||||
|
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
|
||||||
|
else()
|
||||||
|
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
|
||||||
|
endif()
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
|
||||||
|
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
|
||||||
|
endif(_libraries_work)
|
||||||
|
if(NOT _libraries_work)
|
||||||
|
set(${LIBRARIES} FALSE)
|
||||||
|
endif(NOT _libraries_work)
|
||||||
|
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
|
||||||
|
endmacro(Check_Fortran_Libraries)
|
||||||
|
|
||||||
|
set(BLAS_LINKER_FLAGS)
|
||||||
|
set(BLAS_LIBRARIES)
|
||||||
|
set(BLAS95_LIBRARIES)
|
||||||
|
if ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||||
|
set(BLA_VENDOR $ENV{BLA_VENDOR})
|
||||||
|
else ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||||
|
if(NOT BLA_VENDOR)
|
||||||
|
set(BLA_VENDOR "All")
|
||||||
|
endif(NOT BLA_VENDOR)
|
||||||
|
endif ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||||
|
|
||||||
|
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
# gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"goto2"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
dgemm
|
||||||
|
""
|
||||||
|
"f77blas;atlas"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
|
||||||
|
if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"sgemm;dgemm;blas"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
# BLAS in Alpha CXML library?
|
||||||
|
if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"cxml"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
# BLAS in Alpha DXML library? (now called CXML, see above)
|
||||||
|
if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"dxml"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
# BLAS in Sun Performance library?
|
||||||
|
if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
"-xlic_lib=sunperf"
|
||||||
|
"sunperf;sunmath"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
if(BLAS_LIBRARIES)
|
||||||
|
set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
|
||||||
|
endif(BLAS_LIBRARIES)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
# BLAS in SCSL library? (SGI/Cray Scientific Library)
|
||||||
|
if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"scsl"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
# BLAS in SGIMATH library?
|
||||||
|
if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"complib.sgimath"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
|
||||||
|
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"essl;blas"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
#BLAS in acml library?
|
||||||
|
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if( ((BLA_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR
|
||||||
|
((BLA_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) OR
|
||||||
|
((BLA_VENDOR STREQUAL "ACML_GPU") AND (NOT BLAS_ACML_GPU_LIB_DIRS))
|
||||||
|
)
|
||||||
|
# try to find acml in "standard" paths
|
||||||
|
if( WIN32 )
|
||||||
|
file( GLOB _ACML_ROOT "C:/AMD/acml*/ACML-EULA.txt" )
|
||||||
|
else()
|
||||||
|
file( GLOB _ACML_ROOT "/opt/acml*/ACML-EULA.txt" )
|
||||||
|
endif()
|
||||||
|
if( WIN32 )
|
||||||
|
file( GLOB _ACML_GPU_ROOT "C:/AMD/acml*/GPGPUexamples" )
|
||||||
|
else()
|
||||||
|
file( GLOB _ACML_GPU_ROOT "/opt/acml*/GPGPUexamples" )
|
||||||
|
endif()
|
||||||
|
list(GET _ACML_ROOT 0 _ACML_ROOT)
|
||||||
|
list(GET _ACML_GPU_ROOT 0 _ACML_GPU_ROOT)
|
||||||
|
if( _ACML_ROOT )
|
||||||
|
get_filename_component( _ACML_ROOT ${_ACML_ROOT} PATH )
|
||||||
|
if( SIZEOF_INTEGER EQUAL 8 )
|
||||||
|
set( _ACML_PATH_SUFFIX "_int64" )
|
||||||
|
else()
|
||||||
|
set( _ACML_PATH_SUFFIX "" )
|
||||||
|
endif()
|
||||||
|
if( CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" )
|
||||||
|
set( _ACML_COMPILER32 "ifort32" )
|
||||||
|
set( _ACML_COMPILER64 "ifort64" )
|
||||||
|
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "SunPro" )
|
||||||
|
set( _ACML_COMPILER32 "sun32" )
|
||||||
|
set( _ACML_COMPILER64 "sun64" )
|
||||||
|
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" )
|
||||||
|
set( _ACML_COMPILER32 "pgi32" )
|
||||||
|
if( WIN32 )
|
||||||
|
set( _ACML_COMPILER64 "win64" )
|
||||||
|
else()
|
||||||
|
set( _ACML_COMPILER64 "pgi64" )
|
||||||
|
endif()
|
||||||
|
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "Open64" )
|
||||||
|
# 32 bit builds not supported on Open64 but for code simplicity
|
||||||
|
# We'll just use the same directory twice
|
||||||
|
set( _ACML_COMPILER32 "open64_64" )
|
||||||
|
set( _ACML_COMPILER64 "open64_64" )
|
||||||
|
elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" )
|
||||||
|
set( _ACML_COMPILER32 "nag32" )
|
||||||
|
set( _ACML_COMPILER64 "nag64" )
|
||||||
|
else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" )
|
||||||
|
set( _ACML_COMPILER32 "gfortran32" )
|
||||||
|
set( _ACML_COMPILER64 "gfortran64" )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if( BLA_VENDOR STREQUAL "ACML_MP" )
|
||||||
|
set(_ACML_MP_LIB_DIRS
|
||||||
|
"${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib"
|
||||||
|
"${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" )
|
||||||
|
else() #if( _BLAS_VENDOR STREQUAL "ACML" )
|
||||||
|
set(_ACML_LIB_DIRS
|
||||||
|
"${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib"
|
||||||
|
"${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
elseif(BLAS_${BLA_VENDOR}_LIB_DIRS)
|
||||||
|
set(_${BLA_VENDOR}_LIB_DIRS ${BLAS_${BLA_VENDOR}_LIB_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if( BLA_VENDOR STREQUAL "ACML_MP" )
|
||||||
|
foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS})
|
||||||
|
check_fortran_libraries (
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
"" "acml_mp;acml_mv" "" ${BLAS_ACML_MP_LIB_DIRS}
|
||||||
|
)
|
||||||
|
if( BLAS_LIBRARIES )
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
elseif( BLA_VENDOR STREQUAL "ACML_GPU" )
|
||||||
|
foreach( BLAS_ACML_GPU_LIB_DIRS ${_ACML_GPU_LIB_DIRS})
|
||||||
|
check_fortran_libraries (
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
"" "acml;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS}
|
||||||
|
)
|
||||||
|
if( BLAS_LIBRARIES )
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
else() #if( _BLAS_VENDOR STREQUAL "ACML" )
|
||||||
|
foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} )
|
||||||
|
check_fortran_libraries (
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
"" "acml;acml_mv" "" ${BLAS_ACML_LIB_DIRS}
|
||||||
|
)
|
||||||
|
if( BLAS_LIBRARIES )
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Either acml or acml_mp should be in LD_LIBRARY_PATH but not both
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"acml;acml_mv"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"acml_mp;acml_mv"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"acml;acml_mv;CALBLAS"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif () # ACML
|
||||||
|
|
||||||
|
# Apple BLAS library?
|
||||||
|
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
dgemm
|
||||||
|
""
|
||||||
|
"Accelerate"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if ( NOT BLAS_LIBRARIES )
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
dgemm
|
||||||
|
""
|
||||||
|
"vecLib"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif ( NOT BLAS_LIBRARIES )
|
||||||
|
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
# Generic BLAS library?
|
||||||
|
if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"blas"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
#BLAS in intel mkl 10 library? (em64t 64bit)
|
||||||
|
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if (NOT WIN32)
|
||||||
|
set(LM "-lm")
|
||||||
|
endif ()
|
||||||
|
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||||
|
if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
|
||||||
|
find_package(Threads)
|
||||||
|
else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
|
||||||
|
if (WIN32)
|
||||||
|
if(BLA_F95)
|
||||||
|
if(NOT BLAS95_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS95_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"mkl_blas95;mkl_intel_c;mkl_intel_thread;mkl_core;libguide40"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS95_LIBRARIES)
|
||||||
|
else(BLA_F95)
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
SGEMM
|
||||||
|
""
|
||||||
|
"mkl_c_dll;mkl_intel_thread_dll;mkl_core_dll;libguide40"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif(BLA_F95)
|
||||||
|
else(WIN32)
|
||||||
|
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(BLA_F95)
|
||||||
|
if(NOT BLAS95_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS95_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"mkl_blas95;mkl_intel;mkl_intel_thread;mkl_core;guide"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
|
)
|
||||||
|
endif(NOT BLAS95_LIBRARIES)
|
||||||
|
else(BLA_F95)
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"mkl_intel;mkl_intel_thread;mkl_core;guide"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT}"
|
||||||
|
"${LM}"
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif(BLA_F95)
|
||||||
|
endif (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(BLA_F95)
|
||||||
|
if(NOT BLAS95_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS95_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"mkl_blas95;mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
|
)
|
||||||
|
endif(NOT BLAS95_LIBRARIES)
|
||||||
|
else(BLA_F95)
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif(BLA_F95)
|
||||||
|
endif (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
endif (WIN32)
|
||||||
|
#older vesions of intel mkl libs
|
||||||
|
# BLAS in intel mkl library? (shared)
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"mkl;guide"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
#BLAS in intel mkl library? (static, 32bit)
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"mkl_ia32;guide"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
#BLAS in intel mkl library? (static, em64t 64bit)
|
||||||
|
if(NOT BLAS_LIBRARIES)
|
||||||
|
check_fortran_libraries(
|
||||||
|
BLAS_LIBRARIES
|
||||||
|
BLAS
|
||||||
|
sgemm
|
||||||
|
""
|
||||||
|
"mkl_em64t;guide"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
|
)
|
||||||
|
endif(NOT BLAS_LIBRARIES)
|
||||||
|
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||||
|
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
|
||||||
|
if(BLA_F95)
|
||||||
|
if(BLAS95_LIBRARIES)
|
||||||
|
set(BLAS95_FOUND TRUE)
|
||||||
|
else(BLAS95_LIBRARIES)
|
||||||
|
set(BLAS95_FOUND FALSE)
|
||||||
|
endif(BLAS95_LIBRARIES)
|
||||||
|
|
||||||
|
if(NOT BLAS_FIND_QUIETLY)
|
||||||
|
if(BLAS95_FOUND)
|
||||||
|
message(STATUS "A library with BLAS95 API found.")
|
||||||
|
else(BLAS95_FOUND)
|
||||||
|
if(BLAS_FIND_REQUIRED)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"A required library with BLAS95 API not found. Please specify library location.")
|
||||||
|
else(BLAS_FIND_REQUIRED)
|
||||||
|
message(STATUS
|
||||||
|
"A library with BLAS95 API not found. Please specify library location.")
|
||||||
|
endif(BLAS_FIND_REQUIRED)
|
||||||
|
endif(BLAS95_FOUND)
|
||||||
|
endif(NOT BLAS_FIND_QUIETLY)
|
||||||
|
set(BLAS_FOUND TRUE)
|
||||||
|
set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
|
||||||
|
else(BLA_F95)
|
||||||
|
if(BLAS_LIBRARIES)
|
||||||
|
set(BLAS_FOUND TRUE)
|
||||||
|
else(BLAS_LIBRARIES)
|
||||||
|
set(BLAS_FOUND FALSE)
|
||||||
|
endif(BLAS_LIBRARIES)
|
||||||
|
|
||||||
|
if(NOT BLAS_FIND_QUIETLY)
|
||||||
|
if(BLAS_FOUND)
|
||||||
|
message(STATUS "A library with BLAS API found.")
|
||||||
|
else(BLAS_FOUND)
|
||||||
|
if(BLAS_FIND_REQUIRED)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"A required library with BLAS API not found. Please specify library location."
|
||||||
|
)
|
||||||
|
else(BLAS_FIND_REQUIRED)
|
||||||
|
message(STATUS
|
||||||
|
"A library with BLAS API not found. Please specify library location."
|
||||||
|
)
|
||||||
|
endif(BLAS_FIND_REQUIRED)
|
||||||
|
endif(BLAS_FOUND)
|
||||||
|
endif(NOT BLAS_FIND_QUIETLY)
|
||||||
|
endif(BLA_F95)
|
||||||
|
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
307
cmake/Modules/compat-2.8.7/FindLAPACK.cmake
Normal file
307
cmake/Modules/compat-2.8.7/FindLAPACK.cmake
Normal file
@@ -0,0 +1,307 @@
|
|||||||
|
# - Find LAPACK library
|
||||||
|
# This module finds an installed fortran library that implements the LAPACK
|
||||||
|
# linear-algebra interface (see http://www.netlib.org/lapack/).
|
||||||
|
#
|
||||||
|
# The approach follows that taken for the autoconf macro file, acx_lapack.m4
|
||||||
|
# (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
|
||||||
|
#
|
||||||
|
# This module sets the following variables:
|
||||||
|
# LAPACK_FOUND - set to true if a library implementing the LAPACK interface
|
||||||
|
# is found
|
||||||
|
# LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
|
||||||
|
# and -L).
|
||||||
|
# LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
|
||||||
|
# link against to use LAPACK
|
||||||
|
# LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
|
||||||
|
# link against to use LAPACK95
|
||||||
|
# LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
|
||||||
|
# interface is found
|
||||||
|
# BLA_STATIC if set on this determines what kind of linkage we do (static)
|
||||||
|
# BLA_VENDOR if set checks only the specified vendor, if not set checks
|
||||||
|
# all the possibilities
|
||||||
|
# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
|
||||||
|
### List of vendors (BLA_VENDOR) valid in this module
|
||||||
|
## Intel(mkl), ACML,Apple, NAS, Generic
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2007-2009 Kitware, Inc.
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
|
||||||
|
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||||
|
if (NOT _LANGUAGES_ MATCHES Fortran)
|
||||||
|
include(CheckFunctionExists)
|
||||||
|
else (NOT _LANGUAGES_ MATCHES Fortran)
|
||||||
|
include(CheckFortranFunctionExists)
|
||||||
|
endif (NOT _LANGUAGES_ MATCHES Fortran)
|
||||||
|
|
||||||
|
set(LAPACK_FOUND FALSE)
|
||||||
|
set(LAPACK95_FOUND FALSE)
|
||||||
|
|
||||||
|
# TODO: move this stuff to separate module
|
||||||
|
|
||||||
|
macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads)
|
||||||
|
# This macro checks for the existence of the combination of fortran libraries
|
||||||
|
# given by _list. If the combination is found, this macro checks (using the
|
||||||
|
# Check_Fortran_Function_Exists macro) whether can link against that library
|
||||||
|
# combination using the name of a routine given by _name using the linker
|
||||||
|
# flags given by _flags. If the combination of libraries is found and passes
|
||||||
|
# the link test, LIBRARIES is set to the list of complete library paths that
|
||||||
|
# have been found. Otherwise, LIBRARIES is set to FALSE.
|
||||||
|
|
||||||
|
# N.B. _prefix is the prefix applied to the names of all cached variables that
|
||||||
|
# are generated internally and marked advanced by this macro.
|
||||||
|
|
||||||
|
set(_libraries_work TRUE)
|
||||||
|
set(${LIBRARIES})
|
||||||
|
set(_combined_name)
|
||||||
|
if (NOT _libdir)
|
||||||
|
if (WIN32)
|
||||||
|
set(_libdir ENV LIB)
|
||||||
|
elseif (APPLE)
|
||||||
|
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH)
|
||||||
|
else ()
|
||||||
|
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
foreach(_library ${_list})
|
||||||
|
set(_combined_name ${_combined_name}_${_library})
|
||||||
|
|
||||||
|
if(_libraries_work)
|
||||||
|
if (BLA_STATIC)
|
||||||
|
if (WIN32)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
endif ( WIN32 )
|
||||||
|
if (APPLE)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
else (APPLE)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
endif (APPLE)
|
||||||
|
else (BLA_STATIC)
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
# for ubuntu's libblas3gf and liblapack3gf packages
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
|
||||||
|
endif ()
|
||||||
|
endif (BLA_STATIC)
|
||||||
|
find_library(${_prefix}_${_library}_LIBRARY
|
||||||
|
NAMES ${_library}
|
||||||
|
PATHS ${_libdir}
|
||||||
|
)
|
||||||
|
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
|
||||||
|
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
||||||
|
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
|
||||||
|
endif(_libraries_work)
|
||||||
|
endforeach(_library ${_list})
|
||||||
|
|
||||||
|
if(_libraries_work)
|
||||||
|
# Test this combination of libraries.
|
||||||
|
if(UNIX AND BLA_STATIC)
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group" ${${LIBRARIES}} ${_blas} "-Wl,--end-group" ${_threads})
|
||||||
|
else(UNIX AND BLA_STATIC)
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads})
|
||||||
|
endif(UNIX AND BLA_STATIC)
|
||||||
|
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
|
if (NOT _LANGUAGES_ MATCHES Fortran)
|
||||||
|
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
|
||||||
|
else (NOT _LANGUAGES_ MATCHES Fortran)
|
||||||
|
check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
|
||||||
|
endif (NOT _LANGUAGES_ MATCHES Fortran)
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
|
||||||
|
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
|
||||||
|
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
|
||||||
|
endif(_libraries_work)
|
||||||
|
|
||||||
|
if(_libraries_work)
|
||||||
|
set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads})
|
||||||
|
else(_libraries_work)
|
||||||
|
set(${LIBRARIES} FALSE)
|
||||||
|
endif(_libraries_work)
|
||||||
|
|
||||||
|
endmacro(Check_Lapack_Libraries)
|
||||||
|
|
||||||
|
|
||||||
|
set(LAPACK_LINKER_FLAGS)
|
||||||
|
set(LAPACK_LIBRARIES)
|
||||||
|
set(LAPACK95_LIBRARIES)
|
||||||
|
|
||||||
|
|
||||||
|
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||||
|
find_package(BLAS)
|
||||||
|
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||||
|
find_package(BLAS REQUIRED)
|
||||||
|
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||||
|
|
||||||
|
|
||||||
|
if(BLAS_FOUND)
|
||||||
|
set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
|
||||||
|
if ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||||
|
set(BLA_VENDOR $ENV{BLA_VENDOR})
|
||||||
|
else ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||||
|
if(NOT BLA_VENDOR)
|
||||||
|
set(BLA_VENDOR "All")
|
||||||
|
endif(NOT BLA_VENDOR)
|
||||||
|
endif ($ENV{BLA_VENDOR} MATCHES ".+")
|
||||||
|
|
||||||
|
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT LAPACK_LIBRARIES)
|
||||||
|
check_lapack_libraries(
|
||||||
|
LAPACK_LIBRARIES
|
||||||
|
LAPACK
|
||||||
|
cheev
|
||||||
|
""
|
||||||
|
"goto2"
|
||||||
|
"${BLAS_LIBRARIES}"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT LAPACK_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
|
||||||
|
#acml lapack
|
||||||
|
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if (BLAS_LIBRARIES MATCHES ".+acml.+")
|
||||||
|
set (LAPACK_LIBRARIES ${BLAS_LIBRARIES})
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Apple LAPACK library?
|
||||||
|
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if(NOT LAPACK_LIBRARIES)
|
||||||
|
check_lapack_libraries(
|
||||||
|
LAPACK_LIBRARIES
|
||||||
|
LAPACK
|
||||||
|
cheev
|
||||||
|
""
|
||||||
|
"Accelerate"
|
||||||
|
"${BLAS_LIBRARIES}"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif(NOT LAPACK_LIBRARIES)
|
||||||
|
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if ( NOT LAPACK_LIBRARIES )
|
||||||
|
check_lapack_libraries(
|
||||||
|
LAPACK_LIBRARIES
|
||||||
|
LAPACK
|
||||||
|
cheev
|
||||||
|
""
|
||||||
|
"vecLib"
|
||||||
|
"${BLAS_LIBRARIES}"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif ( NOT LAPACK_LIBRARIES )
|
||||||
|
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
# Generic LAPACK library?
|
||||||
|
if (BLA_VENDOR STREQUAL "Generic" OR
|
||||||
|
BLA_VENDOR STREQUAL "ATLAS" OR
|
||||||
|
BLA_VENDOR STREQUAL "All")
|
||||||
|
if ( NOT LAPACK_LIBRARIES )
|
||||||
|
check_lapack_libraries(
|
||||||
|
LAPACK_LIBRARIES
|
||||||
|
LAPACK
|
||||||
|
cheev
|
||||||
|
""
|
||||||
|
"lapack"
|
||||||
|
"${BLAS_LIBRARIES}"
|
||||||
|
""
|
||||||
|
)
|
||||||
|
endif ( NOT LAPACK_LIBRARIES )
|
||||||
|
endif ()
|
||||||
|
#intel lapack
|
||||||
|
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||||
|
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||||
|
find_PACKAGE(Threads)
|
||||||
|
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||||
|
if (BLA_F95)
|
||||||
|
if(NOT LAPACK95_LIBRARIES)
|
||||||
|
check_lapack_libraries(
|
||||||
|
LAPACK95_LIBRARIES
|
||||||
|
LAPACK
|
||||||
|
cheev
|
||||||
|
""
|
||||||
|
"mkl_lapack95"
|
||||||
|
"${BLAS95_LIBRARIES}"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT}"
|
||||||
|
)
|
||||||
|
endif(NOT LAPACK95_LIBRARIES)
|
||||||
|
else(BLA_F95)
|
||||||
|
if(NOT LAPACK_LIBRARIES)
|
||||||
|
check_lapack_libraries(
|
||||||
|
LAPACK_LIBRARIES
|
||||||
|
LAPACK
|
||||||
|
cheev
|
||||||
|
""
|
||||||
|
"mkl_lapack"
|
||||||
|
"${BLAS_LIBRARIES}"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT}"
|
||||||
|
)
|
||||||
|
endif(NOT LAPACK_LIBRARIES)
|
||||||
|
endif(BLA_F95)
|
||||||
|
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||||
|
endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
else(BLAS_FOUND)
|
||||||
|
message(STATUS "LAPACK requires BLAS")
|
||||||
|
endif(BLAS_FOUND)
|
||||||
|
|
||||||
|
if(BLA_F95)
|
||||||
|
if(LAPACK95_LIBRARIES)
|
||||||
|
set(LAPACK95_FOUND TRUE)
|
||||||
|
else(LAPACK95_LIBRARIES)
|
||||||
|
set(LAPACK95_FOUND FALSE)
|
||||||
|
endif(LAPACK95_LIBRARIES)
|
||||||
|
if(NOT LAPACK_FIND_QUIETLY)
|
||||||
|
if(LAPACK95_FOUND)
|
||||||
|
message(STATUS "A library with LAPACK95 API found.")
|
||||||
|
else(LAPACK95_FOUND)
|
||||||
|
if(LAPACK_FIND_REQUIRED)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"A required library with LAPACK95 API not found. Please specify library location."
|
||||||
|
)
|
||||||
|
else(LAPACK_FIND_REQUIRED)
|
||||||
|
message(STATUS
|
||||||
|
"A library with LAPACK95 API not found. Please specify library location."
|
||||||
|
)
|
||||||
|
endif(LAPACK_FIND_REQUIRED)
|
||||||
|
endif(LAPACK95_FOUND)
|
||||||
|
endif(NOT LAPACK_FIND_QUIETLY)
|
||||||
|
set(LAPACK_FOUND "${LAPACK95_FOUND}")
|
||||||
|
set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}")
|
||||||
|
else(BLA_F95)
|
||||||
|
if(LAPACK_LIBRARIES)
|
||||||
|
set(LAPACK_FOUND TRUE)
|
||||||
|
else(LAPACK_LIBRARIES)
|
||||||
|
set(LAPACK_FOUND FALSE)
|
||||||
|
endif(LAPACK_LIBRARIES)
|
||||||
|
|
||||||
|
if(NOT LAPACK_FIND_QUIETLY)
|
||||||
|
if(LAPACK_FOUND)
|
||||||
|
message(STATUS "A library with LAPACK API found.")
|
||||||
|
else(LAPACK_FOUND)
|
||||||
|
if(LAPACK_FIND_REQUIRED)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"A required library with LAPACK API not found. Please specify library location."
|
||||||
|
)
|
||||||
|
else(LAPACK_FIND_REQUIRED)
|
||||||
|
message(STATUS
|
||||||
|
"A library with LAPACK API not found. Please specify library location."
|
||||||
|
)
|
||||||
|
endif(LAPACK_FIND_REQUIRED)
|
||||||
|
endif(LAPACK_FOUND)
|
||||||
|
endif(NOT LAPACK_FIND_QUIETLY)
|
||||||
|
endif(BLA_F95)
|
||||||
|
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
45
cmake/Modules/ewoms-prereqs.cmake
Normal file
45
cmake/Modules/ewoms-prereqs.cmake
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# -*- 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:
|
||||||
|
|
||||||
|
# this avoids an annoying deprecation warning on DUNE 2.4 (which we
|
||||||
|
# are not interested in anyway)
|
||||||
|
set(DUNE_AVOID_CAPABILITIES_IS_PARALLEL_DEPRECATION_WARNING 1)
|
||||||
|
|
||||||
|
# defines that must be present in config.h for our headers
|
||||||
|
set (ewoms_CONFIG_VAR
|
||||||
|
HAVE_QUAD
|
||||||
|
HAVE_VALGRIND
|
||||||
|
HAVE_DUNE_COMMON
|
||||||
|
HAVE_DUNE_GEOMETRY
|
||||||
|
HAVE_DUNE_GRID
|
||||||
|
HAVE_DUNE_LOCALFUNCTIONS
|
||||||
|
HAVE_DUNE_ISTL
|
||||||
|
HAVE_DUNE_ALUGRID
|
||||||
|
HAVE_DUNE_FEM
|
||||||
|
DUNE_AVOID_CAPABILITIES_IS_PARALLEL_DEPRECATION_WARNING
|
||||||
|
)
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
set (ewoms_DEPS
|
||||||
|
# compile with C++0x/11 support if available
|
||||||
|
"CXX11Features REQUIRED"
|
||||||
|
# DUNE prerequisites
|
||||||
|
"dune-common REQUIRED"
|
||||||
|
"dune-geometry REQUIRED"
|
||||||
|
"dune-grid REQUIRED"
|
||||||
|
"dune-istl REQUIRED"
|
||||||
|
"opm-common REQUIRED"
|
||||||
|
"opm-material REQUIRED"
|
||||||
|
"dune-localfunctions"
|
||||||
|
"dune-alugrid"
|
||||||
|
"dune-fem"
|
||||||
|
"opm-parser"
|
||||||
|
"opm-grid"
|
||||||
|
"opm-core"
|
||||||
|
# librt (on some systems necessary for clock_gettime())
|
||||||
|
"librt REQUIRED"
|
||||||
|
# valgrind client requests
|
||||||
|
"Valgrind"
|
||||||
|
# quadruple precision floating point calculations
|
||||||
|
"Quadmath"
|
||||||
|
)
|
||||||
19
cmake/Modules/opm-benchmarks-prereqs.cmake
Normal file
19
cmake/Modules/opm-benchmarks-prereqs.cmake
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# -*- 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"
|
||||||
|
)
|
||||||
17
cmake/Modules/opm-common-prereqs.cmake
Normal file
17
cmake/Modules/opm-common-prereqs.cmake
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# -*- 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-common_CONFIG_VAR
|
||||||
|
"HAS_ATTRIBUTE_UNUSED")
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
set (opm-common_DEPS
|
||||||
|
# compile with C99 support if available
|
||||||
|
"C99"
|
||||||
|
# compile with C++0x/11 support if available
|
||||||
|
"CXX11Features REQUIRED"
|
||||||
|
# various runtime library enhancements
|
||||||
|
"Boost 1.44.0
|
||||||
|
COMPONENTS system unit_test_framework REQUIRED"
|
||||||
|
)
|
||||||
52
cmake/Modules/opm-core-prereqs.cmake
Normal file
52
cmake/Modules/opm-core-prereqs.cmake
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# -*- 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-core_CONFIG_VAR
|
||||||
|
HAVE_ERT
|
||||||
|
HAVE_SUITESPARSE_UMFPACK_H
|
||||||
|
HAVE_DUNE_ISTL
|
||||||
|
HAVE_MPI
|
||||||
|
HAVE_PETSC
|
||||||
|
DUNE_ISTL_VERSION_MAJOR
|
||||||
|
DUNE_ISTL_VERSION_MINOR
|
||||||
|
DUNE_ISTL_VERSION_REVISION
|
||||||
|
)
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
set (opm-core_DEPS
|
||||||
|
# compile with C99 support if available
|
||||||
|
"C99"
|
||||||
|
# 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"
|
||||||
|
# matrix library
|
||||||
|
"BLAS REQUIRED"
|
||||||
|
"LAPACK REQUIRED"
|
||||||
|
# Tim Davis' SuiteSparse archive
|
||||||
|
"SuiteSparse COMPONENTS umfpack"
|
||||||
|
# solver
|
||||||
|
"SuperLU"
|
||||||
|
# xml processing (for config parsing)
|
||||||
|
"TinyXML"
|
||||||
|
# Ensembles-based Reservoir Tools (ERT)
|
||||||
|
"ERT REQUIRED"
|
||||||
|
# Look for MPI support
|
||||||
|
"MPI"
|
||||||
|
# PETSc numerical backend
|
||||||
|
"PETSc"
|
||||||
|
# DUNE dependency
|
||||||
|
"dune-common"
|
||||||
|
"dune-istl"
|
||||||
|
"opm-common REQUIRED"
|
||||||
|
# Parser library for ECL-type simulation models
|
||||||
|
"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"
|
||||||
|
)
|
||||||
21
cmake/Modules/opm-flowdiagnostics-applications-prereqs.cmake
Normal file
21
cmake/Modules/opm-flowdiagnostics-applications-prereqs.cmake
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# -*- 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-flowdiagnostics-applications_CONFIG_VAR
|
||||||
|
)
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
set (opm-flowdiagnostics-applications_DEPS
|
||||||
|
# compile with C99 support if available
|
||||||
|
"C99"
|
||||||
|
# compile with C++0x/11 support if available
|
||||||
|
"CXX11Features REQUIRED"
|
||||||
|
"Boost 1.44.0
|
||||||
|
COMPONENTS filesystem regex system unit_test_framework REQUIRED"
|
||||||
|
"ERT REQUIRED"
|
||||||
|
# prerequisite OPM modules
|
||||||
|
"opm-common REQUIRED;
|
||||||
|
opm-flowdiagnostics REQUIRED;
|
||||||
|
opm-core REQUIRED"
|
||||||
|
)
|
||||||
18
cmake/Modules/opm-flowdiagnostics-prereqs.cmake
Normal file
18
cmake/Modules/opm-flowdiagnostics-prereqs.cmake
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# -*- 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-flowdiagnostics_CONFIG_VAR
|
||||||
|
)
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
set (opm-flowdiagnostics_DEPS
|
||||||
|
# compile with C99 support if available
|
||||||
|
"C99"
|
||||||
|
# compile with C++0x/11 support if available
|
||||||
|
"CXX11Features REQUIRED"
|
||||||
|
"Boost 1.44.0
|
||||||
|
COMPONENTS unit_test_framework REQUIRED"
|
||||||
|
# prerequisite OPM modules
|
||||||
|
"opm-common REQUIRED"
|
||||||
|
)
|
||||||
33
cmake/Modules/opm-grid-prereqs.cmake
Normal file
33
cmake/Modules/opm-grid-prereqs.cmake
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# -*- 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-grid_CONFIG_VAR
|
||||||
|
DUNE_GRID_VERSION_MAJOR
|
||||||
|
DUNE_GRID_VERSION_MINOR
|
||||||
|
DUNE_GRID_VERSION_REVISION
|
||||||
|
DUNE_COMMON_VERSION_MAJOR
|
||||||
|
DUNE_COMMON_VERSION_MINOR
|
||||||
|
DUNE_COMMON_VERSION_REVISION
|
||||||
|
HAVE_DUNE_ISTL
|
||||||
|
HAVE_MPI
|
||||||
|
HAVE_ZOLTAN
|
||||||
|
)
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
set (opm-grid_DEPS
|
||||||
|
# compile with C99 support if available
|
||||||
|
"C99"
|
||||||
|
# compile with C++0x/11 support if available
|
||||||
|
"CXX11Features"
|
||||||
|
# various runtime library enhancements
|
||||||
|
"Boost 1.44.0
|
||||||
|
COMPONENTS date_time filesystem system unit_test_framework REQUIRED"
|
||||||
|
"MPI"
|
||||||
|
"dune-common"
|
||||||
|
"dune-grid REQUIRED"
|
||||||
|
"dune-istl"
|
||||||
|
"opm-common REQUIRED"
|
||||||
|
"opm-parser REQUIRED"
|
||||||
|
"ZOLTAN"
|
||||||
|
)
|
||||||
25
cmake/Modules/opm-material-prereqs.cmake
Normal file
25
cmake/Modules/opm-material-prereqs.cmake
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# -*- 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-material_CONFIG_VAR
|
||||||
|
HAVE_MPI
|
||||||
|
HAVE_TYPE_TRAITS
|
||||||
|
HAVE_VALGRIND
|
||||||
|
HAVE_FINAL
|
||||||
|
)
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
set (opm-material_DEPS
|
||||||
|
# compile with C99 support if available
|
||||||
|
"C99"
|
||||||
|
# compile with C++0x/11 support if available
|
||||||
|
"CXX11Features REQUIRED"
|
||||||
|
# prerequisite OPM modules
|
||||||
|
"opm-parser"
|
||||||
|
"opm-common REQUIRED"
|
||||||
|
# DUNE dependency
|
||||||
|
"dune-common REQUIRED"
|
||||||
|
# valgrind client requests
|
||||||
|
"Valgrind"
|
||||||
|
)
|
||||||
24
cmake/Modules/opm-output-prereqs.cmake
Normal file
24
cmake/Modules/opm-output-prereqs.cmake
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# -*- 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-output_CONFIG_VAR
|
||||||
|
HAVE_ERT
|
||||||
|
)
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
set (opm-output_DEPS
|
||||||
|
# compile with C99 support if available
|
||||||
|
"C99"
|
||||||
|
# compile with C++0x/11 support if available
|
||||||
|
"CXX11Features REQUIRED"
|
||||||
|
# various runtime library enhancements
|
||||||
|
"Boost 1.44.0
|
||||||
|
COMPONENTS unit_test_framework REQUIRED"
|
||||||
|
# Ensembles-based Reservoir Tools (ERT)
|
||||||
|
"ERT REQUIRED"
|
||||||
|
# Look for MPI support
|
||||||
|
"opm-common REQUIRED"
|
||||||
|
# Parser library for ECL-type simulation models
|
||||||
|
"opm-parser REQUIRED"
|
||||||
|
)
|
||||||
36
cmake/Modules/opm-simulators-prereqs.cmake
Normal file
36
cmake/Modules/opm-simulators-prereqs.cmake
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# -*- 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-simulators_CONFIG_VAR
|
||||||
|
HAVE_OPM_GRID
|
||||||
|
HAVE_PTHREAD
|
||||||
|
HAVE_EWOMS
|
||||||
|
DUNE_ISTL_VERSION_MAJOR
|
||||||
|
DUNE_ISTL_VERSION_MINOR
|
||||||
|
DUNE_ISTL_VERSION_REVISION
|
||||||
|
)
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
set (opm-simulators_DEPS
|
||||||
|
# Compile with C99 support if available
|
||||||
|
"C99"
|
||||||
|
# Compile with C++0x/11 support if available
|
||||||
|
"CXX11Features"
|
||||||
|
# Various runtime library enhancements
|
||||||
|
"Boost 1.44.0
|
||||||
|
COMPONENTS date_time filesystem system unit_test_framework REQUIRED"
|
||||||
|
# DUNE prerequisites
|
||||||
|
"dune-common REQUIRED;
|
||||||
|
dune-istl REQUIRED"
|
||||||
|
"ERTPython"
|
||||||
|
# OPM dependency
|
||||||
|
"opm-common REQUIRED;
|
||||||
|
opm-parser REQUIRED;
|
||||||
|
opm-grid REQUIRED;
|
||||||
|
opm-core REQUIRED;
|
||||||
|
opm-output REQUIRED;
|
||||||
|
ewoms REQUIRED"
|
||||||
|
# Eigen
|
||||||
|
"Eigen3 3.2.0"
|
||||||
|
)
|
||||||
32
cmake/Modules/opm-upscaling-prereqs.cmake
Normal file
32
cmake/Modules/opm-upscaling-prereqs.cmake
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# -*- 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-upscaling_CONFIG_VAR
|
||||||
|
HAVE_SUPERLU
|
||||||
|
)
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
set (opm-upscaling_DEPS
|
||||||
|
# compile with C99 support if available
|
||||||
|
"C99"
|
||||||
|
# compile with C++0x/11 support if available
|
||||||
|
"CXX11Features"
|
||||||
|
# various runtime library enhancements
|
||||||
|
"Boost 1.44.0
|
||||||
|
COMPONENTS date_time filesystem system iostreams unit_test_framework REQUIRED"
|
||||||
|
# matrix library
|
||||||
|
"BLAS REQUIRED"
|
||||||
|
"LAPACK REQUIRED"
|
||||||
|
# solver
|
||||||
|
"SuperLU"
|
||||||
|
# DUNE dependency
|
||||||
|
"dune-common REQUIRED;
|
||||||
|
dune-istl REQUIRED;
|
||||||
|
dune-geometry REQUIRED;
|
||||||
|
dune-grid REQUIRED;
|
||||||
|
opm-common REQUIRED;
|
||||||
|
opm-grid REQUIRED;
|
||||||
|
opm-core REQUIRED;
|
||||||
|
opm-output REQUIRED"
|
||||||
|
)
|
||||||
@@ -31,15 +31,30 @@ if(NOT check_target)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Build threads
|
# Build threads
|
||||||
include(ProcessorCount)
|
|
||||||
set(build_threads $ENV{CHECK_THREADS})
|
set(build_threads $ENV{CHECK_THREADS})
|
||||||
if(NOT build_threads)
|
if(NOT build_threads)
|
||||||
ProcessorCount(build_threads)
|
if(UNIX)
|
||||||
if(build_threads EQUAL 0)
|
if(APPLE)
|
||||||
set(build_threads 1)
|
execute_process(COMMAND sysctl hw.ncpu
|
||||||
|
OUTPUT_VARIABLE build_threads)
|
||||||
|
string(REPLACE " " ";" build_threads_list ${build_threads)
|
||||||
|
list(GET build_threads_list 1 build_threads)
|
||||||
|
else()
|
||||||
|
find_program(NPROC_COMMAND nproc)
|
||||||
|
if(NPROC_COMMAND)
|
||||||
|
execute_process(COMMAND ${NPROC_COMMAND}
|
||||||
|
OUTPUT_VARIABLE build_threads)
|
||||||
|
string(REGEX REPLACE "(\r?\n)+$" "" build_threads "${build_threads}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# If for some reason we could not find the info - e.g. centos5 where nproc is missing
|
||||||
|
if(NOT build_threads)
|
||||||
|
set(build_threads 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Record current HEAD
|
# Record current HEAD
|
||||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||||
OUTPUT_VARIABLE current_branch
|
OUTPUT_VARIABLE current_branch
|
||||||
|
|||||||
@@ -47,8 +47,6 @@ if (sha1)
|
|||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
string (TIMESTAMP build_timestamp "%Y-%m-%d at %H:%M:%S hrs")
|
|
||||||
|
|
||||||
# write the content to a temporary file in a C compatible format
|
# write the content to a temporary file in a C compatible format
|
||||||
file (WRITE "${PROJECT_BINARY_DIR}/project-version.tmp"
|
file (WRITE "${PROJECT_BINARY_DIR}/project-version.tmp"
|
||||||
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
"#ifndef OPM_GENERATED_OPM_VERSION_HEADER_INCLUDED\n"
|
||||||
@@ -65,11 +63,3 @@ file (WRITE "${PROJECT_BINARY_DIR}/project-version.tmp"
|
|||||||
execute_process (COMMAND
|
execute_process (COMMAND
|
||||||
${CMAKE_COMMAND} -E copy_if_different "${PROJECT_BINARY_DIR}/project-version.tmp" "${PROJECT_BINARY_DIR}/project-version.h"
|
${CMAKE_COMMAND} -E copy_if_different "${PROJECT_BINARY_DIR}/project-version.tmp" "${PROJECT_BINARY_DIR}/project-version.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Write header file with build timestamp
|
|
||||||
file (WRITE "${PROJECT_BINARY_DIR}/project-timestamp.h"
|
|
||||||
"#ifndef OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
|
||||||
"#define OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
|
||||||
"#define BUILD_TIMESTAMP \"${build_timestamp}\"\n"
|
|
||||||
"#endif // OPM_GENERATED_OPM_TIMESTAMP_HEADER_INCLUDED\n"
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/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
|
|
||||||
553
cmake/Scripts/configure
vendored
Executable file
553
cmake/Scripts/configure
vendored
Executable file
@@ -0,0 +1,553 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# where is the source tree located by default relative to here
|
||||||
|
srcdir=$(dirname "$(dirname "$(dirname "$0")")")
|
||||||
|
|
||||||
|
# display help text
|
||||||
|
usage () {
|
||||||
|
cat <<EOF
|
||||||
|
Installation directories:
|
||||||
|
--prefix=PREFIX install architecture-independent files in PREFIX
|
||||||
|
[/usr/local]. Note: set DESTDIR=PATH when doing
|
||||||
|
\`make install' to install to a different sysroot.
|
||||||
|
|
||||||
|
Optional Features:
|
||||||
|
--disable-FEATURE do not include FEATURE
|
||||||
|
--disable-gxx11check do not try flag -std=c++11 to enable C++11 features
|
||||||
|
--enable-shared build a shared library [default=yes]
|
||||||
|
--enable-static build a static library [default=no]. Note: only one
|
||||||
|
of the options shared and static may be built.
|
||||||
|
--enable-debug build a non-optimized version of the library
|
||||||
|
[default=no]
|
||||||
|
--disable-runpath do not use RUNPATH in installed library [default=yes]
|
||||||
|
--enable-lto use whole program optimization [default=no]
|
||||||
|
--enable-strip-debug separate the executable code and the debugging symbols [default=no]
|
||||||
|
--disable-tests do not compile and enable unit tests [default=yes]
|
||||||
|
--disable-examples do not compile example programs [default=yes]
|
||||||
|
--disable-pch do not use precompiled headers (if buggy compiler)
|
||||||
|
--disable-silent-rules print every compilation statement as executed
|
||||||
|
--enable-system-debug put .debug files in global GDB debug dir
|
||||||
|
[default=yes if prefix=/usr, no otherwise]
|
||||||
|
--enable-parallel process in parallel using MPI [default=no]
|
||||||
|
--enable-openmp activate experimental support for OpenMP
|
||||||
|
--disable-option-checking ignore unrecognized --enable/--with options
|
||||||
|
--enable-underscoring assume Fortran routines have _ suffix [default=no]
|
||||||
|
--enable-ninja use Ninja build generator [default=no]
|
||||||
|
(automatically implies --enable-underscoring)
|
||||||
|
--config-cache Reuse build configuration cache from a previous run
|
||||||
|
|
||||||
|
Optional Packages:
|
||||||
|
--with-ug=PATH use the UG libraries from a specified location
|
||||||
|
--with-alugrid=PATH use the ALUGrid library from a specified location
|
||||||
|
--with-metis=PATH use the METIS graph partitioning library from a specified location
|
||||||
|
--with-boost=PATH use Boost library from a specified location
|
||||||
|
--with-dune=PATH specify parent of all DUNE modules not specified
|
||||||
|
--with-dune-MODULE=PATH use given DUNE module from a specified location
|
||||||
|
--with-opm=PATH specify parent of all OPM modules not specified
|
||||||
|
--with-opm-MODULE=PATH use given OPM module from a specified location
|
||||||
|
--with-superlu=PATH user defined path to SuperLU library
|
||||||
|
--with-umfpack=PATH use UMFPACK/SuiteSparse from a specified location
|
||||||
|
--with-ert=PATH Use ERT libraries
|
||||||
|
--with-zoltan=PATH Use ZOLTAN libraries
|
||||||
|
--with-tinyxml=PATH use TinyXML library from a specified location
|
||||||
|
(Note: if not found, then a bundled library will
|
||||||
|
be used)
|
||||||
|
--with-cmake=PROGRAM use this program instead of \`cmake' to configure
|
||||||
|
--with-buildname=TEXT description passed to the CDash configuration
|
||||||
|
--with-site=TEXT site passed to the CDash configuration
|
||||||
|
|
||||||
|
Some influential environment variables:
|
||||||
|
CC C compiler command
|
||||||
|
CFLAGS C compiler flags
|
||||||
|
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
|
||||||
|
nonstandard directory <lib dir>
|
||||||
|
LIBS libraries to pass to the linker, e.g. -l<library>
|
||||||
|
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
|
||||||
|
you have headers in a nonstandard directory <include dir>
|
||||||
|
CPP C preprocessor
|
||||||
|
CXX C++ compiler command
|
||||||
|
CXXFLAGS C++ compiler flags
|
||||||
|
CXXCPP C++ preprocessor
|
||||||
|
F77 Fortran 77 compiler command
|
||||||
|
FFLAGS Fortran 77 compiler flags
|
||||||
|
FC Fortran compiler command
|
||||||
|
FCFLAGS Fortran compiler flags
|
||||||
|
CMAKE_COMMAND Executable used to run cmake scripts
|
||||||
|
|
||||||
|
Use these variables to override the choices made by \`configure' or to help
|
||||||
|
it to find libraries and programs with nonstandard names/locations.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# report an error regarding the arguments
|
||||||
|
invalid_arg () {
|
||||||
|
cat <<EOF
|
||||||
|
configure: error: unrecognized option: \`$1'
|
||||||
|
Try \`$0 --help' for more information
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# notify the user that this argument is not known
|
||||||
|
unknown_arg () {
|
||||||
|
cat <<EOF
|
||||||
|
configure: warning: unrecognized option: \`$1'
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
# warn only if option checking is enabled
|
||||||
|
invalid_opt () {
|
||||||
|
if [ "${option_check}" = "yes" ]; then
|
||||||
|
unknown_arg "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# default values
|
||||||
|
prefix=/usr/local
|
||||||
|
#c_compiler=" -DCMAKE_C_COMPILER=cc"
|
||||||
|
c_compiler=
|
||||||
|
c_opts=
|
||||||
|
#cxx_compiler=" -DCMAKE_CXX_COMPILER=c++"
|
||||||
|
cxx_compiler=
|
||||||
|
cxx_opts=
|
||||||
|
#fort_compiler=" -DCMAKE_Fortran_COMPILER=fc"
|
||||||
|
fort_compiler=
|
||||||
|
fort_opts=
|
||||||
|
#buildtype=" -DCMAKE_BUILD_TYPE=Debug"
|
||||||
|
buildtype=
|
||||||
|
#pch_use=" -DPRECOMPILE_HEADERS:BOOL=ON"
|
||||||
|
pch_use=
|
||||||
|
#use_openmp=" -DUSE_OPENMP=OFF"
|
||||||
|
use_openmp=
|
||||||
|
use_mpi=
|
||||||
|
#silent_rules=" -DCMAKE_VERBOSE_MAKEFILE=OFF"
|
||||||
|
silent_rules=
|
||||||
|
#debug_loc=" -DSYSTEM_DEBUG=OFF"
|
||||||
|
debug_loc=
|
||||||
|
#use_lto=" -DWHOLE_PROG_OPTIM=OFF"
|
||||||
|
use_lto=
|
||||||
|
#strip_debug=" -DSTRIP_DEBUGGING_SYMBOLS=OFF"
|
||||||
|
strip_debug=
|
||||||
|
#use_runpath=" -DUSE_RUNPATH=OFF"
|
||||||
|
use_runpath=
|
||||||
|
#use_tests=" -DBUILD_TESTING=ON"
|
||||||
|
use_tests=
|
||||||
|
#use_samples=" -DBUILD_EXAMPLES=ON"
|
||||||
|
use_samples=
|
||||||
|
#use_ninja="-G\"Unix Makefiles\" "
|
||||||
|
use_ninja=
|
||||||
|
#use_underscoring=" -DUSE_UNDERSCORING=OFF"
|
||||||
|
use_underscoring=
|
||||||
|
# boost_root=""
|
||||||
|
boost_root=
|
||||||
|
boost_libdir=
|
||||||
|
boost_opts=
|
||||||
|
# configuration that is passed on to CTest/CDash
|
||||||
|
buildname=
|
||||||
|
site=
|
||||||
|
# if set, this prevents the previous CMake cache from being deleted
|
||||||
|
config_cache=
|
||||||
|
|
||||||
|
# default is to warn for unknown options, but this can be disabled
|
||||||
|
option_check=yes
|
||||||
|
|
||||||
|
# this variable will get feature options
|
||||||
|
FEATURES=
|
||||||
|
|
||||||
|
# this array will get all variable assignments from command-line
|
||||||
|
VARS=()
|
||||||
|
|
||||||
|
# command that launches cmake; look for 2.8 if available
|
||||||
|
if [ "${CMAKE_COMMAND}" = "" ]; then
|
||||||
|
if [ -x "$(command -v cmake28)" ]; then
|
||||||
|
CMAKE_COMMAND=cmake28
|
||||||
|
else
|
||||||
|
CMAKE_COMMAND=cmake
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# helper routine
|
||||||
|
uppercase () {
|
||||||
|
echo "$@" | tr "a-z-" "A-Z_"
|
||||||
|
}
|
||||||
|
|
||||||
|
for OPT in "$@"; do
|
||||||
|
case "$OPT" in
|
||||||
|
--*)
|
||||||
|
OPTARG=${OPT#--}
|
||||||
|
# OPTARG now contains everything after double dashes
|
||||||
|
case "${OPTARG}" in
|
||||||
|
config-cache|cache-file=*)
|
||||||
|
# prevent the previous CMake cache from being deleted. The
|
||||||
|
# second option is only here for Dune/autotools compatibility
|
||||||
|
config_cache="1"
|
||||||
|
;;
|
||||||
|
src-dir=*)
|
||||||
|
# allow the user to use these build macros for another
|
||||||
|
# project (so source-dir is not relative to us)
|
||||||
|
srcdir=${OPTARG#*=}
|
||||||
|
;;
|
||||||
|
prefix=*)
|
||||||
|
# remove prefix consisting of everything up to equal sign
|
||||||
|
prefix=${OPTARG#*=}
|
||||||
|
;;
|
||||||
|
help)
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
with-*)
|
||||||
|
# get the name of the package; everything before equal sign
|
||||||
|
pkgname=${OPTARG%=*}
|
||||||
|
pkgname=${pkgname#with-}
|
||||||
|
# get the location of the package; everyhing after equal sign
|
||||||
|
test -n "${OPTARG#with-${pkgname}}" && pkgloc=${OPTARG#*=} || pkgloc=""
|
||||||
|
# the parameter to this option is an executable program, so
|
||||||
|
# skip the directory test in that case. if we match any of
|
||||||
|
# these special options, then stop further processing (the
|
||||||
|
# argument is not a directory anyway)
|
||||||
|
case "${pkgname}" in
|
||||||
|
cmake)
|
||||||
|
CMAKE_COMMAND="${pkgloc}"
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
buildname)
|
||||||
|
buildname=" -DBUILDNAME=\"${pkgloc}\""
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
site)
|
||||||
|
site=" -DSITE=\"${pkgloc}\""
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# tilde expansion; quote safely before running eval on it
|
||||||
|
eval pkgloc=$(printf "%q" "${pkgloc}")
|
||||||
|
# expand to full path since CMake changes to source directory (!)
|
||||||
|
# this also normalize the path name wrt. not having a trailing slash
|
||||||
|
test -d "${pkgloc}" && pkgloc=$(sh -c "cd \"${pkgloc}\"; pwd")
|
||||||
|
# special aliases
|
||||||
|
case "${pkgname}" in
|
||||||
|
umfpack)
|
||||||
|
pkgname="SuiteSparse"
|
||||||
|
;;
|
||||||
|
tinyxml)
|
||||||
|
pkgname="TinyXML"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# packages need different suffix for their root (sic)
|
||||||
|
case "${pkgname}" in
|
||||||
|
pch)
|
||||||
|
pch_use=" -DPRECOMPILE_HEADERS:BOOL=ON"
|
||||||
|
rootvar=""
|
||||||
|
;;
|
||||||
|
mpi |\
|
||||||
|
mpi-prefix)
|
||||||
|
# specifying path implies use of package
|
||||||
|
use_mpi=" -DUSE_MPI=ON"
|
||||||
|
# only set prefix if specified, i.e. setting doubles as flag
|
||||||
|
test -n "${pkgloc}" && rootvar="_MPI_PREFIX_PATH" || rootvar=""
|
||||||
|
;;
|
||||||
|
boost)
|
||||||
|
# special handling of this package, see further below
|
||||||
|
boost_root="${pkgloc}"
|
||||||
|
rootvar=""
|
||||||
|
;;
|
||||||
|
boost-libdir)
|
||||||
|
boost_libdir="${pkgloc}"
|
||||||
|
rootvar=""
|
||||||
|
;;
|
||||||
|
alugrid |\
|
||||||
|
eigen3 |\
|
||||||
|
ert |\
|
||||||
|
metis |\
|
||||||
|
superlu |\
|
||||||
|
SuiteSparse |\
|
||||||
|
TinyXML |\
|
||||||
|
ug |\
|
||||||
|
opm |\
|
||||||
|
opm-* |\
|
||||||
|
dune |\
|
||||||
|
dune-* |\
|
||||||
|
zoltan |\
|
||||||
|
zlib)
|
||||||
|
rootvar="$(uppercase ${pkgname})_ROOT"
|
||||||
|
rootvar="${rootvar/-/_}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
invalid_opt --with-${pkgname}
|
||||||
|
rootvar=""
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# add this to the list of existing features
|
||||||
|
test -n "${rootvar}" && \
|
||||||
|
FEATURES="${FEATURES} \"-D${rootvar}=${pkgloc}\""
|
||||||
|
;;
|
||||||
|
without-* | \
|
||||||
|
disable-*)
|
||||||
|
# get the name of the package
|
||||||
|
pkgname=$OPTARG
|
||||||
|
pkgname=${pkgname#disable-}
|
||||||
|
pkgname=${pkgname#without-}
|
||||||
|
# casing is of course different
|
||||||
|
case "${pkgname}" in
|
||||||
|
option-checking)
|
||||||
|
option_check=no
|
||||||
|
# special flag: don't disable any particular package
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
debug)
|
||||||
|
buildtype=" -DCMAKE_BUILD_TYPE=Release"
|
||||||
|
# special flag: don't disable any particular package
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
pch)
|
||||||
|
pch_use=" -DPRECOMPILE_HEADERS:BOOL=OFF"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
runpath)
|
||||||
|
use_runpath=" -DUSE_RUNPATH=OFF"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
silent-rules)
|
||||||
|
silent_rules=" -DCMAKE_VERBOSE_MAKEFILE=ON"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
system-debug)
|
||||||
|
debug_loc=" -DSYSTEM_DEBUG=OFF"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
wpo |\
|
||||||
|
lto )
|
||||||
|
use_lto=" -DWHOLE_PROG_OPTIM=OFF"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
strip-debug )
|
||||||
|
strip_debug=" -DSTRIP_DEBUGGING_SYMBOLS=OFF"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
openmp)
|
||||||
|
use_openmp=" -DUSE_OPENMP=OFF"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
mpi | \
|
||||||
|
parallel)
|
||||||
|
use_mpi=" -DUSE_MPI=OFF"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
tests)
|
||||||
|
use_tests=" -DBUILD_TESTING=OFF"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
examples)
|
||||||
|
use_samples=" -DBUILD_EXAMPLES=OFF"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
ninja)
|
||||||
|
# just for symmetry with the --enable-ninja option
|
||||||
|
use_ninja=""
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
ert |\
|
||||||
|
superlu)
|
||||||
|
pkgname="$(uppercase ${pkgname})"
|
||||||
|
;;
|
||||||
|
openmp)
|
||||||
|
pkgname="OpenMP"
|
||||||
|
;;
|
||||||
|
gxx11check)
|
||||||
|
pkgname="CXX11Features"
|
||||||
|
;;
|
||||||
|
umfpack)
|
||||||
|
pkgname="SuiteSparse"
|
||||||
|
;;
|
||||||
|
tinyxml)
|
||||||
|
pkgname="TinyXML"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
invalid_opt --disable-${pkgname}
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# only disable packages if the flag refers to a proper one
|
||||||
|
test -n "${pkgname}" && \
|
||||||
|
FEATURES="${FEATURES} -DCMAKE_DISABLE_FIND_PACKAGE_${pkgname}=TRUE"
|
||||||
|
;;
|
||||||
|
enable-*)
|
||||||
|
# what kind of library are we building; shared or static?
|
||||||
|
kind=${OPTARG#enable-}
|
||||||
|
case "${kind}" in
|
||||||
|
system-debug)
|
||||||
|
debug_loc=" -DSYSTEM_DEBUG=ON"
|
||||||
|
# special flag; don't set shared/static
|
||||||
|
shared=""
|
||||||
|
;;
|
||||||
|
openmp)
|
||||||
|
use_openmp=" -DUSE_OPENMP=ON"
|
||||||
|
# special flag; don't set shared/static
|
||||||
|
shared=""
|
||||||
|
;;
|
||||||
|
mpi | \
|
||||||
|
parallel)
|
||||||
|
use_mpi=" -DUSE_MPI=ON"
|
||||||
|
# special flag; don't set shared/static
|
||||||
|
shared=""
|
||||||
|
;;
|
||||||
|
debug)
|
||||||
|
buildtype=" -DCMAKE_BUILD_TYPE=Debug"
|
||||||
|
shared=""
|
||||||
|
;;
|
||||||
|
pch)
|
||||||
|
pch_use=" -DPRECOMPILE_HEADERS:BOOL=ON"
|
||||||
|
shared=""
|
||||||
|
;;
|
||||||
|
runpath)
|
||||||
|
use_runpath=" -DUSE_RUNPATH=ON"
|
||||||
|
shared=""
|
||||||
|
;;
|
||||||
|
lto)
|
||||||
|
use_lto=" -DWHOLE_PROG_OPTIM=ON"
|
||||||
|
shared=""
|
||||||
|
;;
|
||||||
|
strip-debug )
|
||||||
|
strip_debug=" -DSTRIP_DEBUGGING_SYMBOLS=ON"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
tests)
|
||||||
|
use_tests=" -DBUILD_TESTING=ON"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
examples)
|
||||||
|
use_samples=" -DBUILD_EXAMPLES=ON"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
underscoring)
|
||||||
|
use_underscoring=" -DUSE_UNDERSCORING=ON"
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
ninja)
|
||||||
|
# Ninja doesn't support using the Fortran compiler, so
|
||||||
|
# we'll have to resort to making this assumption
|
||||||
|
use_underscoring=" -DUSE_UNDERSCORING=ON"
|
||||||
|
use_ninja="-GNinja "
|
||||||
|
pkgname=""
|
||||||
|
;;
|
||||||
|
# this flag is just for compatibility with the deprecation
|
||||||
|
# flag in DUNE, so we can build without warnings
|
||||||
|
fieldvector-size-is-method)
|
||||||
|
shared=""
|
||||||
|
;;
|
||||||
|
shared)
|
||||||
|
shared="ON"
|
||||||
|
;;
|
||||||
|
static)
|
||||||
|
shared="OFF"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
invalid_opt "--enable-${kind}"
|
||||||
|
shared=""
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
test -n "${shared}" && \
|
||||||
|
FEATURES="${FEATURES} -DBUILD_SHARED_LIBS:BOOL=${shared}"
|
||||||
|
# once we have added this, reset so we don't add again for next opt
|
||||||
|
shared=""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# remove everything *after* the equal sign
|
||||||
|
arg=${OPTARG%=*}
|
||||||
|
invalid_arg "--$arg"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
[A-Za-z0-9_]*=*)
|
||||||
|
# collect for further processing later
|
||||||
|
VARS+=("$OPT")
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
invalid_arg "$OPT"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
# remove all arguments processed by getopts
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
# special handling of Boost: if --with-boost-libdir has been used,
|
||||||
|
# then the --with-boost turns into specifying the header directory
|
||||||
|
# and not the search root. this mirrors the functionality in the
|
||||||
|
# Autotools ax_boost_base.m4. necessary because FindBoost in CMake
|
||||||
|
# uses two different variables if you want to specify them separately
|
||||||
|
if [ -n "${boost_libdir}" ]; then
|
||||||
|
boost_opts=" -DBOOST_LIBRARYDIR=\"${boost_libdir}\""
|
||||||
|
if [ -n "${boost_root}" ]; then
|
||||||
|
boost_opts="${boost_opts} -DBOOST_INCLUDEDIR=\"${boost_root}\""
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ -n "${boost_root}" ]; then
|
||||||
|
boost_opts=" -DBOOST_ROOT=\"${boost_root}\""
|
||||||
|
else
|
||||||
|
boost_opts=""
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# notice the usage of a quoted array: each element will be returned
|
||||||
|
# even with spaces.
|
||||||
|
for a in "${VARS[@]}"; do
|
||||||
|
case "$a" in
|
||||||
|
ACLOCAL_*=*)
|
||||||
|
# remove Autotools-specific variables.
|
||||||
|
;;
|
||||||
|
CC=*)
|
||||||
|
# special processing for compiler options
|
||||||
|
a=${a#CC=}
|
||||||
|
[ -x "$(command -v "$a")" ] && a=$(command -v "$a")
|
||||||
|
c_compiler=" -DCMAKE_C_COMPILER=\"${a/\"/\\\"}\""
|
||||||
|
;;
|
||||||
|
CXX=*)
|
||||||
|
a=${a#CXX=}
|
||||||
|
[ -x "$(command -v "$a")" ] && a=$(command -v "$a")
|
||||||
|
cxx_compiler=" -DCMAKE_CXX_COMPILER=\"${a/\"/\\\"}\""
|
||||||
|
;;
|
||||||
|
CFLAGS=*)
|
||||||
|
a=${a#CFLAGS=}
|
||||||
|
c_opts=" -DCMAKE_BUILD_TYPE=Custom -DCMAKE_C_FLAGS=\"${a/\"/\\\"}\""
|
||||||
|
;;
|
||||||
|
CXXFLAGS=*)
|
||||||
|
a=${a#CXXFLAGS=}
|
||||||
|
cxx_opts=" -DCMAKE_BUILD_TYPE=Custom -DCMAKE_CXX_FLAGS=\"${a/\"/\\\"}\""
|
||||||
|
;;
|
||||||
|
FC=*)
|
||||||
|
a=${a#FC=}
|
||||||
|
[ -x "$(command -v "$a")" ] && a=$(command -v "$a")
|
||||||
|
fort_compiler=" -DCMAKE_Fortran_COMPILER=\"${a/\"/\\\"}\""
|
||||||
|
;;
|
||||||
|
FFLAGS=*)
|
||||||
|
a=${a#FFLAGS=}
|
||||||
|
fort_opts=" -DCMAKE_BUILD_TYPE=Custom -DCMAKE_Fortran_FLAGS=\"${a/\"/\\\"}\""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
ENVVARS="$ENVVARS \"${a/\"/\\\"}\""
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# only wrap in env command if any variable were actually passed
|
||||||
|
[ -n "${ENVVARS}" ] && ENVVARS="env ${ENVVARS} "
|
||||||
|
|
||||||
|
# delete the previous 'CMakeFiles' directory. this prevents an endless
|
||||||
|
# loop if variables that require a full regeneration of the cache are
|
||||||
|
# set (most notably 'CXX' and 'CXX_FLAGS').
|
||||||
|
# For more details, see http://www.cmake.org/Bug/view.php?id=14119
|
||||||
|
if test "$config_cache" = ""; then
|
||||||
|
echo "--- deleting previous CMake files ---"
|
||||||
|
rm -rf CMakeFiles
|
||||||
|
rm -f CMakeCache.txt
|
||||||
|
elif test "$c_compiler$c_opts$cxx_compiler$cxx_opts$fort_compiler$fort_opts" != ""; then
|
||||||
|
echo "--- WARNING '--config-cache' option specified but a compiler was set"
|
||||||
|
echo "--- from the command line. This may lead to an infinite loop!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# pass everything on to CMake
|
||||||
|
CMDLINE="${ENVVARS}${CMAKE_COMMAND} \"${srcdir}\" ${use_ninja}\"-DCMAKE_INSTALL_PREFIX=$prefix\" -DSIBLING_SEARCH=OFF${buildtype}${pch_use}${silent_rules}${debug_loc}${use_openmp}${use_mpi}${use_lto}${strip_debug}${use_runpath}${use_tests}${use_samples}${use_underscoring}${c_compiler}${c_opts}${cxx_compiler}${cxx_opts}${fort_compiler}${fort_opts}${boost_opts}${buildname}${site} ${FEATURES}"
|
||||||
|
echo --- calling CMake ---
|
||||||
|
echo "${CMDLINE}"
|
||||||
|
eval exec "${CMDLINE}"
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
#!/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
|
|
||||||
@@ -816,7 +816,7 @@ HTML_COLORSTYLE_GAMMA = 80
|
|||||||
# page will contain the date and time when the page was generated. Setting
|
# page will contain the date and time when the page was generated. Setting
|
||||||
# this to NO can help when comparing the output of multiple runs.
|
# this to NO can help when comparing the output of multiple runs.
|
||||||
|
|
||||||
HTML_TIMESTAMP = NO
|
HTML_TIMESTAMP = YES
|
||||||
|
|
||||||
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
|
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
|
||||||
# documentation will contain sections that can be hidden and shown after the
|
# documentation will contain sections that can be hidden and shown after the
|
||||||
|
|||||||
@@ -19,102 +19,51 @@
|
|||||||
|
|
||||||
# <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>
|
||||||
|
|
||||||
# Prevent multiple inclusions
|
# propagate these properties from one build system to the other
|
||||||
if(NOT @opm-project_NAME@_FOUND)
|
set (@opm-project_NAME@_VERSION "@opm-project_VERSION@")
|
||||||
# propagate these properties from one build system to the other
|
set (@opm-project_NAME@_DEFINITIONS "@opm-project_DEFINITIONS@")
|
||||||
set (@opm-project_NAME@_PREFIX "@DUNE_PREFIX@")
|
set (@opm-project_NAME@_INCLUDE_DIRS "@opm-project_INCLUDE_DIRS@")
|
||||||
set (@opm-project_NAME@_VERSION "@opm-project_VERSION@")
|
set (@opm-project_NAME@_LIBRARY_DIRS "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
|
||||||
set (@opm-project_NAME@_DEFINITIONS "@opm-project_DEFINITIONS@")
|
set (@opm-project_NAME@_LINKER_FLAGS "@opm-project_LINKER_FLAGS@")
|
||||||
set (@opm-project_NAME@_INCLUDE_DIRS "@opm-project_INCLUDE_DIRS@")
|
set (@opm-project_NAME@_CONFIG_VARS "@opm-project_CONFIG_VARS@")
|
||||||
set (@opm-project_NAME@_LIBRARY_DIRS "@opm-project_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@")
|
|
||||||
|
|
||||||
# The flag whether embedded Python is supported or not is passed to downstream modules,
|
# libraries come from the build tree where this file was generated
|
||||||
# it is only used to enable/disable regression testing with Python enabled input. The
|
set (@opm-project_NAME@_LIBRARY "@opm-project_LIBRARY@")
|
||||||
# actual code is self contained - and can be used downstream without awareness of this.
|
set (@opm-project_NAME@_LIBRARIES ${@opm-project_NAME@_LIBRARY} "@opm-project_LIBRARIES@")
|
||||||
set (@opm-project_NAME@_EMBEDDED_PYTHON @OPM_ENABLE_EMBEDDED_PYTHON@)
|
mark_as_advanced (@opm-project_NAME@_LIBRARY)
|
||||||
|
|
||||||
# libraries come from the build tree where this file was generated
|
# not all projects have targets; conditionally add this part
|
||||||
set (@opm-project_NAME@_LIBRARY "@opm-project_LIBRARY@")
|
if (NOT "@opm-project_TARGET@" STREQUAL "")
|
||||||
set (@opm-project_NAME@_LIBRARIES ${@opm-project_NAME@_LIBRARY} "@opm-project_LIBRARIES@")
|
# add the library as a target, so that other things in the project including
|
||||||
|
# this file may depend on it and get rebuild if this library changes.
|
||||||
|
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 "")
|
||||||
|
|
||||||
# The purpose of this string replacement operation is to enable use of the
|
# ensure that we build with support for C++11 to preserve ABI
|
||||||
# generated opm-project-config.cmake file also in the situation where 'make
|
string (REPLACE "@CXX_STD0X_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
# install' has been invoked with the DESTDIR option:
|
string (REPLACE "@CXX_STDLIB_FLAGS@" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
#
|
string (STRIP "${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
|
||||||
# opm-common/build> cmake .. -DCMAKE_INSTALL_PREFIX=/real/prefix
|
set (CMAKE_CXX_FLAGS "@CXX_STD0X_FLAGS@@CXX_SPACE@@CXX_STDLIB_FLAGS@ ${CMAKE_CXX_FLAGS}")
|
||||||
# opm-common/budil> make install DESTDIR=/tmp/prefix
|
|
||||||
#
|
|
||||||
# downstream/build> cmake .. -DDEST_PREFIX=/tmp/prefix -DCMAKE_PREFIX_PATH=/tmp/prefix
|
|
||||||
# downstream/build> make install
|
|
||||||
#
|
|
||||||
# That way the downstream dependency can still use find_package( opm-common )
|
|
||||||
# even though the opm-common-config.cmake file is not internally consistent
|
|
||||||
# with it's own location in the filesystem.
|
|
||||||
|
|
||||||
if(DEST_PREFIX)
|
# same as above, but for C99
|
||||||
set(DEST_PREFIX "${DEST_PREFIX}${@opm-project_NAME@_PREFIX}")
|
string (REPLACE "@C_STD99_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_INCLUDE_DIRS "${@opm-project_NAME@_INCLUDE_DIRS}")
|
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
|
||||||
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_LIBRARY_DIRS "${@opm-project_NAME@_LIBRARY_DIRS}")
|
set (CMAKE_C_FLAG "@C_STD99_FLAGS@ ${CMAKE_C_FLAGS}")
|
||||||
string(REPLACE ${@opm-project_NAME@_PREFIX} ${DEST_PREFIX} @opm-project_NAME@_LIBRARY "${@opm-project_NAME@_LIBRARY}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
# build with OpenMP if that was found
|
||||||
set (HAVE_@opm-project_NAME_UC@ 1)
|
if (NOT "@OpenMP_C_FLAGS@" STREQUAL "")
|
||||||
mark_as_advanced (@opm-project_NAME@_LIBRARY)
|
string (REPLACE "@OpenMP_C_FLAGS@" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
|
||||||
# not all projects have targets; conditionally add this part
|
|
||||||
if (NOT "@opm-project_TARGET@" STREQUAL "")
|
|
||||||
# add the library as a target, so that other things in the project including
|
|
||||||
# this file may depend on it and get rebuild if this library changes.
|
|
||||||
if(NOT TARGET @opm-project_TARGET@)
|
|
||||||
get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
||||||
include("${_dir}/@opm-project_NAME@-targets.cmake")
|
|
||||||
endif()
|
|
||||||
endif (NOT "@opm-project_TARGET@" STREQUAL "")
|
|
||||||
|
|
||||||
# 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)
|
string (STRIP "${CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
|
||||||
set (CMAKE_C_FLAG "@C_STD99_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 "")
|
||||||
|
|
||||||
# build with OpenMP if that was found
|
# this is the contents of config.h as far as our probes can tell:
|
||||||
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@
|
||||||
# Require correct CMake standard. Needed for user modules as
|
|
||||||
# some software will add incompatible compile switches like
|
|
||||||
# -std=gnu++11 otherwise when search for (I guess because of
|
|
||||||
# imported targets using INTERFACE_COMPILE_FEATURES), and will
|
|
||||||
# break compilation because of missing c++17 features.
|
|
||||||
if(NOT CMAKE_CXX_STANDARD)
|
|
||||||
set(CMAKE_CXX_STANDARD @CMAKE_CXX_STANDARD@)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# The settings in this block do not mix well with the DEST_PREFIX
|
|
||||||
# setting.
|
|
||||||
if (NOT DEST_PREFIX)
|
|
||||||
# This is required to include OpmPackage
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" @PREREQ_LOCATION@)
|
|
||||||
|
|
||||||
# extra code from variable OPM_PROJECT_EXTRA_CODE
|
|
||||||
@OPM_PROJECT_EXTRA_CODE@
|
|
||||||
# end extra code
|
|
||||||
|
|
||||||
include(OpmPackage)
|
|
||||||
include(@opm-project_NAME@-prereqs)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|||||||
42
configure
vendored
Executable file
42
configure
vendored
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# this file is supposed to be located in the source directory
|
||||||
|
src_dir=$(dirname $0)
|
||||||
|
|
||||||
|
# scan the arguments and set this if build macros could be specified
|
||||||
|
mod_dir=
|
||||||
|
for OPT in "$@"; do
|
||||||
|
case "$OPT" in
|
||||||
|
--with-opm-common=*)
|
||||||
|
# remove everything before equal sign and assign the rest
|
||||||
|
mod_dir=${OPT#*=}
|
||||||
|
# tilde expansion; note that doing eval may have side effects
|
||||||
|
mod_dir=$(eval echo $mod_dir)
|
||||||
|
# absolute path
|
||||||
|
[ -d "$mod_dir" ] && mod_dir=$(cd $mod_dir ; pwd)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# special work around the fact that dunecontrol does not specify
|
||||||
|
# --with-$MODULE for the module it attempts to build
|
||||||
|
ADDITIONAL_PARAMS=""
|
||||||
|
if test -z "$mod_dir"; then
|
||||||
|
ADDITIONAL_PARAMS="--with-opm-common=\"$(pwd)\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if it isn't specified, the look around in other known places
|
||||||
|
conf_file=cmake/Scripts/configure
|
||||||
|
if [ -z "$mod_dir" ]; then
|
||||||
|
if [ -r "$src_dir/$conf_file" ]; then
|
||||||
|
mod_dir="$src_dir"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# terminate with error message here if the module directory is not found
|
||||||
|
if [ ! -r "$mod_dir/$conf_file" ]; then
|
||||||
|
echo Build macros not located in \"$mod_dir\", use --with-opm-common= to specify! 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# forward to the corresponding script in the cmake/Scripts/ directory
|
||||||
|
exec "$mod_dir/$conf_file" --src-dir="$src_dir" "$@" $ADDITIONAL_PARAMS
|
||||||
2
debian/changelog
vendored
2
debian/changelog
vendored
@@ -1,4 +1,4 @@
|
|||||||
opm-common (2021.10-rfinal-1~bionic) bionic; urgency=medium
|
opm-common (2017.04-rfinal-1~xenial) xenial; urgency=medium
|
||||||
|
|
||||||
* New release
|
* New release
|
||||||
|
|
||||||
|
|||||||
28
debian/control
vendored
28
debian/control
vendored
@@ -2,12 +2,9 @@ Source: opm-common
|
|||||||
Priority: extra
|
Priority: extra
|
||||||
Maintainer: Arne Morten Kvarving <arne.morten.kvarving@sintef.no>
|
Maintainer: Arne Morten Kvarving <arne.morten.kvarving@sintef.no>
|
||||||
Build-Depends: build-essential, debhelper (>= 9),
|
Build-Depends: build-essential, debhelper (>= 9),
|
||||||
pkg-config, cmake, git, libtool, doxygen, graphviz,
|
pkg-config, cmake, git, libtool, doxygen,
|
||||||
texlive-latex-extra, texlive-latex-recommended,
|
texlive-latex-extra, texlive-latex-recommended,
|
||||||
ghostscript, libboost-system-dev, libboost-test-dev,
|
ghostscript, libboost-system-dev, libboost-test-dev
|
||||||
zlib1g-dev, libpython3-dev, python3-numpy, python3-distutils,
|
|
||||||
python3-setuptools, python3-setuptools-scm, python3-pytest-runner,
|
|
||||||
python3-decorator
|
|
||||||
Standards-Version: 3.9.2
|
Standards-Version: 3.9.2
|
||||||
Section: libs
|
Section: libs
|
||||||
Homepage: http://opm-project.org
|
Homepage: http://opm-project.org
|
||||||
@@ -16,7 +13,7 @@ Vcs-Browser: https://github.com/OPM/opm-common
|
|||||||
|
|
||||||
Package: libopm-common1
|
Package: libopm-common1
|
||||||
Section: libs
|
Section: libs
|
||||||
Pre-Depends: ${misc:Pre-Depends}
|
Pre-Depends: ${misc:Pre-Depends}, multiarch-support
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Multi-Arch: same
|
Multi-Arch: same
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||||
@@ -24,16 +21,6 @@ Provides: libopm-common
|
|||||||
Description: OPM common library
|
Description: OPM common library
|
||||||
The OPM common library contains generic code shared across all OPM modules.
|
The OPM common library contains generic code shared across all OPM modules.
|
||||||
|
|
||||||
Package: libopm-common1-bin
|
|
||||||
Section: libs
|
|
||||||
Pre-Depends: ${misc:Pre-Depends}
|
|
||||||
Architecture: any
|
|
||||||
Multi-Arch: same
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
|
||||||
Provides: libopm-common-bin
|
|
||||||
Description: OPM common binaries
|
|
||||||
The OPM common binaries.
|
|
||||||
|
|
||||||
Package: libopm-common1-dev
|
Package: libopm-common1-dev
|
||||||
Section: libdevel
|
Section: libdevel
|
||||||
Architecture: any
|
Architecture: any
|
||||||
@@ -53,12 +40,3 @@ Provides: libopm-common-doc
|
|||||||
Description: OPM common library -- documentation
|
Description: OPM common library -- documentation
|
||||||
The OPM common library contains the shared buildsystem
|
The OPM common library contains the shared buildsystem
|
||||||
and helpers shared across all OPM modules.
|
and helpers shared across all OPM modules.
|
||||||
|
|
||||||
Package: python3-opm-common
|
|
||||||
Section: libs
|
|
||||||
Pre-Depends: ${misc:Pre-Depends}
|
|
||||||
Architecture: any
|
|
||||||
Multi-Arch: same
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libopm-common1, python3-numpy, python3-decorator
|
|
||||||
Description: OPM common python bindings
|
|
||||||
Python package for opm-common
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user