Skip to content

Commit

Permalink
Fixes for lis compilation on Linux
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17028 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 2, 2013
1 parent 5130739 commit ec6b4fe
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 27 deletions.
16 changes: 8 additions & 8 deletions Makefile.common
Expand Up @@ -46,7 +46,7 @@ install-python:
install-openturns: mkbuilddirs
(time cp SimulationRuntime/OpenTurns/* $(builddir_share)/omc/scripts/OpenTurns/)

interactive: .testvariables mkbuilddirs boehm-gc fmil msl-external-libs
interactive: .testvariables mkbuilddirs boehm-gc fmil msl-external-libs lis
$(MAKE) -C SimulationRuntime/interactive -f $(defaultMakefileTarget)
# Depends on libinteractive.a
$(MAKE) -C SimulationRuntime/c -f $(defaultMakefileTarget)
Expand Down Expand Up @@ -211,13 +211,13 @@ distclean: clean
rm -rf build/
fmil-clean:
rm -rf 3rdParty/FMIL/build 3rdParty/FMIL/install 3rdParty/FMIL/Makefile
gc-clean:
if test -f 3rdParty/gc-7.2/Makefile; then make -C 3rdParty/gc-7.2 clean; fi
rm -f 3rdParty/gc-7.2/Makefile
clean: qtclean fmil-clean opencl_rt_clean gc-clean lis-clean
(cd SimulationRuntime/c && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd SimulationRuntime/interactive && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) clean)
gc-clean:
if test -f 3rdParty/gc-7.2/Makefile; then make -C 3rdParty/gc-7.2 clean; fi
rm -f 3rdParty/gc-7.2/Makefile
clean: qtclean fmil-clean opencl_rt_clean gc-clean lis-clean
(cd SimulationRuntime/c && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd SimulationRuntime/interactive && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler/omc_release && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd mosh/src && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd PythonInterface && $(MAKE) -f $(defaultMakefileTarget) clean)
Expand Down
16 changes: 4 additions & 12 deletions Makefile.in
Expand Up @@ -125,23 +125,15 @@ else
cp -p 3rdParty/modelica3d/backends/osg-gtk/python/dbus-server.py build/lib/omlibrary-modelica3d/osg-gtk/
endif

lis: lis-configure
lis: lis-configure mkbuilddirs
@echo Building Lis from sources
$(MAKE) -C 3rdParty/lis-1.4.12
# Create a SO from the statically linked library, lis provides
cd 3rdParty/lis-1.4.12/src/.libs/ && $(CC) ${LDFLAGS} -fPIC -shared -Wl,-soname="liblis.so.1" -Wl,--whole-archive "liblis.a" -Wl,--no-whole-archive -o liblis.so.1
if ! test -d build/include/; then mkdir -p build/include/; fi
if ! test -d build/lib/; then mkdir -p build/lib/; fi
if test -h build/lib/liblis.so; then rm build/lib/liblis.so; fi
# Copy headers and the library
cp -p 3rdParty/lis-1.4.12/include/lis.h 3rdParty/lis-1.4.12/include/lisf.h 3rdParty/lis-1.4.12/include/lis_config.h build/include/
cp -p 3rdParty/lis-1.4.12/src/.libs/liblis.so.1 build/lib/
ln -s liblis.so.1 build/lib/liblis.so
# Copy the library; not headers (as they are not used by the runtime system)
cp -Pp 3rdParty/lis-1.4.12/src/.libs/liblis@SHREXT@* build/lib/omc/

lis-configure:
# Configure and build lis
if ! test -f 3rdParty/lis-1.4.12/Makefile; then cd 3rdParty/lis-1.4.12 && CFLAGS="$(CFLAGS)" ./configure; fi

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
lis-clean:
if test -f 3rdParty/lis-1.4.12/Makefile; then $(MAKE) -C 3rdParty/lis-1.4.12 clean; fi
rm -f 3rdParty/lis-1.4.12/Makefile
Expand Down
14 changes: 7 additions & 7 deletions SimulationRuntime/c/Makefile.common
Expand Up @@ -3,13 +3,13 @@
# - Please leave the UNIX Makefile as it is if you are not using UNIX/Linux
# If you need to add files, etc, you modify Makefile.common - a common file
# for both UNIX/Linux and Windows platforms.
include Makefile.objs
CPPFLAGS = -g -I. -I$(UTILPATH) -I. -I$(METAPATH) -I$(METAPATH)gc $(LIBF2CINC) -I$(top_builddir)/3rdParty/gc-7.2/include -I$(top_builddir)/3rdParty/FMIL/install/include/ -I$(top_builddir)/build/include $(CONFIG_CPPFLAGS) -DGC_REDIRECT_TO_LOCAL
CFLAGS = $(CPPFLAGS) $(CONFIG_CFLAGS) $(EXTRA_CFLAGS)
CXXFLAGS = $(CFLAGS)
FFLAGS = -O -fexceptions

include Makefile.objs

CPPFLAGS = -g -I. -I$(UTILPATH) -I. -I$(METAPATH) -I$(METAPATH)gc $(LIBF2CINC) -I$(top_builddir)/3rdParty/gc-7.2/include -I$(top_builddir)/3rdParty/FMIL/install/include/ -I$(top_builddir)/3rdParty/lis-1.4.12/include/ $(CONFIG_CPPFLAGS) -DGC_REDIRECT_TO_LOCAL
CFLAGS = $(CPPFLAGS) $(CONFIG_CFLAGS) $(EXTRA_CFLAGS)
CXXFLAGS = $(CFLAGS)
FFLAGS = -O -fexceptions
# P.A: before, g77 had -O3 or -O2 but that caused a bug in DDASRT, giving infinite loop.
builddir = ../../build

Expand Down

0 comments on commit ec6b4fe

Please sign in to comment.