Skip to content

Commit bc1c42e

Browse files
committed
OSX compilation fixes for lis
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17031 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent ec6b4fe commit bc1c42e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Compiler/Template/CodegenC.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3291,7 +3291,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
32913291
CFLAGS=$(CFLAGS_BASED_ON_INIT_FILE) <%makefileParams.cflags%> <%match sopt case SOME(s as SIMULATION_SETTINGS(__)) then s.cflags /* From the simulate() command */%>
32923292
CPPFLAGS=-I"<%makefileParams.omhome%>/include/omc" -I. <%dirExtra%> <%makefileParams.includes ; separator=" "%> -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME
32933293
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"%>
3294-
LDFLAGS=-L"<%makefileParams.omhome%>/lib/omc" -L"<%makefileParams.omhome%>/lib" -Wl,<% if stringEq(makefileParams.platform, "win32") then "--stack,0x2000000,"%>-rpath,'<%makefileParams.omhome%>/lib/omc' -Wl,-rpath,'<%makefileParams.omhome%>/lib' $(LIBSIMULATIONRUNTIMEC) -linteractive <%ParModelicaLibs%> <%makefileParams.ldflags%> <%makefileParams.runtimelibs%> <%match System.os() case "OSX" then "-lf2c" else "-Wl,-Bstatic -lf2c"%> -Wl,-Bdynamic -llis
3294+
LDFLAGS=-L"<%makefileParams.omhome%>/lib/omc" -L"<%makefileParams.omhome%>/lib" -Wl,<% if stringEq(makefileParams.platform, "win32") then "--stack,0x2000000,"%>-rpath,'<%makefileParams.omhome%>/lib/omc' -Wl,-rpath,'<%makefileParams.omhome%>/lib' $(LIBSIMULATIONRUNTIMEC) -linteractive <%ParModelicaLibs%> <%makefileParams.ldflags%> <%makefileParams.runtimelibs%> <%match System.os() case "OSX" then "-lf2c" else "-Wl,-Bstatic -lf2c"%> -llis
32953295
PERL=perl
32963296
FILEPREFIX=<%fileNamePrefix%>
32973297
MAINFILE=$(FILEPREFIX)<% if boolOr(acceptMetaModelicaGrammar(), Flags.isSet(Flags.GEN_DEBUG_SYMBOLS)) then ".conv"%>.c

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ lis: lis-configure mkbuilddirs
133133

134134
lis-configure:
135135
# Configure and build lis
136-
if ! test -f 3rdParty/lis-1.4.12/Makefile; then cd 3rdParty/lis-1.4.12 && ./configure --enable-shared --disable-static CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" && $(MAKE) clean; fi
136+
if ! test -f 3rdParty/lis-1.4.12/Makefile; then cd 3rdParty/lis-1.4.12 && ./configure --enable-shared --disable-static CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) @LIS_LDFLAGS@" && $(MAKE) clean; fi
137137
lis-clean:
138138
if test -f 3rdParty/lis-1.4.12/Makefile; then $(MAKE) -C 3rdParty/lis-1.4.12 clean; fi
139139
rm -f 3rdParty/lis-1.4.12/Makefile

configure.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ AC_SUBST(RPATH)
6464
AC_SUBST(MSL_EXTRA_ARGS)
6565
AC_SUBST(WITH_HWLOC)
6666
AC_SUBST(OS_TARGET)
67+
AC_SUBST(LIS_LDFLAGS)
6768

6869
FINAL_MESSAGES="\nConfigured OpenModelica successfully using the following options:"
6970

@@ -676,6 +677,7 @@ if test "Darwin" = `uname`; then
676677
RPATH="-Wl,-rpath,'@loader_path/../lib/omc'"
677678
MSL_EXTRA_ARGS="--disable-hdf5 --enable-static-zlib --enable-static --disable-shared"
678679
OS_TARGET="osx"
680+
LIS_LDFLAGS="-Wl,-install_name,@rpath/liblis.dylib"
679681
else
680682
EXE=""
681683
SHREXT=".so"

0 commit comments

Comments
 (0)