From ea6fdbda5b1fadecbd0df17e5f1d4884adeb9da5 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Fri, 28 Jun 2024 10:47:20 +0200 Subject: [PATCH 1/2] [MatL] Add explicit template instantiation declarations. To fix following runtime error: ./libThermoHydroMechanics.so: undefined symbol: Eigen::Matrix MaterialPropertyLib::formKelvinVector<3>(std::variant, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix > const&) --- MaterialLib/MPL/Utils/FormKelvinVector.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MaterialLib/MPL/Utils/FormKelvinVector.h b/MaterialLib/MPL/Utils/FormKelvinVector.h index efb2dd2d222..5ade040ae7f 100644 --- a/MaterialLib/MPL/Utils/FormKelvinVector.h +++ b/MaterialLib/MPL/Utils/FormKelvinVector.h @@ -35,4 +35,10 @@ template MathLib::KelvinVector::KelvinVectorType formKelvinVector( MaterialPropertyLib::PropertyDataType const& values); +extern template MathLib::KelvinVector::KelvinVectorType<2> formKelvinVector<2>( + MaterialPropertyLib::PropertyDataType const& values); + +extern template MathLib::KelvinVector::KelvinVectorType<3> formKelvinVector<3>( + MaterialPropertyLib::PropertyDataType const& values); + } // namespace MaterialPropertyLib From ea93ab7afa0eb6573ac161c4790aea88fd1d3d36 Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Tue, 8 Oct 2024 14:24:19 +0200 Subject: [PATCH 2/2] [conda] Build static MaterialLib. --- MaterialLib/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MaterialLib/CMakeLists.txt b/MaterialLib/CMakeLists.txt index c870201ece9..a056c6aebc9 100644 --- a/MaterialLib/CMakeLists.txt +++ b/MaterialLib/CMakeLists.txt @@ -32,8 +32,13 @@ append_source_files(SOURCES PorousMedium/UnsaturatedProperty/CapillaryPressure) append_source_files( SOURCES PorousMedium/UnsaturatedProperty/RelativePermeability ) +if(CONDA_BUILD) + set(_static_on_conda STATIC) +endif() -ogs_add_library(MaterialLib GENERATE_EXPORT_HEADER ${SOURCES}) +ogs_add_library( + MaterialLib GENERATE_EXPORT_HEADER ${_static_on_conda} ${SOURCES} +) target_link_libraries( MaterialLib PUBLIC BaseLib Eigen3::Eigen MaterialLib_SolidModels