Adopt imported build system to OPM-Autodiff specifics

Updated include statements &c to follow.
This commit is contained in:
Bård Skaflestad 2013-05-15 15:49:48 +02:00
parent 582a947d9b
commit 2500f1ae58
2 changed files with 31 additions and 388 deletions

View File

@ -2,23 +2,17 @@
# vim: set filetype=cmake autoindent tabstop=2 shiftwidth=2 noexpandtab softtabstop=2 nowrap:
# key information about the library
set (project "opm-core")
set (project "opm-autodiff")
set (${project}_NAME "${project}")
set (${project}_DESCRIPTION "Open Porous Media Initiative Core Library")
set (${project}_DESCRIPTION "OPM module for automatic differentiation")
set (${project}_DIR "opm")
set (${project}_VERSION_MAJOR 1)
set (${project}_VERSION_MINOR 0)
set (doxy_dir "Documentation")
set (doxy_dir "doc/doxygen")
# defines that must be present in config.h for our headers
set (${project}_CONFIG_VAR
HAVE_AGMG
HAVE_DUNE_ISTL
HAVE_DYNAMIC_BOOST_TEST
HAVE_ERT
HAVE_SUITESPARSE_UMFPACK_H
HAVE_NULLPTR
HAVE_STATIC_ASSERT
)
# dependencies
@ -29,21 +23,11 @@ set (${project}_DEPS
"CXX11Features"
# various runtime library enhancements
"Boost 1.39.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"
COMPONENTS system unit_test_framework REQUIRED"
# DUNE dependency
"dune-common"
"dune-istl"
"dune-common REQUIRED;
dune-istl REQUIRED;
opm-core REQUIRED"
)
# additional search modules
@ -107,10 +91,11 @@ if (NOT USE_MPI)
set (CMAKE_DISABLE_FIND_PACKAGE_MPI TRUE)
endif (NOT USE_MPI)
### --- begin opm-core specific --- ###
### --- begin opm-porsol specific --- ###
# parallel programming
include (UseOpenMP)
find_openmp (${project})
### --- end opm-core specific --- ###
### --- end opm-porsol specific --- ###
# macro to set standard variables (INCLUDE_DIRS, LIBRARIES etc.)
include (OpmFind)
@ -140,69 +125,9 @@ opm_auto_dirs ()
opm_out_dirs ()
# identify the compilation units in the library; sources in opm/,
# tests files in tests/, examples in tutorials/ and examples/
# tests files in tests/, examples in examples/
opm_sources (${project})
### --- begin AGMG specific --- ###
# Algebraic Multigrid must be compiled together with our program;
# if it is not available, then remove our corresponding component
find_package (AGMG)
if (AGMG_FOUND)
list (APPEND ${project}_SOURCES ${AGMG_SOURCES})
endif (AGMG_FOUND)
### --- end AGMG specific --- ###
### --- begin opm-core specific --- ###
# these solvers are only compiled in if their dependency is found
if (NOT AGMG_FOUND)
list (REMOVE_ITEM opm-core_SOURCES
${PROJECT_SOURCE_DIR}/${opm-core_DIR}/core/linalg/LinearSolverAGMG.cpp
)
endif (NOT AGMG_FOUND)
if (NOT dune-istl_FOUND)
list (REMOVE_ITEM opm-core_SOURCES
${PROJECT_SOURCE_DIR}/${opm-core_DIR}/core/linalg/LinearSolverIstl.cpp
)
endif (NOT dune-istl_FOUND)
if (NOT SuiteSparse_FOUND)
list (REMOVE_ITEM opm-core_SOURCES
${PROJECT_SOURCE_DIR}/${opm-core_DIR}/core/linalg/call_umfpack.c
${PROJECT_SOURCE_DIR}/${opm-core_DIR}/core/linalg/LinearSolverUmfpack.cpp
)
list (REMOVE_ITEM examples_SOURCES
${PROJECT_SOURCE_DIR}/tutorials/tutorial2.cpp
${PROJECT_SOURCE_DIR}/tutorials/tutorial3.cpp
${PROJECT_SOURCE_DIR}/tutorials/tutorial4.cpp
)
endif (NOT SuiteSparse_FOUND)
# we are not supposed to include the TinyXML test prog. regardless
list (REMOVE_ITEM opm-core_SOURCES
${PROJECT_SOURCE_DIR}/${opm-core_DIR}/core/utility/parameters/tinyxml/xmltest.cpp
)
# remove inline TinyXML if a system version was found
if (TinyXML_FOUND)
file (GLOB_RECURSE _inline_tinyxml "${opm-core_DIR}/core/utility/parameters/tinyxml/*")
foreach (_file IN LISTS _inline_tinyxml)
list (REMOVE_ITEM opm-core_SOURCES ${_file})
endforeach (_file)
endif (TinyXML_FOUND)
# anyhow remove it from the header list (so it doesn't get installed)
list (REMOVE_ITEM opm-core_HEADERS "${PROJECT_SOURCE_DIR}/${opm-core_DIR}/core/utility/parameters/tinyxml/tinystr.h")
list (REMOVE_ITEM opm-core_HEADERS "${PROJECT_SOURCE_DIR}/${opm-core_DIR}/core/utility/parameters/tinyxml/tinyxml.h")
# HAVE_ERT is used as an #ifdef, not as an #if in the source code, if it
# is not true, then it should be unset altogether
if (NOT HAVE_ERT)
set (HAVE_ERT)
list (REMOVE_ITEM examples_SOURCES
${PROJECT_SOURCE_DIR}/examples/import_rewrite.cpp
)
endif (NOT HAVE_ERT)
### --- end opm-core specific --- ###
# create configuration header which describes available features
# necessary to compile this library. singular version is the names that
# is required by this project alone, plural version transitively
@ -218,12 +143,6 @@ configure_vars (
WRITE ${${project}_CONFIG_VARS}
)
include (UseFortranWrappers)
define_fc_func (
APPEND ${CONFIG_H}
IF HAVE_AGMG # HAVE_BLAS HAVE_LAPACK
)
# overwrite the config.h that is used by the code only if we have some
# real changes. thus, we don't have to recompile if a reconfigure is run
# due to some files being added, for instance
@ -248,27 +167,13 @@ opm_cmake_config (${project})
# routines to build satellites such as tests, tutorials and samples
include (OpmSatellites)
# example programs are found in the tutorials/ and examples/ directory
# example programs are found in the examples/ directory
opm_compile_satellites (${project} examples "" "")
# infrastructure for testing
enable_testing ()
include (CTest)
### --- begin opm-core specific --- ###
# conditionally disable tests when features aren't available
macro (cond_disable_test name)
if ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
message (STATUS "${name} test disabled, since ${name} is not found.")
string (TOLOWER "${name}" name_lower)
get_filename_component (test_${name}_FILE "tests/test_${name_lower}.cpp" ABSOLUTE)
list (REMOVE_ITEM tests_SOURCES "${test_${name}_FILE}")
endif ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
endmacro (cond_disable_test name)
cond_disable_test ("AGMG")
cond_disable_test ("ERT")
### --- end opm-core specific --- ###
# make datafiles necessary for tests available in output directory
opm_data (tests datafiles "${tests_DIR}")
opm_compile_satellites (${project} tests "" "${tests_REGEXP}")

