Skip to content

Commit

Permalink
- static libraries are now created with each build of the cpp-runtime
Browse files Browse the repository at this point in the history
- turn on static linking by using +d=runtimeStaticLinking of omc
- cleanups and bug-fixes
  • Loading branch information
Marcus Walther committed May 29, 2015
1 parent e3c2d0a commit 272e2c6
Show file tree
Hide file tree
Showing 30 changed files with 225 additions and 325 deletions.
9 changes: 5 additions & 4 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -2574,7 +2574,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 = '$(LIBOMCPPOMCFACTORY) $(LIBOMCPPSIMCONTROLLER) $(LIBOMCPPSIMULATIONSETTINGS) $(LIBOMCPPSYSTEM) $(LIBOMCPPDATAEXCHANGE) $(LIBOMCPPNEWTON) $(LIBOMCPPUMFPACK) $(LIBOMCPPIDA) $(LIBOMCPPKINSOL) $(LIBOMCPPCVODE) $(LIBOMCPPSOLVER) $(LIBOMCPPMATH) $(LIBOMCPPMODELICAUTILITIES) -L$(SUNDIALS_LIB_DIR) $(SUNDIALS_LIBS) $(UMFPACK_LIBS) $(LAPACK_LIBS)'
let staticLibs = '$(LIBOMCPPOMCFACTORY) $(LIBOMCPPSIMCONTROLLER) $(LIBOMCPPSIMULATIONSETTINGS) $(LIBOMCPPSYSTEM) $(LIBOMCPPDATAEXCHANGE) $(LIBOMCPPNEWTON) $(LIBOMCPPUMFPACK) $(LIBOMCPPIDA) $(LIBOMCPPKINSOL) $(LIBOMCPPCVODE) $(LIBOMCPPSOLVER) $(LIBOMCPPMATH) $(LIBOMCPPMODELICAUTILITIES) -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 All @@ -2597,18 +2597,19 @@ case "gcc" then
SIM_OR_DYNLOAD_OPT_LEVEL=-O0
CC=<%CC%>
CXX=<%CXX%>
RUNTIME_STATIC_LINKING=<%if(Flags.isSet(Flags.RUNTIME_STATIC_LINKING)) then 'ON' else 'OFF'%>
<%MPIEnvVars%>

EXEEXT=<%makefileParams.exeext%>
DLLEXT=<%makefileParams.dllext%>
CFLAGS_BASED_ON_INIT_FILE=<%extraCflags%>
CFLAGS=$(CFLAGS_BASED_ON_INIT_FILE) -Winvalid-pch $(SYSTEM_CFLAGS) -I"$(OMHOME)/include/omc/cpp/Core" -I"$(OMHOME)/include/omc/cpp/" -I. <%makefileParams.includes%> -I"$(BOOST_INCLUDE)" -I"$(UMFPACK_INCLUDE)" <%makefileParams.includes ; separator=" "%> <%match sopt case SOME(s as SIMULATION_SETTINGS(__)) then s.cflags %> <%additionalCFlags_GCC%>
CFLAGS_STATIC=$(CFLAGS) <%staticIncludes%>
CFLAGS_STATIC=$(CFLAGS) <%staticIncludes%> -DRUNTIME_STATIC_LINKING

