Skip to content

Commit

Permalink
FMI2 Cpp: add libOMCppMath_static to FMU (#3238)
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25341 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
rfranke committed Mar 31, 2015
1 parent 07c4c44 commit aa24eef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Compiler/Template/CodegenFMUCpp.tpl
Expand Up @@ -685,7 +685,8 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
CALCHELPERMAINFILE5=OMCpp<%fileNamePrefix%>CalcHelperMain5.cpp
ALGLOOPSMAINFILE=OMCpp<%fileNamePrefix%>AlgLoopMain.cpp

LIBS= -lOMCppSystem_FMU -lOMCppDataExchange_static -lOMCppOMCFactory $(BASE_LIB) $(BOOST_LIBRARIES) $(LINUX_LIB_DL)
OMCPP_LIBS= -lOMCppSystem_FMU -lOMCppDataExchange_static -lOMCppOMCFactory -lOMCppMath_static
LIBS= $(OMCPP_LIBS) $(BASE_LIB) $(BOOST_LIBRARIES) $(LINUX_LIB_DL)

CPPFILES=OMCpp<%fileNamePrefix%>.cpp OMCpp<%fileNamePrefix%>FMU.cpp $(CALCHELPERMAINFILE) $(CALCHELPERMAINFILE2) $(CALCHELPERMAINFILE3) $(CALCHELPERMAINFILE4) $(CALCHELPERMAINFILE5) $(ALGLOOPSMAINFILE)
OFILES=$(CPPFILES:.cpp=.o)
Expand Down
12 changes: 7 additions & 5 deletions SimulationRuntime/cpp/Core/Math/CMakeLists.txt
Expand Up @@ -2,12 +2,14 @@ cmake_minimum_required (VERSION 2.8.6)

project(${MathName})
# add the solver default implementation library

add_library(${MathName}_static STATIC ArrayOperations.cpp Functions.cpp SparseMatrix.cpp FactoryExport.cpp)
IF(UNIX)
set_target_properties(${MathName}_static PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF(UNIX)
install (TARGETS ${MathName}_static DESTINATION lib/omc/${LIBINSTALLEXT})

IF(RUNTIME_STATIC_LINKING)
add_library(${MathName}_static STATIC ArrayOperations.cpp Functions.cpp SparseMatrix.cpp FactoryExport.cpp)
IF(UNIX)
set_target_properties(${MathName}_static PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF(UNIX)
install (TARGETS ${MathName}_static DESTINATION lib/omc/${LIBINSTALLEXT})
ELSE(RUNTIME_STATIC_LINKING)
add_library(${MathName} SHARED ArrayOperations.cpp Functions.cpp SparseMatrix.cpp FactoryExport.cpp)
target_link_libraries (${MathName} ${Boost_LIBRARIES} ${UMFPACK_LIB} ${LAPACK_LIBRARIES})
Expand Down

0 comments on commit aa24eef

Please sign in to comment.