From dfe6dbbb3572248f9661aa686f374e99bd9011df Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 13:25:26 +0100 Subject: [PATCH 01/15] Handle all DUNE and OPM modules the same way dunecontrol will specify --with-* for each and every module that is listed as a dependency in dune.module; there is no difference between them because they all share the same code :-) --- configure | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index bc1070d5..6febb240 100755 --- a/configure +++ b/configure @@ -26,8 +26,8 @@ Optional Features: Optional Packages: --with-boost=PATH use Boost library from a specified location - --with-dune-common=PATH use DUNE-common library from a specified location - --with-dune-istl=PATH use DUNE-ISTL library from a specified location + --with-dune-MODULE=PATH use given DUNE module from a specified location + --with-opm-MODULE=PATH use given OPM module from a specified location --with-superlu=PATH user defined path to SuperLU library --with-agmg=PATH Include DOUBLE PRECISION version Notay's of AGMG Algebraic Multigrid solver from specified source @@ -159,8 +159,8 @@ while getopts -- ":-:" optchar; do ;; SuiteSparse |\ TinyXML |\ - dune-istl |\ - dune-common) + opm-* |\ + dune-*) rootvar="${pkgname}_ROOT" ;; *) From d9980beef1eacf3c263b655f54d1eec518ca8ef9 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 12:45:41 +0100 Subject: [PATCH 02/15] Guess where libraries are using full path Because the probe is run from the project source tree(!) --- cmake/Modules/OpmPackage.cmake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/OpmPackage.cmake b/cmake/Modules/OpmPackage.cmake index eebf6616..4fedbe5a 100644 --- a/cmake/Modules/OpmPackage.cmake +++ b/cmake/Modules/OpmPackage.cmake @@ -87,9 +87,16 @@ function (find_opm_package module deps header lib defs prog conf) # but with a -build suffix if (NOT (${module}_DIR OR ${module}_ROOT)) string (TOLOWER "${module}" _module_lower) - set (_guess "../${module}" "../${module}-build" - "../${_module_lower}" "../${_module_lower}-build" + set (_guess + "../${module}" + "../${module}-build" + "../${_module_lower}" + "../${_module_lower}-build" ) + set (_guess_bin) + foreach (_item IN ITEMS ${_guess}) + list (APPEND _guess_bin "${PROJECT_BINARY_DIR}/${_item}") + endforeach (_item) endif (NOT (${module}_DIR OR ${module}_ROOT)) # search for this include and library file to get the installation @@ -106,7 +113,7 @@ function (find_opm_package module deps header lib defs prog conf) if (NOT "${lib}" STREQUAL "") find_library (${module}_LIBRARY NAMES "${lib}" - PATHS ${_guess} + PATHS ${_guess_bin} HINTS ${${module}_DIR} ${${module}_ROOT} ${PkgConf_${module}_LIBRARY_DIRS} PATH_SUFFIXES "lib" "lib/.libs" ".libs" "lib32" "lib64" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" ) From 03ccc506bd26258a00ca124cfcc5b4338722a594 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 11:51:09 +0100 Subject: [PATCH 03/15] Find modules for dune-geometry and dune-grid --- cmake/Modules/Finddune-geometry.cmake | 47 ++++++++++++++++++++++ cmake/Modules/Finddune-grid.cmake | 58 +++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 cmake/Modules/Finddune-geometry.cmake create mode 100644 cmake/Modules/Finddune-grid.cmake diff --git a/cmake/Modules/Finddune-geometry.cmake b/cmake/Modules/Finddune-geometry.cmake new file mode 100644 index 00000000..a39865fa --- /dev/null +++ b/cmake/Modules/Finddune-geometry.cmake @@ -0,0 +1,47 @@ +# - Find DUNE geometry library +# +# Defines the following variables: +# dune-geometry_INCLUDE_DIRS Directory of header files +# dune-geometry_LIBRARIES Directory of shared object files +# dune-geometry_DEFINITIONS Defines that must be set to compile +# dune-geometry_CONFIG_VARS List of defines that should be in config.h +# HAVE_DUNE_GEOMETRY 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 (OpmPackage) +find_opm_package ( + # module name + "dune-geometry" + + # dependencies + # TODO: we should probe for all the HAVE_* values listed below; + # however, we don't actually use them in our implementation, so + # we just include them to forward here in case anyone else does + "CXX11Features REQUIRED; + dune-common REQUIRED + " + # header to search for + "dune/geometry/quadraturerules.hh" + + # library to search for + "dunegeometry" + + # defines to be added to compilations + "" + + # test program +"#include +int main (void) { + Dune::GeometryType gt; + gt.makeQuadrilateral(); + Dune::QuadratureRules::rule(gt, 2).size(); + return 0; +} +" + # config variables + "HAVE_ALGLIB + ") + +#debug_find_vars ("dune-geometry") diff --git a/cmake/Modules/Finddune-grid.cmake b/cmake/Modules/Finddune-grid.cmake new file mode 100644 index 00000000..1ee8a062 --- /dev/null +++ b/cmake/Modules/Finddune-grid.cmake @@ -0,0 +1,58 @@ +# - Find DUNE grid library +# +# Defines the following variables: +# dune-grid_INCLUDE_DIRS Directory of header files +# dune-grid_LIBRARIES Directory of shared object files +# dune-grid_DEFINITIONS Defines that must be set to compile +# dune-grid_CONFIG_VARS List of defines that should be in config.h +# HAVE_DUNE_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 (OpmPackage) +find_opm_package ( + # module name + "dune-grid" + + # dependencies + # TODO: we should probe for all the HAVE_* values listed below; + # however, we don't actually use them in our implementation, so + # we just include them to forward here in case anyone else does + "CXX11Features REQUIRED; + dune-common REQUIRED; + dune-geometry REQUIRED + " + # header to search for + "dune/grid/onedgrid.hh" + + # library to search for + "dunegrid" + + # defines to be added to compilations + "" + + # test program +"#include +#include +int main (void) { + std::vector coords; + Dune::OneDGrid grid(coords); + return grid.lbegin<0>(0) == grid.lend<0>(0); + return 0; +} +" + # config variables + "HAVE_MPI; + HAVE_UG; + HAVE_DUNE_FEM; + HAVE_ALUGRID; + HAVE_GRIDTYPE; + HAVE_GRAPE; + HAVE_PSURFACE; + HAVE_AMIRAMESH; + HAVE_ALBERTA; + HAVE_STDINT_H + ") + +#debug_find_vars ("dune-grid") From 4ad50b09e3b81c213fcb93e7a528e40d4f7fde6d Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 13:36:09 +0100 Subject: [PATCH 04/15] Infer project name from dune.module --- configure | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 6febb240..f6d807d6 100755 --- a/configure +++ b/configure @@ -1,7 +1,10 @@ #!/bin/bash +# where is the source tree located +srcdir=$(dirname "$0") + # name of the project -project=opm-core +project=$(sed -n "s,^Module:[\ \t]*\([^\ \t]*\),\1,p" "${srcdir}/dune.module") # display help text usage () { @@ -280,7 +283,7 @@ shift $((OPTIND-1)) ENVVARS=${@/ACLOCAL_*=*/} # pass everything on to CMake -CMDLINE="env ${ENVVARS} ${CMAKE_COMMAND} \"$(dirname "$0")\" \"-DCMAKE_INSTALL_PREFIX=$prefix\" -DCMAKE_BUILD_TYPE=${buildtype}${pch_use}${silent_rules}${debug_loc} ${FEATURES}" +CMDLINE="env ${ENVVARS} ${CMAKE_COMMAND} \"${srcdir}\" \"-DCMAKE_INSTALL_PREFIX=$prefix\" -DCMAKE_BUILD_TYPE=${buildtype}${pch_use}${silent_rules}${debug_loc} ${FEATURES}" echo --- calling CMake for ${project} --- echo ${CMDLINE} eval exec ${CMDLINE} From 7871a485519886a1aba9f418091fafe2511b8ba6 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 20:59:43 +0100 Subject: [PATCH 05/15] Make sure HAVE_FOO is defined if foo_FOUND in CMake --- cmake/Modules/OpmFind.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/Modules/OpmFind.cmake b/cmake/Modules/OpmFind.cmake index 3add9f78..eafa378b 100644 --- a/cmake/Modules/OpmFind.cmake +++ b/cmake/Modules/OpmFind.cmake @@ -80,6 +80,11 @@ macro (find_and_append_package_to prefix name) endif ("${var}" STREQUAL "LIBRARIES") endif (DEFINED ${name}_${var}) endforeach (var) + # some libraries only define xxx_FOUND and not a corresponding HAVE_xxx + string (TOUPPER "${name}" NAME) + if (NOT DEFINED HAVE_${NAME}) + set (HAVE_${NAME} 1) + endif (NOT DEFINED HAVE_${NAME}) endif (${name}_FOUND) endmacro (find_and_append_package_to prefix name) From dc3d94e985b5a2c3d0a587871574474a8c67a8b7 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 21:42:31 +0100 Subject: [PATCH 06/15] Activate Fortran interface on demand Not only if we need to compile Fortran code, but also if we need to call some functions from a Fortran library from C code. --- CMakeLists.txt | 3 +- cmake/Modules/UseFortranWrappers.cmake | 38 +++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6db6d3c..5bcabb3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,12 +203,11 @@ configure_vars ( WRITE ${${project}_CONFIG_VARS} ) -### --- begin AGMG specific --- ### include (UseFortranWrappers) define_fc_func ( APPEND ${CONFIG_H} + IF HAVE_AGMG # HAVE_BLAS HAVE_LAPACK ) -### --- end AGMG specific --- ### # compile main library; pull in all required includes and libraries include (OpmCompile) diff --git a/cmake/Modules/UseFortranWrappers.cmake b/cmake/Modules/UseFortranWrappers.cmake index b7d26fee..744c0372 100644 --- a/cmake/Modules/UseFortranWrappers.cmake +++ b/cmake/Modules/UseFortranWrappers.cmake @@ -1,7 +1,7 @@ # - Provide C wrappers for Fortran code # # Synopsis: -# define_fc_func (APPEND config.h) +# define_fc_func (APPEND config.h IF HAVE_BLAS) function (define_fc_func verb file) # check that we are being called correctly @@ -13,10 +13,40 @@ function (define_fc_func verb file) endif (NOT (("${verb}" STREQUAL "APPEND") OR ("${verb}" STREQUAL "WRITE"))) + # check under which conditions we should do our work + if (NOT "${ARGN}" STREQUAL "") + set (args ${ARGN}) + list (GET args 0 keyword) + if (NOT "${keyword}" STREQUAL "IF") + message (FATAL_ERROR + "Unknown conditional \"${keyword}\" passed as third argument." + ) + endif (NOT "${keyword}" STREQUAL "IF") + list (REMOVE_AT args 0) + set (needed FALSE) + foreach (condition IN LISTS args) + if (${${condition}}) + set (needed TRUE) + break () + endif (${${condition}}) + endforeach (condition) + else (NOT "${ARGN}" STREQUAL "") + # if called unconditionally, then always include the wrapper + set (needed TRUE) + endif (NOT "${ARGN}" STREQUAL "") + # only do something if we actually have some components which requires # the interaction -- don't load the Fortran compiler just to write # this macro (which apparently nobody uses then) - if (CMAKE_C_COMPILER_LOADED AND CMAKE_Fortran_COMPILER_LOADED) + if (needed) + # enable languages needed + if (NOT CMAKE_C_COMPILER_LOADED) + enable_language (C) + endif (NOT CMAKE_C_COMPILER_LOADED) + if (NOT CMAKE_Fortran_COMPILER_LOADED) + enable_language (Fortran) + endif (NOT CMAKE_Fortran_COMPILER_LOADED) + # get a temporary file set (_tmp_hdr ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/config_f.h) @@ -42,7 +72,7 @@ function (define_fc_func verb file) ${_str} "\n" ) - else (CMAKE_C_COMPILER_LOADED AND CMAKE_Fortran_COMPILER_LOADED) + else (needed) message (STATUS "Fortran/C interface not activated") - endif (CMAKE_C_COMPILER_LOADED AND CMAKE_Fortran_COMPILER_LOADED) + endif (needed) endfunction (define_fc_func) From 39880c255e518ddc27f27cf3d15bc7286fb2167e Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 22:19:26 +0100 Subject: [PATCH 07/15] Updated dependencies (most notably LibXML2 -> TinyXML) --- cmake/Modules/Findopm-core.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/Modules/Findopm-core.cmake b/cmake/Modules/Findopm-core.cmake index c140cb9a..23a8e6bb 100644 --- a/cmake/Modules/Findopm-core.cmake +++ b/cmake/Modules/Findopm-core.cmake @@ -17,14 +17,16 @@ find_opm_package ( "opm-core" # dependencies - "CXX11Features REQUIRED; + "C99; + CXX11Features; + Boost 1.39.0 + COMPONENTS date_time filesystem system unit_test_framework REQUIRED; BLAS REQUIRED; LAPACK REQUIRED; SuiteSparse COMPONENTS umfpack; SUPERLU; - LibXml2 REQUIRED; - Boost 1.39.0 - COMPONENTS date_time filesystem system unit_test_framework REQUIRED; + TinyXML; + ERT; dune-istl " # header to search for From 7ef129d7086ae6a19d64036488cd4ea8af4e7c8c Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 23:13:06 +0100 Subject: [PATCH 08/15] Allow optional packages in find-module package list --- cmake/Modules/OpmPackage.cmake | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cmake/Modules/OpmPackage.cmake b/cmake/Modules/OpmPackage.cmake index 4fedbe5a..eec8c0fa 100644 --- a/cmake/Modules/OpmPackage.cmake +++ b/cmake/Modules/OpmPackage.cmake @@ -126,11 +126,15 @@ function (find_opm_package module deps header lib defs prog conf) set (${module}_INCLUDE_DIRS "${${module}_INCLUDE_DIR}") set (${module}_LIBRARIES "${${module}_LIBRARY}") foreach (_dep IN LISTS _deps) - list (APPEND ${module}_INCLUDE_DIRS ${${_dep}_INCLUDE_DIRS}) - list (APPEND ${module}_LIBRARIES ${${_dep}_LIBRARIES}) - list (APPEND ${module}_DEFINITIONS ${${_dep}_DEFINITIONS}) - list (APPEND ${module}_CONFIG_VARS ${${_dep}_CONFIG_VARS}) - list (APPEND ${module}_LINKER_FLAGS ${${_dep}_LINKER_FLAGS}) + # only add those packages we actually found (find_package will show + # an error if it was marked as REQUIRED) + if (${_dep}_FOUND) + list (APPEND ${module}_INCLUDE_DIRS ${${_dep}_INCLUDE_DIRS}) + list (APPEND ${module}_LIBRARIES ${${_dep}_LIBRARIES}) + list (APPEND ${module}_DEFINITIONS ${${_dep}_DEFINITIONS}) + list (APPEND ${module}_CONFIG_VARS ${${_dep}_CONFIG_VARS}) + list (APPEND ${module}_LINKER_FLAGS ${${_dep}_LINKER_FLAGS}) + endif (${_dep}_FOUND) endforeach (_dep) # compile with this option to avoid avalanche of warnings From a35e0d23e39a4d59cd5dedd11e64510794ad3502 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Sat, 23 Feb 2013 00:32:10 +0100 Subject: [PATCH 09/15] Probe with include dirs to ALL dependencies It may be that the header in the test is dependent on some other header in one of the dependencies. --- cmake/Modules/OpmPackage.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/OpmPackage.cmake b/cmake/Modules/OpmPackage.cmake index eec8c0fa..282464e7 100644 --- a/cmake/Modules/OpmPackage.cmake +++ b/cmake/Modules/OpmPackage.cmake @@ -175,7 +175,7 @@ function (find_opm_package module deps header lib defs prog conf) 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_DIR CMAKE_REQUIRED_INCLUDES) + 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}) From 8b13ffee6b2e26fcc9aa560c69f362d605604946 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Sat, 23 Feb 2013 00:58:18 +0100 Subject: [PATCH 10/15] Only attempt to use precompiled headers that exists --- cmake/Modules/UsePrecompHeaders.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/Modules/UsePrecompHeaders.cmake b/cmake/Modules/UsePrecompHeaders.cmake index 12546da4..0ab08a85 100644 --- a/cmake/Modules/UsePrecompHeaders.cmake +++ b/cmake/Modules/UsePrecompHeaders.cmake @@ -97,6 +97,11 @@ function (precompile_header else (language STREQUAL "CXX") message (FATAL "Only C or C++ can have precompiled headers") endif (language STREQUAL "CXX") + + # if no precompiled header was found, then we shouldn't do anything here + if (NOT header) + return () + endif (NOT header) # only support precompiled headers if the compiler is gcc >= 3.4 get_gcc_version (${language} GCC_VERSION) From 6a2323c34abe9316cc1d720e649a2efc8414bcce Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Sat, 23 Feb 2013 01:06:01 +0100 Subject: [PATCH 11/15] Provide easy way to disable an entire directory --- cmake/Modules/OpmFiles.cmake | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cmake/Modules/OpmFiles.cmake b/cmake/Modules/OpmFiles.cmake index e0b5ed4b..51795cf3 100644 --- a/cmake/Modules/OpmFiles.cmake +++ b/cmake/Modules/OpmFiles.cmake @@ -40,6 +40,27 @@ macro (opm_sources opm) set (${opm}_HEADERS ${${opm}_C_HEADERS} ${${opm}_CXX_HEADERS}) endmacro (opm_sources opm) +# disable an entire directory from sources +macro (opm_disable_source opm) + foreach (_exp IN ITEMS ${ARGN}) + # regexp or directory? + if (IS_ABSOLUTE "${_exp}") + set (_prefix "") + else (IS_ABSOLUTE "${_exp}") + set (_prefix "${PROJECT_SOURCE_DIR}/") + endif (IS_ABSOLUTE "${_exp}") + if (IS_DIRECTORY "${_prefix}${_exp}") + set (_glob "/*") + else (IS_DIRECTORY "${_prefix}${_exp}") + set (_glob "") + endif (IS_DIRECTORY "${_prefix}${_exp}") + file (GLOB_RECURSE _disabled RELATIVE ${PROJECT_SOURCE_DIR} "${_prefix}${_exp}${_glob}") + foreach (_file IN ITEMS ${_disabled}) + list (REMOVE_ITEM ${opm}_SOURCES "${PROJECT_SOURCE_DIR}/${_file}") + endforeach (_file) + endforeach (_exp) +endmacro (opm_disable_source opm reldir) + macro (opm_find_tests) # every C++ program prefixed with test_ under tests/ directory should # be automatically set up as a test From dda61550811d104a5bb71f31ea47094f0b436479 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 13:58:33 +0100 Subject: [PATCH 12/15] Find module for dune-cornerpoint --- cmake/Modules/Finddune-cornerpoint.cmake | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 cmake/Modules/Finddune-cornerpoint.cmake diff --git a/cmake/Modules/Finddune-cornerpoint.cmake b/cmake/Modules/Finddune-cornerpoint.cmake new file mode 100644 index 00000000..325fd5da --- /dev/null +++ b/cmake/Modules/Finddune-cornerpoint.cmake @@ -0,0 +1,42 @@ +# - Find OPM corner-point grid library +# +# Defines the following variables: +# dune-cornerpoint_INCLUDE_DIRS Directory of header files +# dune-cornerpoint_LIBRARIES Directory of shared object files +# dune-cornerpoint_DEFINITIONS Defines that must be set to compile +# dune-cornerpoint_CONFIG_VARS List of defines that should be in config.h +# HAVE_DUNE_CORNERPOINT 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 (OpmPackage) +find_opm_package ( + # module name + "dune-cornerpoint" + + # dependencies + "dune-common REQUIRED; + dune-grid REQUIRED; + opm-core REQUIRED + " + # header to search for + "dune/grid/CpGrid.hpp" + + # library to search for + "dunecornerpoint" + + # defines to be added to compilations + "" + + # test program +"#include +int main (void) { + Dune::CpGrid g; + return 0; +} +" + # config variables + "") + +#debug_find_vars ("dune-cornerpoint") From 1c93c19bf9ab17046ac4b7b8268c8cfe672a93bc Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 14:26:33 +0100 Subject: [PATCH 13/15] Find module for opm-porsol --- cmake/Modules/Findopm-porsol.cmake | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 cmake/Modules/Findopm-porsol.cmake diff --git a/cmake/Modules/Findopm-porsol.cmake b/cmake/Modules/Findopm-porsol.cmake new file mode 100644 index 00000000..611d3fe4 --- /dev/null +++ b/cmake/Modules/Findopm-porsol.cmake @@ -0,0 +1,43 @@ +# - Find OPM porous media solver library +# +# Defines the following variables: +# opm-porsol_INCLUDE_DIRS Directory of header files +# opm-porsol_LIBRARIES Directory of shared object files +# opm-porsol_DEFINITIONS Defines that must be set to compile +# opm-porsol_CONFIG_VARS List of defines that should be in config.h +# HAVE_OPM_PORSOL 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 (OpmPackage) +find_opm_package ( + # module name + "opm-porsol" + + # dependencies + "dune-common REQUIRED; + dune-grid REQUIRED; + dune-istl REQUIRED; + opm-core REQUIRED; + dune-cornerpoint REQUIRED + " + # header to search for + "opm/porsol/mimetic/IncompFlowSolverHybrid.hpp" + + # library to search for + "opmporsol" + + # defines to be added to compilations + "" + + # test program +"#include +int main (void) { + return 0; +} +" + # config variables + "HAVE_VALGRIND") + +#debug_find_vars ("opm-porsol") From 11d5f9aa917668f00f2037ecc3d2b068c59ace94 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 14:42:36 +0100 Subject: [PATCH 14/15] Find module for opm-upscaling --- cmake/Modules/Findopm-upscaling.cmake | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 cmake/Modules/Findopm-upscaling.cmake diff --git a/cmake/Modules/Findopm-upscaling.cmake b/cmake/Modules/Findopm-upscaling.cmake new file mode 100644 index 00000000..7f80e417 --- /dev/null +++ b/cmake/Modules/Findopm-upscaling.cmake @@ -0,0 +1,44 @@ +# - Find OPM upscaling grid library +# +# Defines the following variables: +# opm-upscaling_INCLUDE_DIRS Directory of header files +# opm-upscaling_LIBRARIES Directory of shared object files +# opm-upscaling_DEFINITIONS Defines that must be set to compile +# opm-upscaling_CONFIG_VARS List of defines that should be in config.h +# HAVE_OPM_UPSCALING 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 (OpmPackage) +find_opm_package ( + # module name + "opm-upscaling" + + # dependencies + "dune-common REQUIRED; + dune-grid REQUIRED; + dune-istl REQUIRED; + opm-core REQUIRED; + dune-cornerpoint REQUIRED; + opm-porsol REQUIRED; + " + # header to search for + "opm/upscaling/SinglePhaseUpscaler.hpp" + + # library to search for + "opmupscaling" + + # defines to be added to compilations + "" + + # test program +"#include +int main (void) { + return 0; +} +" + # config variables + "HAVE_SUPERLU") + +#debug_find_vars ("opm-upscaling") From e3a9a40ae6350397c81f08236abccdc19b76fb6e Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Fri, 22 Feb 2013 20:51:34 +0100 Subject: [PATCH 15/15] Find module for opm-polymer --- cmake/Modules/Findopm-polymer.cmake | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 cmake/Modules/Findopm-polymer.cmake diff --git a/cmake/Modules/Findopm-polymer.cmake b/cmake/Modules/Findopm-polymer.cmake new file mode 100644 index 00000000..647a4eec --- /dev/null +++ b/cmake/Modules/Findopm-polymer.cmake @@ -0,0 +1,41 @@ +# - Find OPM polymer library +# +# Defines the following variables: +# opm-polymer_INCLUDE_DIRS Directory of header files +# opm-polymer_LIBRARIES Directory of shared object files +# opm-polymer_DEFINITIONS Defines that must be set to compile +# opm-polymer_CONFIG_VARS List of defines that should be in config.h +# HAVE_OPM_POLYMER 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 (OpmPackage) +find_opm_package ( + # module name + "opm-polymer" + + # dependencies + "ERT; + opm-core REQUIRED + " + # header to search for + "opm/polymer/PolymerState.hpp" + + # library to search for + "opmpolymer" + + # defines to be added to compilations + "" + + # test program +"#include +int main (void) { + Opm::PolymerState s; + return 0; +} +" + # config variables + "HAVE_ERT") + +#debug_find_vars ("opm-polymer")