Skip to content

Commit

Permalink
Use dynamic FMI library. Still keeping C-runtime static because other…
Browse files Browse the repository at this point in the history
…wise the fmi library cannot read strings...

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17128 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 7, 2013
1 parent a949c35 commit 2ca88f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ runtimeCPPclean:
fmil:
test -d 3rdParty/FMIL
mkdir -p 3rdParty/FMIL/build
(cd 3rdParty/FMIL/build && test -f Makefile || CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -D FMILIB_BUILD_SHARED_LIB:Bool=OFF -D FMILIB_BUILD_TESTS:Bool=OFF -D FMILIB_GENERATE_DOXYGEN_DOC:Bool=OFF -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DFMILIB_INSTALL_PREFIX:String=../install .. -G $(CMAKE_TARGET))
test -f 3rdParty/FMIL/build/libfmilib.a || $(MAKE) -C 3rdParty/FMIL/build
(cd 3rdParty/FMIL/build && test -f Makefile || CFLAGS="$(CFLAGS) -g" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -D FMILIB_BUILD_SHARED_LIB:Bool=ON -D FMILIB_BUILD_TESTS:Bool=OFF -D FMILIB_GENERATE_DOXYGEN_DOC:Bool=OFF -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DFMILIB_INSTALL_PREFIX:String=../install .. -G $(CMAKE_TARGET))
test -f 3rdParty/FMIL/build/$(LIBFMILIB) || $(MAKE) -C 3rdParty/FMIL/build
test -d 3rdParty/FMIL/install || $(MAKE) -C 3rdParty/FMIL/build install
cp -p 3rdParty/FMIL/install/lib/libfmilib.a $(builddir_lib)/omc/
test ! -f 3rdParty/FMIL/build/libfmilib_shared.so || cp -up 3rdParty/FMIL/build/libfmilib_shared.so 3rdParty/FMIL/build/libfmilib.so
cp -p 3rdParty/FMIL/build/$(LIBFMILIB) $(builddir_lib)/omc/
#TODO: Only copy required headers, add them in omc/fmi subfolder, and do not copy c/txt-files
#cp -rp 3rdParty/FMIL/install/include/* $(builddir_inc)

Expand Down
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CXXFLAGS=@CXXFLAGS@
LINK=@LINK@
MSL_EXTRA_ARGS=@MSL_EXTRA_ARGS@
GC_THREADS=--enable-threads=posix
LIBFMILIB=@LIBFMILIB@

include Makefile.common

Expand Down
9 changes: 6 additions & 3 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ AC_SUBST(LIBGC)
AC_SUBST(LIBSIMULATION)
AC_SUBST(LIBRUNTIME)
AC_SUBST(LIBFMIRUNTIME)
AC_SUBST(LIBFMILIB)
AC_SUBST(SHREXT)
AC_SUBST(LINK)
AC_SUBST(RPATH)
Expand Down Expand Up @@ -674,7 +675,8 @@ if test "Darwin" = `uname`; then
LIBSIMULATION=libSimulationRuntimeC.a
LIBRUNTIME=libOpenModelicaRuntimeC.a
LIBFMIRUNTIME=libOpenModelicaFMIRuntimeC.a
RT_LDFLAGS="$RT_LDFLAGS -liconv -lgc $OPENMP"
LIBFMILIB=libfmilib.a
RT_LDFLAGS="$RT_LDFLAGS -liconv -lgc -lexpat $OPENMP"
LINK="cp -fr"
RPATH="-Wl,-rpath,'@loader_path/../lib/omc'"
MSL_EXTRA_ARGS="--disable-hdf5 --enable-static-zlib --enable-static --disable-shared"
Expand All @@ -686,8 +688,9 @@ else
LIBGC="build/lib/omc/libgc.so"
LIBSIMULATION=libSimulationRuntimeC.a
LIBRUNTIME=libOpenModelicaRuntimeC.so
LIBFMIRUNTIME=libOpenModelicaFMIRuntimeC.a
RT_LDFLAGS="$RT_LDFLAGS -lrt -lgc $OPENMP"
LIBFMIRUNTIME=libOpenModelicaFMIRuntimeC.so
LIBFMILIB=libfmilib.so
RT_LDFLAGS="$RT_LDFLAGS -lrt -lgc -lexpat $OPENMP"
LINK="cp -frl"
RPATH="-Wl,-rpath,'\$\$ORIGIN/../lib/omc'"
OS_TARGET="linux"
Expand Down

0 comments on commit 2ca88f6

Please sign in to comment.