Skip to content

Commit

Permalink
Remove duplicate and erroneous Modelica external C libs, ticket:4772
Browse files Browse the repository at this point in the history
Use libs from C runtime for Cpp as well,
see also modelica/ModelicaStandardLibrary#2470

Belonging to [master]:
  - OpenModelica/OMCompiler#2229
  • Loading branch information
rfranke authored and OpenModelica-Hudson committed Feb 23, 2018
1 parent bf329a1 commit 9062175
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Compiler/Template/CodegenCpp.tpl
Expand Up @@ -3203,7 +3203,7 @@ case "gcc" then
CFLAGS_STATIC=$(CFLAGS_COMMON) <%staticIncludes%> -DRUNTIME_STATIC_LINKING -DENABLE_SUNDIALS_STATIC

MINGW_EXTRA_LIBS=<%if boolOr(stringEq(makefileParams.platform, "win32"),stringEq(makefileParams.platform, "win64")) then ' -lz -lhdf5 ' else ''%>
MODELICA_EXTERNAL_LIBS=-lModelicaExternalC -lModelicaStandardTables -L$(LAPACK_LIBS) $(LAPACK_LIBRARIES) $(MINGW_EXTRA_LIBS)
MODELICA_EXTERNAL_LIBS=-L$(LAPACK_LIBS) $(LAPACK_LIBRARIES) $(MINGW_EXTRA_LIBS)

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" <%if boolOr(stringEq(makefileParams.platform, "win32"),stringEq(makefileParams.platform, "win64")) then ' -lwsock32 -lws2_32 ' else ''%>
Expand Down
8 changes: 4 additions & 4 deletions Compiler/Template/CodegenFMUCpp.tpl
Expand Up @@ -698,9 +698,9 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
# /link - [linker options and libraries]
# /LIBPATH: - Directories where libs can be found
OMCPP_SOLVER_LIBS=OMCppNewton_static.lib OMCppDgesv_static.lib OMCppDgesvSolver_static.lib
MODELICA_EXTERNAL_LIBS=ModelicaExternalC.lib ModelicaStandardTables.lib OMCppModelicaUtilities_static.lib
MODELICA_UTILITIES_LIB=OMCppModelicaUtilities_static.lib
EXTRA_LIBS=<%dirExtra%> <%libsExtra%>
LDFLAGS=/link /DLL /NOENTRY /LIBPATH:"<%makefileParams.omhome%>/lib/omc/cpp/msvc" /LIBPATH:"<%makefileParams.omhome%>/bin" OMCppSystem_static.lib OMCppMath_static.lib OMCppExtensionUtilities_static.lib OMCppFMU_static.lib $(OMCPP_SOLVER_LIBS) $(EXTRA_LIBS) $(MODELICA_EXTERNAL_LIBS)
LDFLAGS=/link /DLL /NOENTRY /LIBPATH:"<%makefileParams.omhome%>/lib/omc/cpp/msvc" /LIBPATH:"<%makefileParams.omhome%>/bin" OMCppSystem_static.lib OMCppMath_static.lib OMCppExtensionUtilities_static.lib OMCppFMU_static.lib $(OMCPP_SOLVER_LIBS) $(EXTRA_LIBS) $(MODELICA_UTILITIES_LIB)
PLATFORM="<%makefileParams.platform%>"

MODELICA_SYSTEM_LIB=<%fileNamePrefix%>
Expand Down Expand Up @@ -796,9 +796,9 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
BINARIES=<%fileNamePrefix%>$(DLLEXT)

OMCPP_LIBS=-lOMCppSystem_static -lOMCppMath_static -lOMCppModelicaUtilities_static -lOMCppFMU_static $(OMCPP_SOLVER_LIBS) -lOMCppExtensionUtilities_static
MODELICA_EXTERNAL_LIBS=-lModelicaExternalC -lModelicaStandardTables -lOMCppModelicaUtilities_static
MODELICA_UTILITIES_LIB=-lOMCppModelicaUtilities_static
EXTRA_LIBS=<%dirExtra%> <%libsExtra%>
LIBS=$(OMCPP_LIBS) $(EXTRA_LIBS) $(MODELICA_EXTERNAL_LIBS) $(BASE_LIB)
LIBS=$(OMCPP_LIBS) $(EXTRA_LIBS) $(MODELICA_UTILITIES_LIB) $(BASE_LIB)

# link with simple dgesv or full lapack
ifeq ($(USE_DGESV),ON)
Expand Down
8 changes: 0 additions & 8 deletions SimulationRuntime/cpp/CMakeLists.txt
Expand Up @@ -91,9 +91,6 @@ OPTION(TRILINOS_ROOT "TRILINOS ROOT" "")
OPTION(USE_CPP_03 "USE_CPP_03" OFF)

#Set Variables
SET(MODELICAEXTERNALCDIR "${CMAKE_SOURCE_DIR}/../../3rdParty/ModelicaExternalC/C-Sources")
SET(USERTABDIR "${CMAKE_SOURCE_DIR}/../../libraries/Resources/Data/Tables")

IF(NOT FMU_TARGET)
SET(LIBINSTALLEXT "lib/omc/cpp" CACHE STRING "library directory")
ENDIF(NOT FMU_TARGET)
Expand All @@ -108,10 +105,6 @@ SET(SolverName ${LIBPREFIX}Solver${LIBSUFFIX})
SET(SystemName ${LIBPREFIX}System${LIBSUFFIX})
SET(OMCFactoryName ${LIBPREFIX}OMCFactory${LIBSUFFIX})
SET(MathName ${LIBPREFIX}Math${LIBSUFFIX})
SET(ModelicaExternalName ModelicaExternalC) # only static version
SET(ModelicaTablesName ModelicaStandardTables) # only static version
SET(LibZName zlib) # only static version
SET(ModelicaMatIOName ModelicaMatIO) # only static version

SET(SimulationSettings ${LIBPREFIX}SimulationSettings${LIBSUFFIX})
SET(SimControllerName ${LIBPREFIX}SimController${LIBSUFFIX})
Expand Down Expand Up @@ -837,7 +830,6 @@ add_subdirectory(Core/Solver)
add_subdirectory(Core/Math)
add_subdirectory(Core/Utils/Modelica)
add_subdirectory(Core/Utils/extension)
add_subdirectory(Core/ModelicaExternalC)

if(NOT FMU_TARGET)
# add projects for generating a simulator
Expand Down
26 changes: 0 additions & 26 deletions SimulationRuntime/cpp/Core/ModelicaExternalC/CMakeLists.txt

This file was deleted.

0 comments on commit 9062175

Please sign in to comment.