MODELICA_EXTERNAL_LIBS=-lModelicaExternalC -lModelicaStandardTables -L$(LAPACK_LIBS) $(LAPACK_LIBRARIES)
LDSYSTEMFLAGS=-L"$(OMHOME)/lib/<%getTriple()%>/omc/cpp" $(BASE_LIB) -lOMCppOMCFactory -lOMCppSystem -lOMCppModelicaUtilities -lOMCppMath <%additionalLinkerFlags_GCC%> <%timeMeasureLink%> -L"$(BOOST_LIBS)" $(BOOST_LIBRARIES) $(LINUX_LIB_DL)
LDSYSTEMFLAGS=-L"$(OMHOME)/lib/<%getTriple()%>/omc/cpp" $(BASE_LIB) -lOMCppOMCFactory_static -lOMCppSystem -lOMCppModelicaUtilities -lOMCppMath <%additionalLinkerFlags_GCC%> <%timeMeasureLink%> -L"$(BOOST_LIBS)" $(BOOST_LIBRARIES) $(LINUX_LIB_DL)
LDSYSTEMFLAGS_STATIC=<%staticLibs%> $(LDSYSTEMFLAGS)
LDMAINFLAGS=-L"$(OMHOME)/lib/<%getTriple()%>/omc/cpp" -L"$(OMHOME)/bin" -lOMCppOMCFactory -lOMCppModelicaUtilities -L"$(BOOST_LIBS)" $(BOOST_LIBRARIES) $(LINUX_LIB_DL) <%additionalLinkerFlags_GCC%> <%timeMeasureLink%>
LDMAINFLAGS=-L"$(OMHOME)/lib/<%getTriple()%>/omc/cpp" -L"$(OMHOME)/bin" -lOMCppOMCFactory_static -lOMCppModelicaUtilities -L"$(BOOST_LIBS)" $(BOOST_LIBRARIES) $(LINUX_LIB_DL) <%additionalLinkerFlags_GCC%> <%timeMeasureLink%>
LDMAINFLAGS_STATIC=<%staticLibs%> $(LDMAINFLAGS)
CPPFLAGS = $(CFLAGS) <%extraCppFlags%>
SYSTEMFILE=OMCpp<%fileNamePrefix%><% if acceptMetaModelicaGrammar() then ".conv"%>.cpp
Expand Down
1 change: 1 addition & 0 deletions Compiler/Template/SimCodeTV.mo
Expand Up @@ -3057,6 +3057,7 @@ package Flags
constant DebugFlag WRITE_TO_BUFFER;
constant DebugFlag MODEL_INFO_JSON;
constant DebugFlag USEMPI;
constant DebugFlag RUNTIME_STATIC_LINKING;
constant ConfigFlag NUM_PROC;
constant ConfigFlag HPCOM_CODE;
constant ConfigFlag PROFILING_LEVEL;
Expand Down
5 changes: 4 additions & 1 deletion Compiler/Util/Flags.mo
Expand Up @@ -444,6 +444,8 @@ constant DebugFlag VECTORIZE = DEBUG_FLAG(137, "vectorize", false,
Util.gettext("Activates vectorization in the backend."));
constant DebugFlag CHECK_EXT_LIBS = DEBUG_FLAG(138, "buildExternalLibs", true,
Util.gettext("Use the autotools project in the Resources folder of the library to build missing external libraries."));
constant DebugFlag RUNTIME_STATIC_LINKING = DEBUG_FLAG(139, "runtimeStaticLinking", false,
Util.gettext("Use the static simulation runtime libraries (C++ simulation runtime)."));

// This is a list of all debug flags, to keep track of which flags are used. A
// flag can not be used unless it's in this list, and the list is checked at
Expand Down Expand Up @@ -588,7 +590,8 @@ constant list<DebugFlag> allDebugFlags = {
ADD_SCALED_VARS,
ADD_SCALED_VARS_INPUT,
VECTORIZE,
CHECK_EXT_LIBS
CHECK_EXT_LIBS,
RUNTIME_STATIC_LINKING
};

public
Expand Down
12 changes: 1 addition & 11 deletions SimulationRuntime/cpp/CMakeLists.txt
Expand Up @@ -14,14 +14,13 @@
# if profiling for the simulation runtime should be enabled -DRUNTIME_PROFILING
#
# Some of these options can be controlled by passing arguments to CMAKE
# if all runtime libraries should be built and linked statically -DRUNTIME_STATIC_LINKING=ON
# if write output should be handled in parallel -DUSE_PARALLEL_OUTPUT=ON
# if ScoreP should be used for performance analysis -DUSE_SCOREP=ON
# if the boost libraries should be linked statically -DBOOST_STATIC_LINKING=ON
# if the lapack functions and data structurs of sundials should be used -DSUNDIALS_LAPACK=ON
# if boost libraries should be linked against absolute path libraries -DUSE_BOOST_REALPATHS=ON
#
# Example: "cmake -DRUNTIME_STATIC_LINKING=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo" to create statically linked libraries
# Example: "cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo" to create statically linked libraries
#
# The used defines are stored in the SYSTEM_CFLAGS variable, which is passed to the ModelicaConfig.inc and written in the PrecompiledHeader.cmake

