Skip to content

Commit

Permalink
- changed the name of "USE_FMU_KINSOL" to "USE_FMU_SUNDIALS" because …
Browse files Browse the repository at this point in the history
…otherwise we have to add such defines for CVode and IDA as well

- added a SimController_FMU and System_FMU library to the build of the c++ runtime -- otherwise we can not turn off sundials for the FMUs
- the function OMCFactory::loadSimControllerLib was created, now we are able to overload the loading mechanism in StaticOMCFactory
- StaticOMCFactory is now header only and added to the build process again
  • Loading branch information
Marcus Walther committed Sep 17, 2015
1 parent e6cfb0d commit 058d92c
Show file tree
Hide file tree
Showing 27 changed files with 230 additions and 108 deletions.
14 changes: 9 additions & 5 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -2325,6 +2325,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
<%additionalIncludes%>
#ifdef RUNTIME_STATIC_LINKING
#include "OMCpp<%fileNamePrefix%>CalcHelperMain.cpp"
#include <SimCoreFactory/OMCFactory/StaticOMCFactory.h>
#endif

#ifdef USE_BOOST_THREAD
Expand Down Expand Up @@ -2414,9 +2415,11 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
%>
<%additionalPreRunCommands%>


boost::shared_ptr<OMCFactory> _factory = boost::shared_ptr<OMCFactory>(new OMCFactory());

#ifdef RUNTIME_STATIC_LINKING
boost::shared_ptr<StaticOMCFactory> _factory = boost::shared_ptr<StaticOMCFactory>(new StaticOMCFactory());
#else
boost::shared_ptr<OMCFactory> _factory = boost::shared_ptr<OMCFactory>(new OMCFactory());
#endif //RUNTIME_STATIC_LINKING
//SimController to start simulation

std::pair<boost::shared_ptr<ISimController>, SimSettings> simulation = _factory->createSimulation(argc, argv, opts);
Expand Down Expand Up @@ -3198,7 +3201,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 -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 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 -lOMCppIDA_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 @@ -3237,7 +3240,7 @@ case "gcc" then
endif

CFLAGS_DYNAMIC=$(CFLAGS_COMMON)
CFLAGS_STATIC=$(CFLAGS_COMMON) <%staticIncludes%> -DRUNTIME_STATIC_LINKING
CFLAGS_STATIC=$(CFLAGS_COMMON) <%staticIncludes%> -DRUNTIME_STATIC_LINKING -DENABLE_SUNDIALS_STATIC

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

Expand Down Expand Up @@ -3726,6 +3729,7 @@ match simCode
_dimTimeEvent = <%timeEventLength(simCode)%>;
//Number of residues
_event_handling= boost::shared_ptr<EventHandling>(new EventHandling());
initializeAlgloopSolverVariables(); //if we do not initialize it here, we get a segfault in the destructor if initialization of Solver or OMFactory has failed
<%if Flags.isSet(Flags.WRITE_TO_BUFFER) then
<<
_dimResidues = <%numResidues(allEquations)%>;
Expand Down
9 changes: 5 additions & 4 deletions Compiler/Template/CodegenFMUCpp.tpl
Expand Up @@ -754,13 +754,14 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula

# CVode can be used for Co-Simulation FMUs, Kinsol is available to handle non linear equation systems
OMCPP_SOLVER_LIBS=-lOMCppNewton_static
ifeq ($(USE_FMU_KINSOL),ON)
ifeq ($(USE_FMU_SUNDIALS),ON)
$(eval OMCPP_SOLVER_LIBS=$(OMCPP_SOLVER_LIBS) -lOMCppKinsol_static $(SUNDIALS_LIBRARIES))
$(eval CFLAGS=-DENABLE_SUNDIALS_STATIC $(CFLAGS))
endif

CPPFLAGS = $(CFLAGS)

