Skip to content

Commit e7d12cc

Browse files
committed
- Enable boehm-gc by default
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14120 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 65bd171 commit e7d12cc

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

Compiler/Template/CodegenC.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,7 +2558,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
25582558
CFLAGS=$(CFLAGS_BASED_ON_INIT_FILE) <%makefileParams.cflags%> <%match sopt case SOME(s as SIMULATION_SETTINGS(__)) then s.cflags /* From the simulate() command */%>
25592559
CPPFLAGS=-I"<%makefileParams.omhome%>/include/omc" -I. <%dirExtra%> <%makefileParams.includes ; separator=" "%>
25602560
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"%>
2561-
LDFLAGS=-L"<%makefileParams.omhome%>/lib/omc" $(LIBSIMULATIONRUNTIMEC) -linteractive <%ParModelicaLibs%> <%makefileParams.ldflags%> <%makefileParams.runtimelibs%>
2561+
LDFLAGS=-L"<%makefileParams.omhome%>/lib/omc" -Wl,-rpath,'<%makefileParams.omhome%>/lib/omc' $(LIBSIMULATIONRUNTIMEC) -linteractive <%ParModelicaLibs%> <%makefileParams.ldflags%> <%makefileParams.runtimelibs%>
25622562
PERL=perl
25632563
FILEPREFIX=<%fileNamePrefix%>
25642564
MAINFILE=$(FILEPREFIX)<% if boolOr(acceptMetaModelicaGrammar(), Flags.isSet(Flags.GEN_DEBUG_SYMBOLS)) then ".conv"%>.c
@@ -2785,7 +2785,7 @@ case FUNCTIONCODE(makefileParams=MAKEFILE_PARAMS(__)) then
27852785
EXEEXT=<%makefileParams.exeext%>
27862786
DLLEXT=<%makefileParams.dllext%>
27872787
CFLAGS= -I"<%makefileParams.omhome%>/include/omc" <%makefileParams.includes ; separator=" "%> <%makefileParams.cflags%>
2788-
LDFLAGS= -L"<%makefileParams.omhome%>/lib/omc" -lOpenModelicaRuntimeC <%ParModelicaLibs%> <%makefileParams.ldflags%> <%makefileParams.runtimelibs%>
2788+
LDFLAGS= -L"<%makefileParams.omhome%>/lib/omc" -Wl,-rpath,'<%makefileParams.omhome%>/lib/omc' -lOpenModelicaRuntimeC <%ParModelicaLibs%> <%makefileParams.ldflags%> <%makefileParams.runtimelibs%>
27892789
PERL=perl
27902790
MAINFILE=<%name%><% if boolOr(acceptMetaModelicaGrammar(), Flags.isSet(Flags.GEN_DEBUG_SYMBOLS)) then ".conv"%>.c
27912791

Compiler/omc_release/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ endif
3030

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

3535
PROG = omc
3636
RMLC = @rmlc_bin@

Makefile.common

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,14 @@ libgc-dev: /usr/include/gc/leak_detector.h
7070
libgc-dev: /usr/include/gc/new_gc_alloc.h
7171
libgc-dev: /usr/include/gc/weakpointer.h
7272

73-
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
73+
boehm-gc: mkbuilddirs boehm-gc-lib build/include/omc/gc.h build/include/omc/gc_config_macros.h build/include/omc/gc_version.h
7474
build/include/omc/gc.h: 3rdParty/gc-7.2/include/gc.h mkbuilddirs
75-
cp $< $@
75+
cp -pP $< $@
7676
build/include/omc/gc_config_macros.h: 3rdParty/gc-7.2/include/gc_config_macros.h mkbuilddirs
77-
cp $< $@
77+
cp -pP $< $@
7878
build/include/omc/gc_version.h: 3rdParty/gc-7.2/include/gc_version.h mkbuilddirs
79-
cp $< $@
80-
build/lib/omc/libgc.a: 3rdParty/gc-7.2/.libs/libgc.a mkbuilddirs
81-
cp $< $@
82-
3rdParty/gc-7.2/.libs/libgc.a: 3rdParty/gc-7.2/Makefile
79+
cp -pP $< $@
80+
3rdParty/gc-7.2/.libs/libgc.so: 3rdParty/gc-7.2/Makefile
8381
$(MAKE) -C 3rdParty/gc-7.2/
8482
3rdParty/gc-7.2/Makefile: 3rdParty/gc-7.2/Makefile.in 3rdParty/gc-7.2/configure
8583
(cd 3rdParty/gc-7.2 && ./configure --enable-large-config CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)")

Makefile.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ omc: difftool interactive docs fmi fmil opencl_rt
3636
omcd: difftool interactive docs fmi fmil opencl_rt
3737
(cd Compiler && $(MAKE) -f Makefile debug)
3838

39+
boehm-gc-lib: build/lib/omc/libgc.so build/lib/omc/libgc.so.1 build/lib/omc/libgc.so.1.0.3
40+
build/lib/omc/libgc.so: 3rdParty/gc-7.2/.libs/libgc.so mkbuilddirs
41+
cp -pP $< $@
42+
build/lib/omc/libgc.so.1: 3rdParty/gc-7.2/.libs/libgc.so.1 mkbuilddirs
43+
cp -pP $< $@
44+
build/lib/omc/libgc.so.1.0.3: 3rdParty/gc-7.2/.libs/libgc.so.1.0.3 mkbuilddirs
45+
cp -pP $< $@
46+
3947
qtclean-common:
4048
rm -rf OMShell/bin/OMShell$(EXE) OMShell/OMShellGUI/omc_communication.*
4149
rm -rf OMNotebook/bin/OMNotebook$(EXE) OMNotebook/OMNotebookGUI/omc_communication.*

SimulationRuntime/c/meta/gc/mmc_gc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
/* #define _MMC_GC_ 1 */
5252

5353
/* uncomment this to use the BOEHM Garbage collector */
54-
/* #define _MMC_USE_BOEHM_GC_ */
54+
#define _MMC_USE_BOEHM_GC_
5555

5656
#if defined(__cplusplus)
5757
extern "C" {

0 commit comments

Comments
 (0)