Skip to content

Commit

Permalink
fix for build of shared DataExchange lib
Browse files Browse the repository at this point in the history
  • Loading branch information
niklwors committed Sep 15, 2015
1 parent f8ebb31 commit eeef9c4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -3161,7 +3161,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
# /LIBPATH: - Directories where libs can be found
#LDFLAGS=/MDd /link /DLL /NOENTRY /LIBPATH:"<%makefileParams.omhome%>/lib/<%getTriple()%>/omc/cpp/msvc" /LIBPATH:"<%makefileParams.omhome%>/bin" /LIBPATH:"$(BOOST_LIBS)" OMCppSystem.lib OMCppMath.lib
#LDSYSTEMFLAGS=/MD /Debug /link /DLL /NOENTRY /LIBPATH:"<%makefileParams.omhome%>/lib/<%getTriple()%>/omc/cpp/msvc" /LIBPATH:"<%makefileParams.omhome%>/bin" /LIBPATH:"$(BOOST_LIBS)" OMCppSystem.lib OMCppModelicaUtilities.lib OMCppMath.lib OMCppOMCFactory.lib
LDSYSTEMFLAGS= /link /DLL /NOENTRY /LIBPATH:"<%makefileParams.omhome%>/lib/<%getTriple()%>/omc/cpp/msvc" /LIBPATH:"<%makefileParams.omhome%>/bin" /LIBPATH:"$(BOOST_LIBS)" OMCppSystem.lib OMCppModelicaUtilities.lib OMCppMath.lib OMCppDataExchange_static.lib OMCppOMCFactory_static.lib <%timeMeasureLink%>
LDSYSTEMFLAGS= /link /DLL /NOENTRY /LIBPATH:"<%makefileParams.omhome%>/lib/<%getTriple()%>/omc/cpp/msvc" /LIBPATH:"<%makefileParams.omhome%>/bin" /LIBPATH:"$(BOOST_LIBS)" OMCppSystem.lib OMCppModelicaUtilities.lib OMCppMath.lib OMCppDataExchange.lib OMCppOMCFactory_static.lib <%timeMeasureLink%>
#LDMAINFLAGS=/MD /Debug /link /LIBPATH:"<%makefileParams.omhome%>/lib/<%getTriple()%>/omc/cpp/msvc" OMCppOMCFactory.lib /LIBPATH:"<%makefileParams.omhome%>/bin" /LIBPATH:"$(BOOST_LIBS)"
LDMAINFLAGS=/link /LIBPATH:"<%makefileParams.omhome%>/lib/<%getTriple()%>/omc/cpp/msvc" OMCppOMCFactory_static.lib OMCppModelicaUtilities.lib <%timeMeasureLink%> /LIBPATH:"<%makefileParams.omhome%>/bin" /LIBPATH:"$(BOOST_LIBS)"
# /MDd link with MSVCRTD.LIB debug lib
Expand Down Expand Up @@ -3198,7 +3198,7 @@ case "gcc" then
let libsStr = (makefileParams.libs |> lib => lib ;separator=" ")
let libsPos1 = if not dirExtra then libsStr //else ""
let libsPos2 = if dirExtra then libsStr // else ""
let staticLibs = '-Wl,--start-group -lOMCppOMCFactory_static -lOMCppSystem_static -lOMCppSimController_static -Wl,--end-group -lOMCppSimulationSettings_static -lOMCppNewton_static -lOMCppEuler_static -lOMCppKinsol_static -lOMCppCVode_static -lOMCppSolver_static -lOMCppMath_static -lOMCppModelicaUtilities_static -lOMCppExtensionUtilities_static -L$(SUNDIALS_LIBS) -L$(UMFPACK_LIBS) -L$(LAPACK_LIBS)'
let staticLibs = '-Wl,--start-group -lOMCppOMCFactory_static -lOMCppSystem_static -lOMCppSimController_static -Wl,--end-group -lOMCppSimulationSettings_static -lOMCppDataExchange_static -lOMCppNewton_static -lOMCppEuler_static -lOMCppKinsol_static -lOMCppCVode_static -lOMCppSolver_static -lOMCppMath_static -lOMCppModelicaUtilities_static -lOMCppExtensionUtilities_static -L$(SUNDIALS_LIBS) -L$(UMFPACK_LIBS) -L$(LAPACK_LIBS)'
let staticIncludes = '-I"$(SUNDIALS_INCLUDE)" -I"$(SUNDIALS_INCLUDE)/kinsol" -I"$(SUNDIALS_INCLUDE)/nvector"'
let _extraCflags = match sopt case SOME(s as SIMULATION_SETTINGS(__)) then ""
let extraCflags = '<%_extraCflags%><% if Flags.isSet(Flags.GEN_DEBUG_SYMBOLS) then " -g"%>'
Expand Down Expand Up @@ -3241,15 +3241,15 @@ case "gcc" then

MODELICA_EXTERNAL_LIBS=-lModelicaExternalC -lModelicaStandardTables -L$(LAPACK_LIBS) $(LAPACK_LIBRARIES)

