diff --git a/host-configs/tpls.cmake b/host-configs/tpls.cmake index 08e605d79bf..e0a7b0f1146 100644 --- a/host-configs/tpls.cmake +++ b/host-configs/tpls.cmake @@ -3,6 +3,14 @@ # message("in tpls.cmake GEOSX_TPL_DIR=${GEOSX_TPL_DIR}") +# +# General TPL Folder verifications +# +if(NOT EXISTS ${GEOSX_TPL_DIR}) + message(WARNING "'GEOSX_TPL_DIR' does not exist.\n") +endif() + + if(EXISTS ${GEOSX_TPL_DIR}/raja) set(RAJA_DIR ${GEOSX_TPL_DIR}/raja CACHE PATH "" FORCE) endif() diff --git a/src/cmake/thirdparty/SetupGeosxThirdParty.cmake b/src/cmake/thirdparty/SetupGeosxThirdParty.cmake index 2a7529576b7..a3a4edd3f0e 100644 --- a/src/cmake/thirdparty/SetupGeosxThirdParty.cmake +++ b/src/cmake/thirdparty/SetupGeosxThirdParty.cmake @@ -1,7 +1,16 @@ #################################### +# # 3rd Party Dependencies +# +# Setup all GEOS TPL +# #################################### + +################################ +# Helper macros & functions +################################ + macro(find_and_import) set(singleValueArgs NAME HEADER) set(multiValueArgs INCLUDE_DIRECTORIES @@ -101,8 +110,22 @@ macro(extract_version_from_header) endmacro( extract_version_from_header) + +macro(mandatory_tpl_doesnt_exist + CURRENT_TPL_NAME + CURRENT_TPL_DIR_VAR) + + message(FATAL_ERROR + "GEOSX requires ${CURRENT_TPL_NAME}, either :\n" + " - Verify that you provided a valid TPL installation directory (GEOSX_TPL_DIR = \"${GEOSX_TPL_DIR}\"),\n" + " - Or set ${CURRENT_TPL_DIR_VAR} to the ${CURRENT_TPL_NAME} installation directory (${CURRENT_TPL_DIR_VAR} = \"${${CURRENT_TPL_DIR_VAR}}\").\n") + +endmacro(mandatory_tpl_doesnt_exist) + + set(thirdPartyLibs "") + ################################ # BLAS/LAPACK ################################ @@ -184,7 +207,7 @@ if(DEFINED CONDUIT_DIR) set(thirdPartyLibs ${thirdPartyLibs} conduit::conduit) else() - message(FATAL_ERROR "GEOSX requires conduit, set CONDUIT_DIR to the conduit installation directory.") + mandatory_tpl_doesnt_exist("Conduit" CONDUIT_DIR) endif() ################################ @@ -215,7 +238,7 @@ if(DEFINED HDF5_DIR) set(ENABLE_HDF5 ON CACHE BOOL "") set(thirdPartyLibs ${thirdPartyLibs} hdf5) else() - message(FATAL_ERROR "GEOSX requires hdf5, set HDF5_DIR to the hdf5 installation directory.") + mandatory_tpl_doesnt_exist("hdf5" HDF5_DIR) endif() ################################ @@ -259,7 +282,7 @@ if(DEFINED PUGIXML_DIR) set(thirdPartyLibs ${thirdPartyLibs} pugixml) endif() else() - message(FATAL_ERROR "GEOSX requires pugixml, set PUGIXML_DIR to the pugixml installation directory.") + mandatory_tpl_doesnt_exist("pugixml" PUGIXML_DIR) endif() ################################ @@ -291,7 +314,7 @@ if(DEFINED RAJA_DIR) set(ENABLE_RAJA ON CACHE BOOL "") set(thirdPartyLibs ${thirdPartyLibs} RAJA ) else() - message(FATAL_ERROR "GEOSX requires RAJA, set RAJA_DIR to the RAJA installation directory.") + mandatory_tpl_doesnt_exist("RAJA" RAJA_DIR) endif() ################################ @@ -322,7 +345,7 @@ if(DEFINED UMPIRE_DIR) set(ENABLE_UMPIRE ON CACHE BOOL "") set(thirdPartyLibs ${thirdPartyLibs} umpire) else() - message(FATAL_ERROR "GEOSX requires Umpire, set UMPIRE_DIR to the Umpire installation directory.") + mandatory_tpl_doesnt_exist("Umpire" UMPIRE_DIR) endif() @@ -345,7 +368,7 @@ if(DEFINED CHAI_DIR) set(ENABLE_CHAI ON CACHE BOOL "") set(thirdPartyLibs ${thirdPartyLibs} chai) else() - message(FATAL_ERROR "GEOSX requires CHAI, set CHAI_DIR to the CHAI installation directory.") + mandatory_tpl_doesnt_exist("CHAI" CHAI_DIR) endif() ################################ @@ -800,7 +823,7 @@ if(DEFINED FMT_DIR) set(thirdPartyLibs ${thirdPartyLibs} fmt::fmt ) else() - message(FATAL_ERROR "GEOSX requires {fmt}, set FMT_DIR to the {fmt} installation directory.") + mandatory_tpl_doesnt_exist("{fmt}" FMT_DIR) endif() ################################ diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp index b30d367dd4c..01e210d20a1 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp @@ -162,7 +162,8 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::checkTablesParameters( real64 const m_phase1->enthalpy.checkTablesParameters( pressure, temperatureInCelsius ); } catch( SimulationError const & ex ) { - string const errorMsg = GEOS_FMT( "{}: Table input error for phase no. 1.\n", getDataContext() ); + string const errorMsg = GEOS_FMT( "Table input error for {} phase (in table from \"{}\").\n", + m_phaseNames[m_p1Index], m_phasePVTParaFiles[m_p1Index] ); throw SimulationError( ex, errorMsg ); } @@ -173,7 +174,8 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::checkTablesParameters( real64 const m_phase2->enthalpy.checkTablesParameters( pressure, temperatureInCelsius ); } catch( SimulationError const & ex ) { - string const errorMsg = GEOS_FMT( "{}: Table input error for phase no. 2.\n", getDataContext() ); + string const errorMsg = GEOS_FMT( "Table input error for {} phase (in table from \"{}\").\n", + m_phaseNames[m_p2Index], m_phasePVTParaFiles[m_p2Index] ); throw SimulationError( ex, errorMsg ); } @@ -182,7 +184,8 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::checkTablesParameters( real64 const m_flash->checkTablesParameters( pressure, temperatureInCelsius ); } catch( SimulationError const & ex ) { - string const errorMsg = GEOS_FMT( "{}: Table input error for flash phase.\n", getDataContext() ); + string const errorMsg = GEOS_FMT( "Table input error for flash phase (in table from \"{}\").\n", + m_flashModelParaFile ); throw SimulationError( ex, errorMsg ); } } diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp index f118a6a6819..93b463ccdd3 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp @@ -214,7 +214,8 @@ void ReactiveBrineFluid< PHASE >::checkTablesParameters( real64 const pressure, m_phase->enthalpy.checkTablesParameters( pressure, temperatureInCelsius ); } catch( SimulationError const & ex ) { - string const errorMsg = GEOS_FMT( "{}: Table input error.\n", getDataContext() ); + string const errorMsg = GEOS_FMT( "Table input error (in table from {}).\n", + stringutilities::join( m_phasePVTParaFiles ) ); throw SimulationError( ex, errorMsg ); } } diff --git a/src/coreComponents/functions/TableFunction.cpp b/src/coreComponents/functions/TableFunction.cpp index 0a8751c28ab..3fa60e36e92 100644 --- a/src/coreComponents/functions/TableFunction.cpp +++ b/src/coreComponents/functions/TableFunction.cpp @@ -177,7 +177,10 @@ void TableFunction::checkCoord( real64 const coord, localIndex const dim ) const real64 const upperBound = m_coordinates[dim][m_coordinates.sizeOfArray( dim ) - 1]; GEOS_THROW_IF( coord > upperBound || coord < lowerBound, GEOS_FMT( "{}: Requested {} is out of the table bounds ( lower bound: {} -> upper bound: {} ).", - getDataContext(), units::formatValue( coord, getDimUnit( dim ) ), lowerBound, upperBound ), + getDataContext(), + units::formatValue( coord, getDimUnit( dim ) ), + units::formatValue( lowerBound, getDimUnit( dim ) ), + units::formatValue( upperBound, getDimUnit( dim ) ) ), SimulationError ); }