Expand All @@ -33,7 +32,6 @@ LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
MESSAGE(STATUS "CMake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")

#Set Options
OPTION(RUNTIME_STATIC_LINKING "RUNTIME_STATIC_LINKING" OFF)
OPTION(USE_PARALLEL_OUTPUT "USE_PARALLEL_OUTPUT" OFF)
OPTION(USE_SCOREP "USE_SCOREP" OFF)
OPTION(BOOST_STATIC_LINKING "BOOST_STATIC_LINKING" OFF)
Expand Down Expand Up @@ -102,14 +100,6 @@ ELSE(NOT BOOST_STATIC_LINKING)
ADD_DEFINITIONS(-DBOOST_STATIC_LINKING)
ENDIF(NOT BOOST_STATIC_LINKING)

# Handle static linking
IF(NOT RUNTIME_STATIC_LINKING)
MESSAGE(STATUS "Static build and linking of runtime disabled")
ELSE(NOT RUNTIME_STATIC_LINKING)
MESSAGE(STATUS "Build and linking runtime statically")
ADD_DEFINITIONS(-DRUNTIME_STATIC_LINKING)
ENDIF(NOT RUNTIME_STATIC_LINKING)

# Handle sundials lapack
IF(NOT SUNDIALS_LAPACK)
MESSAGE(STATUS "Sundials lapack functions disabled")
Expand Down
7 changes: 2 additions & 5 deletions SimulationRuntime/cpp/Core/DataExchange/CMakeLists.txt
Expand Up @@ -8,11 +8,8 @@ IF(NOT BOOST_STATIC_LINKING)
target_link_libraries (${DataExchangeName} ${Boost_LIBRARIES})
ENDIF(NOT BOOST_STATIC_LINKING)

IF(RUNTIME_STATIC_LINKING)
include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR})
ELSE(RUNTIME_STATIC_LINKING)
add_precompiled_header(${DataExchangeName} Include/Core/Modelica.h )
ENDIF(RUNTIME_STATIC_LINKING)
include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR})
add_precompiled_header(${DataExchangeName} Include/Core/Modelica.h)

add_library(${DataExchangeName}_static STATIC SimData.cpp )

Expand Down
1 change: 1 addition & 0 deletions SimulationRuntime/cpp/Core/Math/CMakeLists.txt
Expand Up @@ -13,6 +13,7 @@ IF(RUNTIME_STATIC_LINKING)
ELSE(RUNTIME_STATIC_LINKING)
add_library(${MathName} SHARED ArrayOperations.cpp Functions.cpp FactoryExport.cpp)
target_link_libraries (${MathName} ${Boost_LIBRARIES} ${UMFPACK_LIB} ${LAPACK_LIBRARIES})
set_target_properties(${MathName}_static PROPERTIES COMPILE_DEFINITIONS "DRUNTIME_STATIC_LINKING")
IF(UNIX)
set_target_properties(${MathName} PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF(UNIX)
Expand Down
15 changes: 6 additions & 9 deletions SimulationRuntime/cpp/Core/Modelica/CMakeLists.txt
Expand Up @@ -2,16 +2,13 @@ cmake_minimum_required (VERSION 2.8.6)

project(${ModelicaName})

IF(RUNTIME_STATIC_LINKING)
add_library(${ModelicaName} STATIC Modelica.cpp )
include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR})
ELSE(RUNTIME_STATIC_LINKING)
add_library(${ModelicaName} SHARED Modelica.cpp )
target_link_libraries (${ModelicaName} ${Boost_LIBRARIES})
ENDIF(RUNTIME_STATIC_LINKING)