LDSYSTEMFLAGS_COMMON=-L"$(OMHOME)/lib/<%getTriple()%>/omc/cpp" $(BASE_LIB) <%additionalLinkerFlags_GCC%> -lOMCppDataExchange_static -Wl,-rpath,"$(OMHOME)/lib/<%getTriple()%>/omc/cpp" <%timeMeasureLink%> -L"$(BOOST_LIBS)" $(BOOST_LIBRARIES) $(LINUX_LIB_DL)
LDMAINFLAGS_COMMON=-L"$(OMHOME)/lib/<%getTriple()%>/omc/cpp" -L"$(OMHOME)/bin" -L"$(BOOST_LIBS)" $(BOOST_LIBRARIES) $(LINUX_LIB_DL) <%additionalLinkerFlags_GCC%> -lOMCppDataExchange_static -Wl,-rpath,"$(OMHOME)/lib/<%getTriple()%>/omc/cpp"
LDSYSTEMFLAGS_COMMON=-L"$(OMHOME)/lib/<%getTriple()%>/omc/cpp" $(BASE_LIB) <%additionalLinkerFlags_GCC%> -Wl,-rpath,"$(OMHOME)/lib/<%getTriple()%>/omc/cpp" <%timeMeasureLink%> -L"$(BOOST_LIBS)" $(BOOST_LIBRARIES) $(LINUX_LIB_DL)
LDMAINFLAGS_COMMON=-L"$(OMHOME)/lib/<%getTriple()%>/omc/cpp" -L"$(OMHOME)/bin" -L"$(BOOST_LIBS)" $(BOOST_LIBRARIES) $(LINUX_LIB_DL) <%additionalLinkerFlags_GCC%> -Wl,-rpath,"$(OMHOME)/lib/<%getTriple()%>/omc/cpp"

ifeq ($(USE_PAPI),ON)
$(eval LDMAINFLAGS_COMMON=$(LDMAINFLAGS_COMMON) <%papiLibs%>)
$(eval LDSYSTEMFLAGS_COMMON=$(LDSYSTEMFLAGS_COMMON) <%papiLibs%>)
endif

LDSYSTEMFLAGS_DYNAMIC=-lOMCppSystem -lOMCppModelicaUtilities -lOMCppMath -lOMCppExtensionUtilities -lOMCppOMCFactory $(LDSYSTEMFLAGS_COMMON)
LDSYSTEMFLAGS_DYNAMIC=-lOMCppSystem -lOMCppModelicaUtilities -lOMCppDataExchange -lOMCppMath -lOMCppExtensionUtilities -lOMCppOMCFactory $(LDSYSTEMFLAGS_COMMON)
LDSYSTEMFLAGS_STATIC=<%staticLibs%> $(LDSYSTEMFLAGS_COMMON)

LDMAINFLAGS_DYNAMIC= -lOMCppOMCFactory -lOMCppModelicaUtilities -lOMCppExtensionUtilities $(LDMAINFLAGS_COMMON)
Expand Down
7 changes: 5 additions & 2 deletions SimulationRuntime/cpp/Core/DataExchange/FactoryExport.cpp
Expand Up @@ -6,15 +6,18 @@

#elif defined(OMC_BUILD)


#include <Core/DataExchange/FactoryExport.h>
#include <Core/DataExchange/SimData.h>

#include <Core/DataExchange/XmlPropertyReader.h>
/* OMC factory*/
using boost::extensions::factory;

BOOST_EXTENSION_TYPE_MAP_FUNCTION {
types.get<std::map<std::string, factory<ISimData > > >()
["SimData"].set<SimData>();
/* used late for factory methode createXMLReader
types.get<std::map<std::string, factory<IPropertyReader,string > > >()
["PropertyReader"].set<XmlPropertyReader>();*/
}

#elif defined(SIMSTER_BUILD)
Expand Down
Expand Up @@ -7,12 +7,14 @@

#define BOOST_EXTENSION_SOLVER_DECL
#define BOOST_EXTENSION_SOLVERSETTINGS_DECL
#define BOOST_EXTENSION_XML_READER_DECL

#elif defined(RUNTIME_STATIC_LINKING) && (defined(OMC_BUILD) || defined(SIMSTER_BUILD))
#define BOOST_EXTENSION_LOGGER_DECL

#define BOOST_EXTENSION_XML_READER_DECL
#elif defined(OMC_BUILD) || defined(SIMSTER_BUILD)
#define BOOST_EXTENSION_LOGGER_DECL BOOST_EXTENSION_IMPORT_DECL
#define BOOST_EXTENSION_XML_READER_DECL BOOST_EXTENSION_EXPORT_DECL
#else
error "operating system not supported"
#endif
Expand Down
Expand Up @@ -5,7 +5,7 @@

class IContinuous;

class XmlPropertyReader : public IPropertyReader
class BOOST_EXTENSION_XML_READER_DECL XmlPropertyReader : public IPropertyReader
{
public:
XmlPropertyReader(std::string propertyFile);
Expand Down
1 change: 1 addition & 0 deletions SimulationRuntime/cpp/Include/Core/System/FactoryExport.h
Expand Up @@ -16,6 +16,7 @@
#define BOOST_EXTENSION_EVENTHANDLING_DECL BOOST_EXTENSION_EXPORT_DECL
#define BOOST_EXTENSION_ALGLOOPDEFAULTIMPL_DECL BOOST_EXTENSION_EXPORT_DECL
#define BOOST_EXTENSION_SIMVARS_DECL BOOST_EXTENSION_EXPORT_DECL
#define BOOST_EXTENSION_XML_READER_DECL BOOST_EXTENSION_IMPORT_DECL
#else
error "operating system not supported"
#endif
Expand Down

0 comments on commit eeef9c4

Please sign in to comment.