OMCPP_LIBS=-Wl,--start-group -lOMCppOMCFactory_FMU_static -lOMCppSystem_static -lOMCppSimController_static -Wl,--end-group -lOMCppDataExchange_static -lOMCppSimulationSettings_static $(OMCPP_SOLVER_LIBS) -lOMCppSolver_static -lOMCppMath_static -lOMCppModelicaUtilities_static -lOMCppExtensionUtilities_static -lOMCppFMU_static
OMCPP_LIBS=-Wl,--start-group -lOMCppOMCFactory_FMU_static -lOMCppSystem_FMU_static -lOMCppSimController_FMU_static -Wl,--end-group -lOMCppDataExchange_static -lOMCppSimulationSettings_static $(OMCPP_SOLVER_LIBS) -lOMCppSolver_static -lOMCppMath_static -lOMCppModelicaUtilities_static -lOMCppExtensionUtilities_static -lOMCppFMU_static
MODELICA_EXTERNAL_LIBS=-lModelicaExternalC -lModelicaStandardTables -L$(LAPACK_LIBS) $(LAPACK_LIBRARIES)
BOOST_LIBRARIES = -l$(BOOST_SYSTEM_LIB) -l$(BOOST_FILESYSTEM_LIB) -l$(BOOST_PROGRAM_OPTIONS_LIB)
LIBS= $(OMCPP_LIBS) $(MODELICA_EXTERNAL_LIBS) $(BASE_LIB) $(BOOST_LIBRARIES)
Expand All @@ -775,14 +776,14 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
<%\t%>rm -rf binaries
<%\t%><%mkdir%> -p "binaries/$(PLATFORM)"
<%\t%>cp <%fileNamePrefix%>$(DLLEXT) "binaries/$(PLATFORM)/"
ifeq ($(USE_FMU_KINSOL),ON)
ifeq ($(USE_FMU_SUNDIALS),ON)
<%\t%>rm -rf documentation
<%\t%><%mkdir%> -p "documentation"
<%\t%>cp $(SUNDIALS_LIBRARIES_KINSOL) "binaries/$(PLATFORM)/"
<%\t%>cp $(OMHOME)/share/omc/runtime/cpp/licenses/sundials.license "documentation/"
endif
<%\t%>rm -f <%modelName%>.fmu
ifeq ($(USE_FMU_KINSOL),ON)
ifeq ($(USE_FMU_SUNDIALS),ON)
<%\t%>zip -r "<%modelName%>.fmu" modelDescription.xml binaries documentation
<%\t%>rm -rf documentation
else
Expand Down
22 changes: 11 additions & 11 deletions SimulationRuntime/cpp/CMakeLists.txt
Expand Up @@ -12,7 +12,7 @@
# if the Intel TBB library was found -DUSE_INTEL_TBB
# if the Pugi XML library was found -DUSE_PUGI_XML
# if profiling for the simulation runtime should be enabled -DRUNTIME_PROFILING
# if the equation systems of a FMU should be solved with kinsol -DFMU_KINSOL
# if the equation systems of a FMU should be solved with sundials solvers -DFMU_SUNDIALS
# if the logger should be used -DUSE_LOGGER
#
# Some of these options can be controlled by passing arguments to CMAKE
Expand All @@ -37,7 +37,7 @@ OPTION(USE_PARALLEL_OUTPUT "USE_PARALLEL_OUTPUT" OFF)
OPTION(USE_SCOREP "USE_SCOREP" OFF)
OPTION(BOOST_STATIC_LINKING "BOOST_STATIC_LINKING" OFF)
OPTION(RUNTIME_PROFILING "RUNTIME_PROFILING" OFF)
OPTION(FMU_KINSOL "FMU_KINSOL" OFF)
OPTION(FMU_SUNDIALS "FMU_SUNDIALS" OFF)
OPTION(SUNDIALS_ROOT "SUNDIALS ROOT" "")

#Set Variables
Expand Down Expand Up @@ -133,15 +133,15 @@ ELSE(RUNTIME_PROFILING)
MESSAGE(STATUS "Runtime profiling disabled")
ENDIF(RUNTIME_PROFILING)

# Handle FMU kinsol support
IF(FMU_KINSOL)
ADD_DEFINITIONS(-DENABLE_KINSOL_STATIC)
SET(USE_FMU_KINSOL_ "ON")
MESSAGE(STATUS "FMU kinsol enabled")
ELSE(FMU_KINSOL)
SET(USE_FMU_KINSOL_ "OFF")
MESSAGE(STATUS "FMU kinsol disabled")
ENDIF(FMU_KINSOL)
# Handle FMU sundials support
IF(FMU_SUNDIALS)
ADD_DEFINITIONS(-DENABLE_SUNDIALS_STATIC)
SET(USE_FMU_SUNDIALS_ "ON")
MESSAGE(STATUS "FMU sundials enabled")
ELSE(FMU_SUNDIALS)
SET(USE_FMU_SUNDIALS_ "OFF")
MESSAGE(STATUS "FMU sundials disabled")
ENDIF(FMU_SUNDIALS)

# Handle Logger usage
IF(USE_LOGGER)
Expand Down
Expand Up @@ -35,7 +35,7 @@ ADDITIONAL_DEFINES=@ADDITIONAL_DEFINES@