View File

@ -26,308 +26,46 @@
# originally generated with the command:
# find opm -name '*.c*' -printf '\t%p\n' | sort
list (APPEND MAIN_SOURCE_FILES
opm/core/grid/GridManager.cpp
opm/core/grid/grid.c
opm/core/grid/cart_grid.c
opm/core/grid/cornerpoint_grid.c
opm/core/grid/cpgpreprocess/facetopology.c
opm/core/grid/cpgpreprocess/geometry.c
opm/core/grid/cpgpreprocess/preprocess.c
opm/core/grid/cpgpreprocess/uniquepoints.c
opm/core/io/eclipse/EclipseGridInspector.cpp
opm/core/io/eclipse/EclipseGridParser.cpp
opm/core/io/eclipse/writeECLData.cpp
opm/core/io/vag/vag.cpp
opm/core/io/vtk/writeVtkData.cpp
opm/core/linalg/LinearSolverAGMG.cpp
opm/core/linalg/LinearSolverFactory.cpp
opm/core/linalg/LinearSolverInterface.cpp
opm/core/linalg/LinearSolverIstl.cpp
opm/core/linalg/LinearSolverUmfpack.cpp
opm/core/linalg/call_umfpack.c
opm/core/linalg/sparse_sys.c
opm/core/pressure/CompressibleTpfa.cpp
opm/core/pressure/FlowBCManager.cpp
opm/core/pressure/IncompTpfa.cpp
opm/core/pressure/cfsh.c
opm/core/pressure/flow_bc.c
opm/core/pressure/fsh.c
opm/core/pressure/fsh_common_impl.c
opm/core/pressure/ifsh.c
opm/core/pressure/mimetic/hybsys.c
opm/core/pressure/mimetic/hybsys_global.c
opm/core/pressure/mimetic/mimetic.c
opm/core/pressure/msmfem/coarse_conn.c
opm/core/pressure/msmfem/coarse_sys.c
opm/core/pressure/msmfem/dfs.c
opm/core/pressure/msmfem/hash_set.c
opm/core/pressure/msmfem/ifsh_ms.c
opm/core/pressure/msmfem/partition.c
opm/core/pressure/tpfa/cfs_tpfa.c
opm/core/pressure/tpfa/cfs_tpfa_residual.c
opm/core/pressure/tpfa/compr_bc.c
opm/core/pressure/tpfa/compr_quant.c
opm/core/pressure/tpfa/compr_quant_general.c
opm/core/pressure/tpfa/compr_source.c
opm/core/pressure/tpfa/ifs_tpfa.c
opm/core/pressure/tpfa/trans_tpfa.c
opm/core/pressure/legacy_well.c
opm/core/props/BlackoilPropertiesBasic.cpp
opm/core/props/BlackoilPropertiesFromDeck.cpp
opm/core/props/IncompPropertiesBasic.cpp
opm/core/props/IncompPropertiesFromDeck.cpp
opm/core/props/pvt/BlackoilPvtProperties.cpp
opm/core/props/pvt/PvtPropertiesBasic.cpp
opm/core/props/pvt/PvtPropertiesIncompFromDeck.cpp
opm/core/props/pvt/SinglePvtDead.cpp
opm/core/props/pvt/SinglePvtDeadSpline.cpp
opm/core/props/pvt/SinglePvtInterface.cpp
opm/core/props/pvt/SinglePvtLiveGas.cpp
opm/core/props/pvt/SinglePvtLiveOil.cpp
opm/core/props/rock/RockBasic.cpp
opm/core/props/rock/RockCompressibility.cpp
opm/core/props/rock/RockFromDeck.cpp
opm/core/props/satfunc/SatFuncGwseg.cpp
opm/core/props/satfunc/SatFuncSimple.cpp
opm/core/props/satfunc/SatFuncStone2.cpp
opm/core/props/satfunc/SaturationPropsBasic.cpp
opm/core/props/satfunc/SaturationPropsFromDeck.cpp
opm/core/simulator/SimulatorCompressibleTwophase.cpp
opm/core/simulator/SimulatorIncompTwophase.cpp
opm/core/simulator/SimulatorReport.cpp
opm/core/simulator/SimulatorTimer.cpp
opm/core/tof/DGBasis.cpp
opm/core/tof/TofReorder.cpp
opm/core/tof/TofDiscGalReorder.cpp
opm/core/transport/TransportSolverTwophaseInterface.cpp
opm/core/transport/implicit/TransportSolverTwophaseImplicit.cpp
opm/core/transport/implicit/transport_source.c
opm/core/transport/minimal/spu_explicit.c
opm/core/transport/minimal/spu_implicit.c
opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.cpp
opm/core/transport/reorder/ReorderSolverInterface.cpp
opm/core/transport/reorder/TransportSolverTwophaseReorder.cpp
opm/core/transport/reorder/reordersequence.cpp
opm/core/transport/reorder/tarjan.c
opm/core/utility/MonotCubicInterpolator.cpp
opm/core/utility/StopWatch.cpp
opm/core/utility/VelocityInterpolation.cpp
opm/core/utility/WachspressCoord.cpp
opm/core/utility/miscUtilities.cpp
opm/core/utility/miscUtilitiesBlackoil.cpp
opm/core/utility/parameters/Parameter.cpp
opm/core/utility/parameters/ParameterGroup.cpp
opm/core/utility/parameters/ParameterTools.cpp
opm/core/utility/parameters/ParameterXML.cpp
opm/core/utility/parameters/tinyxml/tinystr.cpp
opm/core/utility/parameters/tinyxml/tinyxml.cpp
opm/core/utility/parameters/tinyxml/tinyxmlerror.cpp
opm/core/utility/parameters/tinyxml/tinyxmlparser.cpp
opm/core/utility/parameters/tinyxml/xmltest.cpp
opm/core/wells/InjectionSpecification.cpp
opm/core/wells/ProductionSpecification.cpp
opm/core/wells/WellCollection.cpp
opm/core/wells/WellsGroup.cpp
opm/core/wells/WellsManager.cpp
opm/core/wells/wells.c
opm/autodiff/BlackoilPropsAd.cpp
opm/autodiff/SimulatorIncompTwophaseAdfi.cpp
opm/autodiff/TransportSolverTwophaseAd.cpp
)
# originally generated with the command:
# find tests -name '*.cpp' -a ! -wholename '*/not-unit/*' -printf '\t%p\n' | sort
list (APPEND TEST_SOURCE_FILES
tests/test_dgbasis.cpp
tests/test_nonuniformtablelinear.cpp
tests/test_sparsevector.cpp
tests/test_sparsetable.cpp
tests/test_velocityinterpolation.cpp
tests/test_quadratures.cpp
tests/test_uniformtablelinear.cpp
tests/test_wells.cpp
tests/test_wachspresscoord.cpp
tests/test_column_extract.cpp
tests/test_geom2d.cpp
tests/test_param.cpp
tests/not-unit/test_ad.cpp
tests/not-unit/test_impestpfa_ad.cpp
tests/not-unit/test_vec.cpp
)
# originally generated with the command:
# find tests -name '*.xml' -a ! -wholename '*/not-unit/*' -printf '\t%p\n' | sort
list (APPEND TEST_DATA_FILES
tests/extratestdata.xml
tests/testdata.xml
tests/fluid.data
)
# originally generated with the command:
# find tutorials examples -name '*.c*' -printf '\t%p\n' | sort
list (APPEND EXAMPLE_SOURCE_FILES
examples/compute_tof.cpp
examples/compute_tof_from_files.cpp
examples/import_rewrite.cpp
examples/sim_2p_comp_reorder.cpp
examples/sim_2p_incomp.cpp
examples/wells_example.cpp
tutorials/tutorial1.cpp
tutorials/tutorial2.cpp
tutorials/tutorial3.cpp
tutorials/tutorial4.cpp
examples/find_zero.cpp
examples/sim_2p_incomp_adfi.cpp
examples/sim_simple.cpp
)
# programs listed here will not only be compiled, but also marked for
# installation
list (APPEND PROGRAM_SOURCE_FILES
examples/sim_2p_comp_reorder.cpp
examples/sim_2p_incomp.cpp
examples/sim_2p_incomp_adfi.cpp
)
# originally generated with the command:
# find opm -name '*.h*' -a ! -name '*-pch.hpp' -printf '\t%p\n' | sort
list (APPEND PUBLIC_HEADER_FILES
opm/core/doxygen_main.hpp
opm/core/grid.h
opm/core/grid/CellQuadrature.hpp
opm/core/grid/ColumnExtract.hpp
opm/core/grid/FaceQuadrature.hpp
opm/core/grid/GridManager.hpp
opm/core/grid/cart_grid.h
opm/core/grid/cornerpoint_grid.h
opm/core/grid/cpgpreprocess/facetopology.h
opm/core/grid/cpgpreprocess/geometry.h
opm/core/grid/cpgpreprocess/grdecl.h
opm/core/grid/cpgpreprocess/preprocess.h
opm/core/grid/cpgpreprocess/uniquepoints.h
opm/core/io/eclipse/CornerpointChopper.hpp
opm/core/io/eclipse/EclipseGridInspector.hpp
opm/core/io/eclipse/EclipseGridParser.hpp
opm/core/io/eclipse/EclipseGridParserHelpers.hpp
opm/core/io/eclipse/EclipseUnits.hpp
opm/core/io/eclipse/SpecialEclipseFields.hpp
opm/core/io/eclipse/writeECLData.hpp
opm/core/io/vag/vag.hpp
opm/core/io/vtk/writeVtkData.hpp
opm/core/linalg/LinearSolverAGMG.hpp
opm/core/linalg/LinearSolverFactory.hpp
opm/core/linalg/LinearSolverInterface.hpp
opm/core/linalg/LinearSolverIstl.hpp
opm/core/linalg/LinearSolverUmfpack.hpp
opm/core/linalg/blas_lapack.h
opm/core/linalg/call_umfpack.h
opm/core/linalg/sparse_sys.h
opm/core/wells.h
opm/core/pressure/CompressibleTpfa.hpp
opm/core/pressure/FlowBCManager.hpp
opm/core/pressure/IncompTpfa.hpp
opm/core/pressure/flow_bc.h
opm/core/pressure/fsh.h
opm/core/pressure/fsh_common_impl.h
opm/core/pressure/legacy_well.h
opm/core/pressure/mimetic/hybsys.h
opm/core/pressure/mimetic/hybsys_global.h
opm/core/pressure/mimetic/mimetic.h
opm/core/pressure/msmfem/coarse_conn.h
opm/core/pressure/msmfem/coarse_sys.h
opm/core/pressure/msmfem/dfs.h
opm/core/pressure/msmfem/hash_set.h
opm/core/pressure/msmfem/ifsh_ms.h
opm/core/pressure/msmfem/partition.h
opm/core/pressure/tpfa/cfs_tpfa.h
opm/core/pressure/tpfa/cfs_tpfa_residual.h
opm/core/pressure/tpfa/compr_bc.h
opm/core/pressure/tpfa/compr_quant.h
opm/core/pressure/tpfa/compr_quant_general.h
opm/core/pressure/tpfa/compr_source.h
opm/core/pressure/tpfa/ifs_tpfa.h
opm/core/pressure/tpfa/trans_tpfa.h
opm/core/props/BlackoilPhases.hpp
opm/core/props/BlackoilPropertiesBasic.hpp
opm/core/props/BlackoilPropertiesFromDeck.hpp
opm/core/props/BlackoilPropertiesInterface.hpp
opm/core/props/IncompPropertiesBasic.hpp
opm/core/props/IncompPropertiesFromDeck.hpp
opm/core/props/IncompPropertiesInterface.hpp
opm/core/props/phaseUsageFromDeck.hpp
opm/core/props/pvt/BlackoilPvtProperties.hpp
opm/core/props/pvt/PvtPropertiesBasic.hpp
opm/core/props/pvt/PvtPropertiesIncompFromDeck.hpp
opm/core/props/pvt/SinglePvtConstCompr.hpp
opm/core/props/pvt/SinglePvtDead.hpp
opm/core/props/pvt/SinglePvtDeadSpline.hpp
opm/core/props/pvt/SinglePvtInterface.hpp
opm/core/props/pvt/SinglePvtLiveGas.hpp
opm/core/props/pvt/SinglePvtLiveOil.hpp
opm/core/props/rock/RockBasic.hpp
opm/core/props/rock/RockCompressibility.hpp
opm/core/props/rock/RockFromDeck.hpp
opm/core/props/satfunc/SatFuncGwseg.hpp
opm/core/props/satfunc/SatFuncSimple.hpp
opm/core/props/satfunc/SatFuncStone2.hpp
opm/core/props/satfunc/SaturationPropsBasic.hpp
opm/core/props/satfunc/SaturationPropsFromDeck.hpp
opm/core/props/satfunc/SaturationPropsFromDeck_impl.hpp
opm/core/props/satfunc/SaturationPropsInterface.hpp
opm/core/simulator/BlackoilState.hpp
opm/core/simulator/SimulatorCompressibleTwophase.hpp
opm/core/simulator/SimulatorIncompTwophase.hpp
opm/core/simulator/SimulatorReport.hpp
opm/core/simulator/SimulatorTimer.hpp
opm/core/simulator/TwophaseState.hpp
opm/core/simulator/WellState.hpp
opm/core/simulator/initState.hpp
opm/core/simulator/initState_impl.hpp
opm/core/tof/DGBasis.hpp
opm/core/tof/TofReorder.hpp
opm/core/tof/TofDiscGalReorder.hpp
opm/core/transport/TransportSolverTwophaseInterface.hpp
opm/core/transport/implicit/CSRMatrixBlockAssembler.hpp
opm/core/transport/implicit/CSRMatrixUmfpackSolver.hpp
opm/core/transport/implicit/GravityColumnSolver.hpp
opm/core/transport/implicit/GravityColumnSolver_impl.hpp
opm/core/transport/implicit/ImplicitAssembly.hpp
opm/core/transport/implicit/ImplicitTransport.hpp
opm/core/transport/implicit/JacobianSystem.hpp
opm/core/transport/implicit/NormSupport.hpp
opm/core/transport/implicit/SinglePointUpwindTwoPhase.hpp
opm/core/transport/implicit/TransportSolverTwophaseImplicit.hpp
opm/core/transport/implicit/SimpleFluid2pWrappingProps.hpp
opm/core/transport/implicit/SimpleFluid2pWrappingProps_impl.hpp
opm/core/transport/implicit/transport_source.h
opm/core/transport/minimal/spu_explicit.h
opm/core/transport/minimal/spu_implicit.h
opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp
opm/core/transport/reorder/ReorderSolverInterface.hpp
opm/core/transport/reorder/TransportSolverTwophaseReorder.hpp
opm/core/transport/reorder/reordersequence.h
opm/core/transport/reorder/tarjan.h
opm/core/utility/Average.hpp
opm/core/utility/DataMap.hpp
opm/core/utility/ErrorMacros.hpp
opm/core/utility/Factory.hpp
opm/core/utility/MonotCubicInterpolator.hpp
opm/core/utility/NonuniformTableLinear.hpp
opm/core/utility/RootFinders.hpp
opm/core/utility/SparseTable.hpp
opm/core/utility/SparseVector.hpp
opm/core/utility/StopWatch.hpp
opm/core/utility/UniformTableLinear.hpp
opm/core/utility/Units.hpp
opm/core/utility/VelocityInterpolation.hpp
opm/core/utility/WachspressCoord.hpp
opm/core/utility/buildUniformMonotoneTable.hpp
opm/core/utility/have_boost_redef.hpp
opm/core/utility/linearInterpolation.hpp
opm/core/utility/miscUtilities.hpp
opm/core/utility/miscUtilitiesBlackoil.hpp
opm/core/utility/parameters/Parameter.hpp
opm/core/utility/parameters/ParameterGroup.hpp
opm/core/utility/parameters/ParameterGroup_impl.hpp
opm/core/utility/parameters/ParameterMapItem.hpp
opm/core/utility/parameters/ParameterRequirement.hpp
opm/core/utility/parameters/ParameterStrings.hpp
opm/core/utility/parameters/ParameterTools.hpp
opm/core/utility/parameters/ParameterXML.hpp
opm/core/utility/parameters/tinyxml/tinystr.h
opm/core/utility/parameters/tinyxml/tinyxml.h
opm/core/wells/InjectionSpecification.hpp
opm/core/wells/ProductionSpecification.hpp
opm/core/wells/WellCollection.hpp
opm/core/wells/WellsGroup.hpp
opm/core/wells/WellsManager.hpp
opm/autodiff/AutoDiffBlock.hpp
opm/autodiff/AutoDiffHelpers.hpp
opm/autodiff/AutoDiff.hpp
opm/autodiff/AutoDiffVec.hpp
opm/autodiff/BlackoilPropsAd.hpp
opm/autodiff/ImpesTPFAAD.hpp
opm/autodiff/SimulatorIncompTwophaseAdfi.hpp
opm/autodiff/TransportSolverTwophaseAd.hpp
)