target_link_libraries (${ModelicaName})
#FIX RUNTIME_STATIC_LINKING
add_library(${ModelicaName}_static STATIC Modelica.cpp )
set_target_properties(${ModelicaName}_static PROPERTIES COMPILE_DEFINITIONS "DRUNTIME_STATIC_LINKING")
include_directories(${SUNDIALS_INCLUDE_DIR}/cvodes ${SUNDIALS_INCLUDE_DIR}/nvector ${SUNDIALS_INCLUDE_DIR}/sundials ${SUNDIALS_INCLUDE_DIR})

add_library(${ModelicaName} SHARED Modelica.cpp )
target_link_libraries (${ModelicaName} ${Boost_LIBRARIES})

GET_TARGET_PROPERTY(libModelicaSystem ${ModelicaName} LOCATION)
GET_FILENAME_COMPONENT(libModelicaSystemNameExt ${libModelicaSystem} EXT)
Expand Down
48 changes: 24 additions & 24 deletions SimulationRuntime/cpp/Core/Modelica/ModelicaConfig_gcc.inc.in
@@ -1,31 +1,31 @@
BOOST_LIBS = @Boost_LIBS_@
BOOST_INCLUDE = @Boost_INCLUDE_@
BOOST_LIBRARIES = @Boost_LIBRARIES_@
BOOST_LIBS=@Boost_LIBS_@
BOOST_INCLUDE=@Boost_INCLUDE_@
BOOST_LIBRARIES=@Boost_LIBRARIES_@

SUNDIALS_LIBS=@SUNDIALS_LIBS_@
SUNDIALS_INCLUDE= @SUNDIALS_INCLUDE_DIR_@
SUNDIALS_LIBRARIES = @SUNDIALS_LIBRARIES_@
SUNDIALS_INCLUDE=@SUNDIALS_INCLUDE_DIR_@
SUNDIALS_LIBRARIES=@SUNDIALS_LIBRARIES_@

LAPACK_LIBS = @LAPACK_LIBS_@
LAPACK_LIBRARIES = @LAPACK_LIBRARIES_@
LAPACK_LIBS=@LAPACK_LIBS_@
LAPACK_LIBRARIES=@LAPACK_LIBRARIES_@

UMFPACK_LIBS = @SUITESPARSE_UMFPACK_LIBS@
UMFPACK_INCLUDE = @UMFPACK_INCLUDE_@
UMFPACK_LIBRARIES = @UMFPACK_LIBRARIES_@
UMFPACK_LIBS=@SUITESPARSE_UMFPACK_LIBS@
UMFPACK_INCLUDE=@UMFPACK_INCLUDE_@
UMFPACK_LIBRARIES=@UMFPACK_LIBRARIES_@

INTEL_TBB_INCLUDE = @TBB_INCLUDE_DIR_@
INTEL_TBB_LIBRARIES = @INTEL_TBB_LIBS@
INTEL_TBB_INCLUDE=@TBB_INCLUDE_DIR_@
INTEL_TBB_LIBRARIES=@INTEL_TBB_LIBS@

PUGIXML_INCLUDE = @PUGIXML_INCLUDE_DIR_@
PUGIXML_LIBRARIES = @PUGIXML_LIBRARIES@
PUGIXML_INCLUDE=@PUGIXML_INCLUDE_DIR_@
PUGIXML_LIBRARIES=@PUGIXML_LIBRARIES@