SCOREP_INCLUDE=@SCOREP_INCLUDE_@
USE_SCOREP=@USE_SCOREP_@
USE_FMU_KINSOL=@USE_FMU_KINSOL_@
USE_FMU_SUNDIALS=@USE_FMU_SUNDIALS_@
USE_PAPI=@USE_PAPI_@
USE_LOGGER=@USE_LOGGER_@

Expand Down
23 changes: 16 additions & 7 deletions SimulationRuntime/cpp/Core/SimController/CMakeLists.txt
Expand Up @@ -4,25 +4,34 @@ project(${SimControllerName})

include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR}/kinsol ${SUNDIALS_INCLUDE_DIR})
add_library(${SimControllerName}_static STATIC Configuration.cpp FactoryExport.cpp Initialization.cpp SimController.cpp SimManager.cpp)
set_target_properties(${SimControllerName}_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING")
set_target_properties(${SimControllerName}_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING;ENABLE_SUNDIALS_STATIC")
install (TARGETS ${SimControllerName}_static DESTINATION ${LIBINSTALLEXT})

add_library(${SimControllerName}_FMU_static STATIC Configuration.cpp FactoryExport.cpp Initialization.cpp SimController.cpp SimManager.cpp)
if(FMU_KINSOL)
set_target_properties(${SimControllerName}_FMU_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING;ENABLE_SUNDIALS_STATIC")
else(FMU_KINSOL)
set_target_properties(${SimControllerName}_FMU_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING")
endif(FMU_KINSOL)
install (TARGETS ${SimControllerName}_FMU_static DESTINATION ${LIBINSTALLEXT})

add_library(${SimControllerName} SHARED Configuration.cpp FactoryExport.cpp Initialization.cpp SimController.cpp SimManager.cpp)
target_link_libraries( ${SimControllerName} ${OMCFactoryName}_static ${ExtensionUtilitiesName} ${ModelicaUtilitiesName} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS})
add_precompiled_header(${SimControllerName} Include/Core/Modelica.h)
install (TARGETS ${SimControllerName} DESTINATION ${LIBINSTALLEXT})

if (UNIX)
set_target_properties(${SimControllerName} PROPERTIES COMPILE_FLAGS -fPIC)
set_target_properties(${SimControllerName}_static PROPERTIES COMPILE_FLAGS -fPIC)
set_target_properties(${SimControllerName} PROPERTIES COMPILE_FLAGS -fPIC)
set_target_properties(${SimControllerName}_static PROPERTIES COMPILE_FLAGS -fPIC)
set_target_properties(${SimControllerName}_FMU_static PROPERTIES COMPILE_FLAGS -fPIC)
endif(UNIX)

install (FILES ${CMAKE_SOURCE_DIR}/Include/Core/SimController/ISimData.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/ISimController.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/SimController.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/SimManager.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/SimController.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/SimManager.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/Configuration.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/Initialization.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/SimController.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/SimManager.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/Configuration.h
${CMAKE_SOURCE_DIR}/Include/Core/SimController/Initialization.h
DESTINATION include/omc/cpp/Core/SimController)
7 changes: 7 additions & 0 deletions SimulationRuntime/cpp/Core/SimController/FactoryExport.cpp
Expand Up @@ -44,6 +44,13 @@ BOOST_EXTENSION_TYPE_MAP_FUNCTION {

}

#ifdef RUNTIME_STATIC_LINKING
boost::shared_ptr<ISimController> createSimController(PATH library_path, PATH modelicasystem_path)
{
return boost::shared_ptr<ISimController>(new SimController(library_path, modelicasystem_path));
}
#endif

#else
error "operating system not supported"
#endif
Expand Down
3 changes: 2 additions & 1 deletion SimulationRuntime/cpp/Core/Solver/CMakeLists.txt
Expand Up @@ -3,7 +3,8 @@ cmake_minimum_required (VERSION 2.8.6)
project(${SolverName})

include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR})
add_library(${SolverName}_static STATIC SolverDefaultImplementation.cpp SolverSettings.cpp SystemStateSelection.cpp FactoryExport.cpp SimulationMonitor.cpp )
add_library(${SolverName}_static STATIC SolverDefaultImplementation.cpp SolverSettings.cpp SystemStateSelection.cpp FactoryExport.cpp SimulationMonitor.cpp)
set_target_properties(${SolverName}_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING;ENABLE_SUNDIALS_STATIC")
add_precompiled_header(${SolverName}_static Include/Core/Modelica.h)
install (TARGETS ${SolverName}_static DESTINATION ${LIBINSTALLEXT})

Expand Down
37 changes: 23 additions & 14 deletions SimulationRuntime/cpp/Core/System/CMakeLists.txt
Expand Up @@ -9,49 +9,58 @@ set(BASE_LIB "" CACHE INTERNAL "" )
#set(BASE_LIB -l${BasiLibName} CACHE INTERNAL "" )
#ENDIF (NOT ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR MSVC))

include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR}/kinsol ${SUNDIALS_INCLUDE_DIR})

