From ec6b4feddda745b9137e956e983c539cc625ffa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Mon, 2 Sep 2013 14:44:57 +0000 Subject: [PATCH] Fixes for lis compilation on Linux git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17028 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Makefile.common | 16 ++++++++-------- Makefile.in | 16 ++++------------ SimulationRuntime/c/Makefile.common | 14 +++++++------- 3 files changed, 19 insertions(+), 27 deletions(-) diff --git a/Makefile.common b/Makefile.common index 905a4429983..b1125430f8e 100644 --- a/Makefile.common +++ b/Makefile.common @@ -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) @@ -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) diff --git a/Makefile.in b/Makefile.in index 5a48ccfffd9..d9134f18fe0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/SimulationRuntime/c/Makefile.common b/SimulationRuntime/c/Makefile.common index 05862b81fdd..f16336b17ac 100644 --- a/SimulationRuntime/c/Makefile.common +++ b/SimulationRuntime/c/Makefile.common @@ -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