MODELICA_SYSTEM_LIB_EXT = @MODELICA_SYSTEM_LIB_EXT@
FMI_ARCH_DIR = @FMI_ARCH_DIR@
LINUX_LIB_DL = @LINUX_LIB_DL@
BASE_LIB = @BASE_LIB@
PCH_FILE = @PCH_FILE@
H_FILE = @H_FILE@
BUILD_TYPE = @BUILD_TYPE@
SYSTEM_CFLAGS = @SYSTEM_CFLAGS@
ADDITIONAL_DEFINES = @ADDITIONAL_DEFINES@
RUNTIME_STATIC_LINKING = @RUNTIME_STATIC_LINKING@
MODELICA_SYSTEM_LIB_EXT=@MODELICA_SYSTEM_LIB_EXT@
FMI_ARCH_DIR=@FMI_ARCH_DIR@
LINUX_LIB_DL=@LINUX_LIB_DL@
BASE_LIB=@BASE_LIB@
PCH_FILE=@PCH_FILE@
H_FILE=@H_FILE@
BUILD_TYPE=@BUILD_TYPE@
SYSTEM_CFLAGS=@SYSTEM_CFLAGS@
ADDITIONAL_DEFINES=@ADDITIONAL_DEFINES@
RUNTIME_STATIC_LINKING=@RUNTIME_STATIC_LINKING@
30 changes: 15 additions & 15 deletions SimulationRuntime/cpp/Core/Modelica/ModelicaLibraryConfig.inc.in
@@ -1,15 +1,15 @@
LIBOMCPPOMCFACTORY = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@OMCFactoryName@_static.a"
LIBOMCPPSIMCONTROLLER = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@SimControllerName@_static.a"
LIBOMCPPSIMULATIONSETTINGS = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@SimulationSettings@_static.a"
LIBOMCPPSYSTEM = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@SystemName@_static.a"
LIBOMCPPDATAEXCHANGE = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@DataExchangeName@_static.a"
LIBOMCPPNEWTON = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@NewtonName@_static.a"
LIBOMCPPKINSOL = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@KinsolName@_static.a"
LIBOMCPPUMFPACK = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@UmfPackName@_static.a"
LIBOMCPPIDA = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@IDAName@_static.a"
LIBOMCPPCVODE = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@CVodeName@_static.a"
LIBOMCPPPEER = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@PeerName@_static.a"
LIBOMCPPSOLVER = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@SolverName@_static.a"
LIBOMCPPMATH = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@MathName@_static.a"
LIBOMCPPMODELICAUTILITIES = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@ModelicaUtilitiesName@.a"
LIBOMCPPEXTENSIONUTILITIES = "$(OMHOME)/lib/omc/@LIBINSTALLEXT@/lib@ExtensionUtilitiesName@_static.a"
LIBOMCPPOMCFACTORY = "$(OMHOME)/@LIBINSTALLEXT@/lib@OMCFactoryName@_static.a"
LIBOMCPPSIMCONTROLLER = "$(OMHOME)/@LIBINSTALLEXT@/lib@SimControllerName@_static.a"
LIBOMCPPSIMULATIONSETTINGS = "$(OMHOME)/@LIBINSTALLEXT@/lib@SimulationSettings@_static.a"
LIBOMCPPSYSTEM = "$(OMHOME)/@LIBINSTALLEXT@/lib@SystemName@_static.a"
LIBOMCPPDATAEXCHANGE = "$(OMHOME)/@LIBINSTALLEXT@/lib@DataExchangeName@_static.a"
LIBOMCPPNEWTON = "$(OMHOME)/@LIBINSTALLEXT@/lib@NewtonName@_static.a"
LIBOMCPPKINSOL = "$(OMHOME)/@LIBINSTALLEXT@/lib@KinsolName@_static.a"
LIBOMCPPUMFPACK = "$(OMHOME)/@LIBINSTALLEXT@/lib@UmfPackName@_static.a"
LIBOMCPPIDA = "$(OMHOME)/@LIBINSTALLEXT@/lib@IDAName@_static.a"
LIBOMCPPCVODE = "$(OMHOME)/@LIBINSTALLEXT@/lib@CVodeName@_static.a"
LIBOMCPPPEER = "$(OMHOME)/@LIBINSTALLEXT@/lib@PeerName@_static.a"
LIBOMCPPSOLVER = "$(OMHOME)/@LIBINSTALLEXT@/lib@SolverName@_static.a"
LIBOMCPPMATH = "$(OMHOME)/@LIBINSTALLEXT@/lib@MathName@_static.a"
LIBOMCPPMODELICAUTILITIES = "$(OMHOME)/@LIBINSTALLEXT@/lib@ModelicaUtilitiesName@_static.a"
LIBOMCPPEXTENSIONUTILITIES = "$(OMHOME)/@LIBINSTALLEXT@/lib@ExtensionUtilitiesName@_static.a"
40 changes: 19 additions & 21 deletions SimulationRuntime/cpp/Core/Utils/extension/CMakeLists.txt
@@ -1,28 +1,26 @@
cmake_minimum_required (VERSION 2.8.6)

