Merge pull request #5132 from blattms/fix-shared-linking

Fix linking errors when using shared libraries.
This commit is contained in:
Bård Skaflestad 2024-01-30 11:02:51 +01:00 committed by GitHub
commit 472199f63d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 18 additions and 13 deletions

View File

@ -350,7 +350,6 @@ if (HAVE_OPM_TESTS)
endif()
target_sources(test_outputdir PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_LogOutputHelper PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_equil PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_RestartSerialization PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_glift1 PRIVATE $<TARGET_OBJECTS:moduleVersion>)

View File

@ -172,6 +172,7 @@ EclGenericOutputBlackoilModule(const EclipseState& eclState,
const Schedule& schedule,
const SummaryConfig& summaryConfig,
const SummaryState& summaryState,
const std::string& moduleVersion,
bool enableEnergy,
bool enableTemperature,
bool enableMech,
@ -189,7 +190,7 @@ EclGenericOutputBlackoilModule(const EclipseState& eclState,
, interRegionFlows_(numCells(eclState),
defineInterRegionFlowArrays(eclState, summaryConfig),
declaredMaxRegionID(eclState.runspec()))
, logOutput_(eclState, schedule, summaryState)
, logOutput_(eclState, schedule, summaryState, moduleVersion)
, enableEnergy_(enableEnergy)
, enableTemperature_(enableTemperature)
, enableMech_(enableMech)

View File

@ -303,6 +303,7 @@ protected:
const Schedule& schedule,
const SummaryConfig& summaryConfig,
const SummaryState& summaryState,
const std::string& moduleVersionName,
bool enableEnergy,
bool enableTemperature,
bool enableMech,

View File

@ -31,6 +31,8 @@
#include <ebos/eclbasevanguard.hh>
#include <ebos/eclgenericoutputblackoilmodule.hh>
#include <opm/simulators/utils/moduleVersion.hpp>
#include <opm/common/Exceptions.hpp>
#include <opm/common/TimingMacros.hpp>
@ -144,6 +146,7 @@ public:
simulator.vanguard().schedule(),
simulator.vanguard().summaryConfig(),
simulator.vanguard().summaryState(),
moduleVersionName(),
getPropValue<TypeTag, Properties::EnableEnergy>(),
getPropValue<TypeTag, Properties::EnableTemperature>(),
getPropValue<TypeTag, Properties::EnableMech>(),

View File

@ -85,13 +85,13 @@ namespace Opm {
template<class Scalar>
LogOutputHelper<Scalar>::LogOutputHelper(const EclipseState& eclState,
const Schedule& schedule,
const SummaryState& summaryState)
const SummaryState& summaryState,
const std::string& moduleVersionName)
: eclState_(eclState)
, schedule_(schedule)
, summaryState_(summaryState)
{
flowVersionName_ = moduleVersionName();
}
, flowVersionName_(moduleVersionName)
{}
template<class Scalar>
void LogOutputHelper<Scalar>::

View File

@ -43,7 +43,8 @@ class LogOutputHelper {
public:
LogOutputHelper(const EclipseState& eclState,
const Schedule& schedule,
const SummaryState& st);
const SummaryState& st,
const std::string& moduleVersionName);
//! \brief Write cumulative production and injection reports to output.
void cumulative(const std::size_t reportStepNum) const;

View File

@ -166,7 +166,7 @@ BOOST_AUTO_TEST_CASE(Cumulative)
st.set(p.first, p.second * 1e3);
}
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
Opm::LogOutputHelper<double> helper(eclState, schedule, st, "dummy version");
helper.cumulative(0);
std::string data = trimStream(str);
BOOST_CHECK_EQUAL(data, reference);
@ -194,7 +194,7 @@ Finding the dew point pressure failed for 3 cells [(5,1,1), (6,1,1), (7,1,1)]
Opm::EclipseState eclState(deck);
Opm::SummaryState st;
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
Opm::LogOutputHelper<double> helper(eclState, schedule, st, "dummy version");
str.str(""); // clear out parser errors
helper.error({1,20,30}, {4,5,6});
@ -254,7 +254,7 @@ BOOST_AUTO_TEST_CASE(Fip)
Opm::EclipseState eclState(deck);
Opm::SummaryState st;
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
Opm::LogOutputHelper<double> helper(eclState, schedule, st, "dummy version");
Opm::Inplace initial, current;
const auto& phases = current.phases();
int offset = 17;
@ -321,7 +321,7 @@ BOOST_AUTO_TEST_CASE(FipResv)
Opm::EclipseState eclState(deck);
Opm::SummaryState st;
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
Opm::LogOutputHelper<double> helper(eclState, schedule, st, "dummy version");
Opm::Inplace current;
const auto& phases = current.phases();
int offset = 17;
@ -391,7 +391,7 @@ BOOST_AUTO_TEST_CASE(Injection)
st.set(p.first, p.second);
}
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
Opm::LogOutputHelper<double> helper(eclState, schedule, st, "dummy version");
helper.injection(0);
std::string data = trimStream(str);
BOOST_CHECK_EQUAL(data, reference);
@ -452,7 +452,7 @@ BOOST_AUTO_TEST_CASE(Production)
st.set(p.first, p.second);
}
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
Opm::LogOutputHelper<double> helper(eclState, schedule, st, "dummy version");
helper.production(0);
std::string data = trimStream(str);
BOOST_CHECK_EQUAL(data, reference);