Skip to content

Commit

Permalink
- Enable boehm-gc by default
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14120 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 28, 2012
1 parent 65bd171 commit e7d12cc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Compiler/Template/CodegenC.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2558,7 +2558,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
CFLAGS=$(CFLAGS_BASED_ON_INIT_FILE) <%makefileParams.cflags%> <%match sopt case SOME(s as SIMULATION_SETTINGS(__)) then s.cflags /* From the simulate() command */%>
CPPFLAGS=-I"<%makefileParams.omhome%>/include/omc" -I. <%dirExtra%> <%makefileParams.includes ; separator=" "%>
LIBSIMULATIONRUNTIMEC=<% if boolAnd(boolNot(stringEq(os(), "OSX")), boolOr(acceptMetaModelicaGrammar(), Flags.isSet(Flags.GEN_DEBUG_SYMBOLS))) then "-Wl,-whole-archive "%>-lSimulationRuntimeC <% if boolAnd(boolNot(stringEq(os(), "OSX")), boolOr(acceptMetaModelicaGrammar(), Flags.isSet(Flags.GEN_DEBUG_SYMBOLS))) then " -Wl,-no-whole-archive"%> <% if stringEq(makefileParams.platform, "win32") then "" else " -ldl"%>
LDFLAGS=-L"<%makefileParams.omhome%>/lib/omc" $(LIBSIMULATIONRUNTIMEC) -linteractive <%ParModelicaLibs%> <%makefileParams.ldflags%> <%makefileParams.runtimelibs%>
LDFLAGS=-L"<%makefileParams.omhome%>/lib/omc" -Wl,-rpath,'<%makefileParams.omhome%>/lib/omc' $(LIBSIMULATIONRUNTIMEC) -linteractive <%ParModelicaLibs%> <%makefileParams.ldflags%> <%makefileParams.runtimelibs%>
PERL=perl
FILEPREFIX=<%fileNamePrefix%>
MAINFILE=$(FILEPREFIX)<% if boolOr(acceptMetaModelicaGrammar(), Flags.isSet(Flags.GEN_DEBUG_SYMBOLS)) then ".conv"%>.c
Expand Down Expand Up @@ -2785,7 +2785,7 @@ case FUNCTIONCODE(makefileParams=MAKEFILE_PARAMS(__)) then
EXEEXT=<%makefileParams.exeext%>
DLLEXT=<%makefileParams.dllext%>
CFLAGS= -I"<%makefileParams.omhome%>/include/omc" <%makefileParams.includes ; separator=" "%> <%makefileParams.cflags%>
LDFLAGS= -L"<%makefileParams.omhome%>/lib/omc" -lOpenModelicaRuntimeC <%ParModelicaLibs%> <%makefileParams.ldflags%> <%makefileParams.runtimelibs%>
LDFLAGS= -L"<%makefileParams.omhome%>/lib/omc" -Wl,-rpath,'<%makefileParams.omhome%>/lib/omc' -lOpenModelicaRuntimeC <%ParModelicaLibs%> <%makefileParams.ldflags%> <%makefileParams.runtimelibs%>
PERL=perl
MAINFILE=<%name%><% if boolOr(acceptMetaModelicaGrammar(), Flags.isSet(Flags.GEN_DEBUG_SYMBOLS)) then ".conv"%>.c

Expand Down
2 changes: 1 addition & 1 deletion Compiler/omc_release/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ endif

LDFLAGS = @LDFLAGS@ -lm -L$(RMLHOME)/lib/plain -lrml -lModelicaExternalC \
$(LIBSOCKET) $(CORBALIBS) $(LIBLPSOLVE55) \
-L../../build/lib/omc @RT_LDFLAGS@ @LD_LAPACK@ @SQLITE3_LIBS@
-L../../build/lib/omc -Wl,-rpath,'$$ORIGIN/../lib/omc' @RT_LDFLAGS@ @LD_LAPACK@ @SQLITE3_LIBS@

PROG = omc
RMLC = @rmlc_bin@
Expand Down
12 changes: 5 additions & 7 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,14 @@ libgc-dev: /usr/include/gc/leak_detector.h
libgc-dev: /usr/include/gc/new_gc_alloc.h
libgc-dev: /usr/include/gc/weakpointer.h

boehm-gc: mkbuilddirs build/lib/omc/libgc.a build/include/omc/gc.h build/include/omc/gc_config_macros.h build/include/omc/gc_version.h
boehm-gc: mkbuilddirs boehm-gc-lib build/include/omc/gc.h build/include/omc/gc_config_macros.h build/include/omc/gc_version.h
build/include/omc/gc.h: 3rdParty/gc-7.2/include/gc.h mkbuilddirs
cp $< $@
cp -pP $< $@
build/include/omc/gc_config_macros.h: 3rdParty/gc-7.2/include/gc_config_macros.h mkbuilddirs
cp $< $@
cp -pP $< $@
build/include/omc/gc_version.h: 3rdParty/gc-7.2/include/gc_version.h mkbuilddirs
cp $< $@
build/lib/omc/libgc.a: 3rdParty/gc-7.2/.libs/libgc.a mkbuilddirs
cp $< $@
3rdParty/gc-7.2/.libs/libgc.a: 3rdParty/gc-7.2/Makefile
cp -pP $< $@
3rdParty/gc-7.2/.libs/libgc.so: 3rdParty/gc-7.2/Makefile
$(MAKE) -C 3rdParty/gc-7.2/
3rdParty/gc-7.2/Makefile: 3rdParty/gc-7.2/Makefile.in 3rdParty/gc-7.2/configure
(cd 3rdParty/gc-7.2 && ./configure --enable-large-config CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)")
Expand Down
8 changes: 8 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ omc: difftool interactive docs fmi fmil opencl_rt
omcd: difftool interactive docs fmi fmil opencl_rt
(cd Compiler && $(MAKE) -f Makefile debug)

boehm-gc-lib: build/lib/omc/libgc.so build/lib/omc/libgc.so.1 build/lib/omc/libgc.so.1.0.3
build/lib/omc/libgc.so: 3rdParty/gc-7.2/.libs/libgc.so mkbuilddirs
cp -pP $< $@
build/lib/omc/libgc.so.1: 3rdParty/gc-7.2/.libs/libgc.so.1 mkbuilddirs
cp -pP $< $@
build/lib/omc/libgc.so.1.0.3: 3rdParty/gc-7.2/.libs/libgc.so.1.0.3 mkbuilddirs
cp -pP $< $@

qtclean-common:
rm -rf OMShell/bin/OMShell$(EXE) OMShell/OMShellGUI/omc_communication.*
rm -rf OMNotebook/bin/OMNotebook$(EXE) OMNotebook/OMNotebookGUI/omc_communication.*
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/meta/gc/mmc_gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
/* #define _MMC_GC_ 1 */

/* uncomment this to use the BOEHM Garbage collector */
/* #define _MMC_USE_BOEHM_GC_ */
#define _MMC_USE_BOEHM_GC_

#if defined(__cplusplus)
extern "C" {
Expand Down

0 comments on commit e7d12cc

Please sign in to comment.