project(${ExtensionUtilitiesName})
IF(RUNTIME_STATIC_LINKING)
add_library(${ExtensionUtilitiesName}_static STATIC measure_time.cpp measure_time_rdtsc.cpp measure_time_scorep.cpp)
IF(NOT BOOST_STATIC_LINKING)
target_link_libraries (${ExtensionUtilitiesName}_static ${Boost_LIBRARIES})
ENDIF(NOT BOOST_STATIC_LINKING)
IF(UNIX)
set_target_properties(${ExtensionUtilitiesName}_static PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF(UNIX)

install (TARGETS ${ExtensionUtilitiesName}_static DESTINATION ${LIBINSTALLEXT})
ELSE(RUNTIME_STATIC_LINKING)
add_library(${ExtensionUtilitiesName} SHARED measure_time.cpp measure_time_rdtsc.cpp measure_time_scorep.cpp)
IF(NOT BOOST_STATIC_LINKING)
target_link_libraries (${ExtensionUtilitiesName} ${Boost_LIBRARIES})
ENDIF(NOT BOOST_STATIC_LINKING)
IF(UNIX)
set_target_properties(${ExtensionUtilitiesName} PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF(UNIX)

install (TARGETS ${ExtensionUtilitiesName} DESTINATION ${LIBINSTALLEXT})
ENDIF(RUNTIME_STATIC_LINKING)

add_library(${ExtensionUtilitiesName}_static STATIC measure_time.cpp measure_time_rdtsc.cpp measure_time_scorep.cpp)
IF(NOT BOOST_STATIC_LINKING)
target_link_libraries (${ExtensionUtilitiesName}_static ${Boost_LIBRARIES})
ENDIF(NOT BOOST_STATIC_LINKING)
IF(UNIX)
set_target_properties(${ExtensionUtilitiesName}_static PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF(UNIX)
set_target_properties(${ExtensionUtilitiesName}_static PROPERTIES COMPILE_DEFINITIONS "DRUNTIME_STATIC_LINKING")
install (TARGETS ${ExtensionUtilitiesName}_static DESTINATION ${LIBINSTALLEXT})

add_library(${ExtensionUtilitiesName} SHARED measure_time.cpp measure_time_rdtsc.cpp measure_time_scorep.cpp)
IF(NOT BOOST_STATIC_LINKING)
target_link_libraries (${ExtensionUtilitiesName} ${Boost_LIBRARIES})
ENDIF(NOT BOOST_STATIC_LINKING)
IF(UNIX)
set_target_properties(${ExtensionUtilitiesName} PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF(UNIX)

install (TARGETS ${ExtensionUtilitiesName} DESTINATION ${LIBINSTALLEXT})

install (FILES ${CMAKE_SOURCE_DIR}/Include/Core/Utils/extension/measure_time.hpp
${CMAKE_SOURCE_DIR}/Include/Core/Utils/extension/measure_time_rdtsc.hpp
Expand Down
9 changes: 1 addition & 8 deletions SimulationRuntime/cpp/Include/Core/Solver/FactoryExport.h
Expand Up @@ -3,20 +3,13 @@
* Base module for all solver
* @{
*/
#if defined(__vxworks) || defined(__TRICORE__)
#if defined(__vxworks) || defined(__TRICORE__) || defined(RUNTIME_STATIC_LINKING)

#define BOOST_EXTENSION_SOLVER_DECL
#define BOOST_EXTENSION_SOLVERSETTINGS_DECL
#define BOOST_EXTENSION_STATESELECT_DECL
#define BOOST_EXTENSION_MONITOR_DECL

#elif defined(RUNTIME_STATIC_LINKING)

#define BOOST_EXTENSION_SOLVER_DECL
#define BOOST_EXTENSION_STATESELECT_DECL
#define BOOST_EXTENSION_SOLVERSETTINGS_DECL
#define BOOST_EXTENSION_MONITOR_DECL

#elif defined(OMC_BUILD) || defined(SIMSTER_BUILD)

#define BOOST_EXTENSION_SOLVER_DECL BOOST_EXTENSION_EXPORT_DECL
Expand Down
Expand Up @@ -26,10 +26,6 @@ Provision of member variables used by all solvers.
/*****************************************************************************
Copyright (c) 2008, OSMC
*****************************************************************************/
#if defined(RUNTIME_STATIC_LINKING)
#undef BOOST_EXTENSION_SOLVER_DECL
#define BOOST_EXTENSION_SOLVER_DECL
#endif

class BOOST_EXTENSION_SOLVER_DECL SolverDefaultImplementation : public SimulationMonitor
{
Expand Down
7 changes: 1 addition & 6 deletions SimulationRuntime/cpp/Include/Core/Solver/SolverSettings.h
Expand Up @@ -17,11 +17,6 @@ Encapsulation of general solver settings.
/*****************************************************************************
Copyright (c) 2008, OSMC
*****************************************************************************/
#if defined(RUNTIME_STATIC_LINKING)
#undef BOOST_EXTENSION_SOLVERSETTINGS_DECL
#define BOOST_EXTENSION_SOLVERSETTINGS_DECL
#endif

class BOOST_EXTENSION_SOLVERSETTINGS_DECL SolverSettings : public ISolverSettings
{
public:
Expand Down Expand Up @@ -67,4 +62,4 @@ class BOOST_EXTENSION_SOLVERSETTINGS_DECL SolverSettings : public ISolverSetting
bool
_denseOutput;
};
/** @} */ // end of coreSolver
/** @} */ // end of coreSolver
Expand Up @@ -10,11 +10,6 @@
#include <Core/System/IStateSelection.h>
#include <boost/shared_array.hpp>

#if defined(RUNTIME_STATIC_LINKING)
#undef BOOST_EXTENSION_STATESELECT_DECL
#define BOOST_EXTENSION_STATESELECT_DECL
#endif

class BOOST_EXTENSION_STATESELECT_DECL SystemStateSelection
{
public:
Expand All @@ -38,4 +33,4 @@ class BOOST_EXTENSION_STATESELECT_DECL SystemStateSelection
std::vector<unsigned int> _dimStateCanditates;
bool _initialized;
};
/** @} */ // end of coreSolver
/** @} */ // end of coreSolver
19 changes: 9 additions & 10 deletions SimulationRuntime/cpp/Include/Core/System/FactoryExport.h
Expand Up @@ -5,18 +5,17 @@
*/

#if defined(__vxworks) || defined(__TRICORE__) || defined(RUNTIME_STATIC_LINKING)

#define BOOST_EXTENSION_SYSTEM_DECL
#define BOOST_EXTENSION_EVENTHANDLING_DECL
#define BOOST_EXTENSION_ALGLOOPDEFAULTIMPL_DECL
#define BOOST_EXTENSION_SIMVARS_DECL
#define BOOST_EXTENSION_SYSTEM_DECL
#define BOOST_EXTENSION_EVENTHANDLING_DECL
#define BOOST_EXTENSION_ALGLOOPDEFAULTIMPL_DECL
#define BOOST_EXTENSION_SIMVARS_DECL
#elif defined(OMC_BUILD) || defined(SIMSTER_BUILD)
#define BOOST_EXTENSION_SYSTEM_DECL BOOST_EXTENSION_EXPORT_DECL
#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_SYSTEM_DECL BOOST_EXTENSION_EXPORT_DECL
#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
#else
error "operating system not supported"
error "operating system not supported"
#endif

/** @} */ // end of coreSystem
Expand Down

0 comments on commit 272e2c6

Please sign in to comment.