# add the system default implementation library
# add a static library with the system default implementation for generating c++ fmu targets
add_library(${SystemName}_static STATIC AlgLoopDefaultImplementation.cpp AlgLoopSolverFactory.cpp EventHandling.cpp DiscreteEvents.cpp ContinuousEvents.cpp SystemDefaultImplementation.cpp SimVars.cpp)
set_target_properties(${SystemName}_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING")
include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR}/kinsol ${SUNDIALS_INCLUDE_DIR})

if (UNIX)
set_target_properties(${SystemName}_static PROPERTIES COMPILE_FLAGS -fPIC)
endif(UNIX)

add_library(${SystemName}_static STATIC AlgLoopDefaultImplementation.cpp AlgLoopSolverFactory.cpp EventHandling.cpp DiscreteEvents.cpp ContinuousEvents.cpp SystemDefaultImplementation.cpp SimVars.cpp FactoryExport.cpp)
set_target_properties(${SystemName}_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING;ENABLE_SUNDIALS_STATIC")
install (TARGETS ${SystemName}_static DESTINATION ${LIBINSTALLEXT})

add_library(${SystemName}_FMU_static STATIC AlgLoopDefaultImplementation.cpp AlgLoopSolverFactory.cpp EventHandling.cpp DiscreteEvents.cpp ContinuousEvents.cpp SystemDefaultImplementation.cpp SimVars.cpp FactoryExport.cpp)
if(FMU_SUNDIALS)
set_target_properties(${SystemName}_FMU_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING;ENABLE_SUNDIALS_STATIC")
else(FMU_SUNDIALS)
set_target_properties(${SystemName}_FMU_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING")
endif(FMU_SUNDIALS)
install (TARGETS ${SystemName}_FMU_static DESTINATION ${LIBINSTALLEXT})

add_library(${SystemName} SHARED AlgLoopDefaultImplementation.cpp AlgLoopSolverFactory.cpp EventHandling.cpp DiscreteEvents.cpp ContinuousEvents.cpp SystemDefaultImplementation.cpp SimVars.cpp FactoryExport.cpp)

target_link_libraries (${SystemName} ${Boost_LIBRARIES} ${LAPACK_LIBRARIES} ${OMCFactoryName}_static ${SimulationSettings} )
add_precompiled_header(${SystemName} Include/Core/Modelica.h)
install (TARGETS ${SystemName} DESTINATION ${LIBINSTALLEXT})

if (UNIX)
set_target_properties(${SystemName} PROPERTIES COMPILE_FLAGS -fPIC)
set_target_properties(${SystemName}_static PROPERTIES COMPILE_FLAGS -fPIC)
set_target_properties(${SystemName}_FMU_static PROPERTIES COMPILE_FLAGS -fPIC)
endif(UNIX)

#IF (NOT ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR MSVC))
#install (TARGETS ${BasiLibName} DESTINATION ${LIBINSTALLEXT})
#ENDIF (NOT ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR MSVC))
install (FILES
${CMAKE_SOURCE_DIR}/Include/Core/System/SystemDefaultImplementation.h
${CMAKE_SOURCE_DIR}/Include/Core/System/AlgLoopDefaultImplementation.h
${CMAKE_SOURCE_DIR}/Include/Core/System/SystemDefaultImplementation.h
${CMAKE_SOURCE_DIR}/Include/Core/System/AlgLoopDefaultImplementation.h
${CMAKE_SOURCE_DIR}/Include/Core/System/EventHandling.h
${CMAKE_SOURCE_DIR}/Include/Core/System/PreVariables.h
${CMAKE_SOURCE_DIR}/Include/Core/System/DiscreteEvents.h
${CMAKE_SOURCE_DIR}/Include/Core/System/ContinuousEvents.h
${CMAKE_SOURCE_DIR}/Include/Core/System/SimVars.h
${CMAKE_SOURCE_DIR}/Include/Core/System/FactoryExport.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IAlgLoop.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IAlgLoop.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IAlgLoopSolverFactory.h
${CMAKE_SOURCE_DIR}/Include/Core/System/AlgLoopSolverFactory.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IContinuous.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IMixedSystem.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IEvent.h
${CMAKE_SOURCE_DIR}/Include/Core/System/ITime.h
${CMAKE_SOURCE_DIR}/Include/Core/System/ITime.h
${CMAKE_SOURCE_DIR}/Include/Core/System/ISystemProperties.h
${CMAKE_SOURCE_DIR}/Include/Core/System/ISystemInitialization.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IStepEvent.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IWriteOutput.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IStateSelection.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IWriteOutput.h
${CMAKE_SOURCE_DIR}/Include/Core/System/IStateSelection.h
${CMAKE_SOURCE_DIR}/Include/Core/System/ISimVars.h
DESTINATION include/omc/cpp/Core/System)

Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Core/System/FactoryExport.cpp
Expand Up @@ -47,7 +47,7 @@ BOOST_EXTENSION_TYPE_MAP_FUNCTION {
#include <Core/System/AlgLoopSolverFactory.h>
boost::shared_ptr<IAlgLoopSolverFactory> createStaticAlgLoopSolverFactory(IGlobalSettings* globalSettings,PATH library_path,PATH modelicasystem_path)
{
boost::shared_ptr<IAlgLoopSolverFactory> algloopSolverFactory = boost::shared_ptr<IAlgLoopSolverFactory>(new AlgLoopSolverFactory(globalSettings,library_path,modelicasystem_path))
boost::shared_ptr<IAlgLoopSolverFactory> algloopSolverFactory = boost::shared_ptr<IAlgLoopSolverFactory>(new AlgLoopSolverFactory(globalSettings,library_path,modelicasystem_path));
return algloopSolverFactory;
}

Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Include/FMU/FMUGlobalSettings.h
Expand Up @@ -2,7 +2,7 @@
#include <string.h>
using std::string;

#ifdef FMU_KINSOL
#ifdef ENABLE_SUNDIALS_STATIC
#define DEFAULT_NLS "kinsol"
#else
#define DEFAULT_NLS "newton"
Expand Down
29 changes: 29 additions & 0 deletions SimulationRuntime/cpp/Include/FMU/FactoryExport.h
Expand Up @@ -19,4 +19,33 @@
error "operating system not supported"
#endif

#ifndef ENABLE_SUNDIALS_STATIC
boost::shared_ptr<INonLinSolverSettings> createKinsolSettings()
{
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Kinsol was disabled during build");
}
boost::shared_ptr<IAlgLoopSolver> createKinsolSolver(IAlgLoop* algLoop, boost::shared_ptr<INonLinSolverSettings> solver_settings)
{
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Kinsol was disabled during build");
}
#endif

boost::shared_ptr<ISolver> createCVode(IMixedSystem* system, boost::shared_ptr<ISolverSettings> solver_settings)
{
throw ModelicaSimulationError(SOLVER,"CVode was disabled during build");
}
boost::shared_ptr<ISolverSettings> createCVodeSettings(boost::shared_ptr<IGlobalSettings> globalSettings)
{
throw ModelicaSimulationError(SOLVER,"CVode was disabled during build");
}

boost::shared_ptr<ISolver> createIda(IMixedSystem* system, boost::shared_ptr<ISolverSettings> solver_settings)
{
throw ModelicaSimulationError(SOLVER,"IDA was disabled during build");
}
boost::shared_ptr<ISolverSettings> createIdaSettings(boost::shared_ptr<IGlobalSettings> globalSettings)
{
throw ModelicaSimulationError(SOLVER,"IDA was disabled during build");
}

/** @} */ // end of coreSystem
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Include/FMU2/FMU2GlobalSettings.h
Expand Up @@ -37,7 +37,7 @@

#include <Core/SimulationSettings/IGlobalSettings.h>

#ifdef FMU_KINSOL
#ifdef ENABLE_SUNDIALS_STATIC
#define DEFAULT_NLS "kinsol"
#else
#define DEFAULT_NLS "newton"
Expand Down
Expand Up @@ -74,6 +74,8 @@ class OMCFactory
void fillArgumentsToIgnore();
void fillArgumentsToReplace();

virtual boost::shared_ptr<ISimController> loadSimControllerLib(PATH simcontroller_path, type_map simcontroller_type_map);

//boost::shared_ptr<ISimController> _simController;
map<string,shared_library> _modules;
string _defaultLinSolver;
Expand Down

0 comments on commit 058d92c

Please sign in to comment.