Skip to content

Commit

Permalink
Use old C++ ABI for cross compilation of FMUs
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke committed May 16, 2016
1 parent 833bce9 commit ade6473
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Compiler/Template/CodegenFMUCpp.tpl
Expand Up @@ -750,7 +750,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
endif

CFLAGS_BASED_ON_INIT_FILE=<%extraCflags%>
FMU_CFLAGS=$(subst -DUSE_THREAD,,$(subst -O0,$(SIM_OPT_LEVEL),$(SYSTEM_CFLAGS)))
FMU_CFLAGS=$(subst -DUSE_THREAD,,$(subst -O0,$(SIM_OPT_LEVEL),$(SYSTEM_CFLAGS))) -D_GLIBCXX_USE_CXX11_ABI=0
CFLAGS=$(CFLAGS_BASED_ON_INIT_FILE) -Winvalid-pch $(FMU_CFLAGS) -DFMU_BUILD -DRUNTIME_STATIC_LINKING -I"$(OMHOME)/include/omc/cpp" -I"$(UMFPACK_INCLUDE)" -I"$(SUNDIALS_INCLUDE)" -I"$(BOOST_INCLUDE)" <%makefileParams.includes ; separator=" "%> <%additionalCFlags_GCC%>

ifeq ($(USE_LOGGER),ON)
Expand Down
11 changes: 7 additions & 4 deletions SimulationRuntime/cpp/CMakeLists.txt
Expand Up @@ -442,10 +442,13 @@ ELSE(NOT FMU_TARGET)
FIND_PACKAGE(Boost COMPONENTS filesystem system serialization program_options)
ENDIF(NOT FMU_TARGET)

# This helps with gcc5 when having compiled boost with gcc4
#IF(NOT MSVC)
# ADD_DEFINITIONS(-D_GLIBCXX_USE_CXX11_ABI=0)
#ENDIF(NOT MSVC)
# Use old C++ ABI for cross compilation of FMUs
# because libstdc++ might not be upgraded yet
# (e.g. i686-w64-mingw32 under Ubuntu 16.04 LTS).
# Note: the default ABI is used for simulators that link with boost libs.
IF(FMU_TARGET AND NOT MSVC)
ADD_DEFINITIONS(-D_GLIBCXX_USE_CXX11_ABI=0)
ENDIF(FMU_TARGET AND NOT MSVC)

SET(Boost_LIBRARIES_TMP ${Boost_LIBRARIES_TMP} ${Boost_LIBRARIES})
SET(Boost_LIBRARIES ${Boost_LIBRARIES_TMP})
Expand Down

0 comments on commit ade6473

Please sign in to comment.