Skip to content

Commit

Permalink
- Compile our own version of Ipopt (EPL 1.0 license; compatible with …
Browse files Browse the repository at this point in the history
…LGPL)

- Fix copying of messages from the OMEdit widget


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18172 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 18, 2013
1 parent de93785 commit 82c60ee
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 29 deletions.
4 changes: 4 additions & 0 deletions COPYING
Expand Up @@ -287,6 +287,8 @@ OpenModelica source distribution if the sources were used.
[LGPL 2.1] Full text might be in the file '/usr/share/common-licenses/LGPL-2.1',
or online http://opensource.org/licenses/LGPL-2.1.

[PD] Public Domain

[BSD] ANTLR3 Copyright (c) 2005-2008 Terence Parr
[BSD] Maven Plugin Copyright (c) 2009 Jim Idle
[BSD] FMILIB Copyright (c) 2012 Modelon AB
Expand All @@ -298,6 +300,8 @@ or online http://opensource.org/licenses/LGPL-2.1.
[BSD-1] Copyright (c) 2005-2013, Troy D. Hanson http://troydhanson.github.com/uthash/
[LGPL 2.1] lpsolve55
[Public Domain] sqlite3
[EPL] ipopt (c) 2003-2013 International Business Machines and others
[PD] MUMPS

[BSD-like] Minpack Copyright Notice (1999) University of Chicago. All rights reserved
This product includes software developed by the University of Chicago,
Expand Down
14 changes: 13 additions & 1 deletion 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 lis $(LAPACK_TARGET)
interactive: .testvariables mkbuilddirs boehm-gc fmil msl-external-libs lis ipopt
$(MAKE) -C SimulationRuntime/interactive -f $(defaultMakefileTarget)
# Depends on libinteractive.a
$(MAKE) -C SimulationRuntime/c -f $(defaultMakefileTarget)
Expand Down Expand Up @@ -85,6 +85,17 @@ build/include/omc/gc_version.h: 3rdParty/gc-7.2/include/gc_version.h mkbuilddirs
3rdParty/gc-7.2/Makefile: 3rdParty/gc-7.2/Makefile.in 3rdParty/gc-7.2/configure
(cd 3rdParty/gc-7.2 && ./configure "--host=$(host)" $(GC_THREADS) --disable-gcj-support --disable-java-finalization --enable-large-config CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) -DTHREAD_LOCAL_ALLOC")

3rdParty/Ipopt-3.11.6/Makefile: $(LAPACK_TARGET)
(cd 3rdParty/Ipopt-3.11.6 && ./configure --with-pic "CC=$(CC)" CXX="$(CXX)" LDFLAGS=-L${abs_top_builddir}/build/lib/omc --with-lapack="$(LD_LAPACK)" --with-blas="")

build/lib/omc/libipopt.la: 3rdParty/Ipopt-3.11.6/Makefile
$(MAKE) -C 3rdParty/Ipopt-3.11.6
$(MAKE) -C 3rdParty/Ipopt-3.11.6 install
cp -pP 3rdParty/Ipopt-3.11.6/lib/*.* build/lib/omc
cp -rp 3rdParty/Ipopt-3.11.6/include/coin build/include/omc

ipopt: build/lib/omc/libipopt.la

build/lib/omc/libopenblas_openmodelica.a:
$(MAKE) -C 3rdParty/OpenBLAS-0.2.8 CC="$(CC)" CXX="$(CXX)" USE_THREAD=0 NO_LAPACKE=1 LIBNAMESUFFIX=openmodelica $(OPENBLAS_EXTRA_ARGS)
$(MAKE) -C 3rdParty/OpenBLAS-0.2.8 PREFIX=${abs_top_builddir}/build OPENBLAS_LIBRARY_DIR=${abs_top_builddir}/build/lib/omc OPENBLAS_INCLUDE_DIR=${abs_top_builddir}/3rdParty/build/install-includes/ NO_LAPACKE=1 LIBNAMESUFFIX=openmodelica install
Expand Down Expand Up @@ -240,6 +251,7 @@ clean: qtclean fmil-clean opencl_rt_clean gc-clean lis-clean
(cd PythonInterface && $(MAKE) -f $(defaultMakefileTarget) clean)
if test -f 3rdParty/modelica3d/build/Makefile; then $(MAKE) -C 3rdParty/modelica3d/build clean; fi
$(MAKE) -C 3rdParty/OpenBLAS-0.2.8 clean
$(MAKE) -C 3rdParty/Ipopt-3.11.6 clean || true
(rm -rf 3rdParty/modelica3d/build)
(rm -rf SimulationRuntime/build_c)
rm -rf build/share build/lib build/include build/bin/OMShell* build/bin/OMNotebook* \
Expand Down
1 change: 1 addition & 0 deletions Makefile.in
Expand Up @@ -29,6 +29,7 @@ LINK=@LINK@
MSL_EXTRA_ARGS=@MSL_EXTRA_ARGS@
GC_THREADS=--enable-threads=posix
LIBFMILIB=@LIBFMILIB@
LD_LAPACK=@LD_LAPACK@
LAPACK_TARGET=@LAPACK_TARGET@
OPENBLAS_EXTRA_ARGS=@OPENBLAS_EXTRA_ARGS@
# We don't want the shared version, but symbols are not exported if we use the static version
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/Makefile.common
Expand Up @@ -6,7 +6,7 @@

include Makefile.objs

CPPFLAGS = -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
CPPFLAGS = -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/ -I$(top_builddir)/3rdParty/Ipopt-3.11.6/include/ $(CONFIG_CPPFLAGS) -DGC_REDIRECT_TO_LOCAL
CFLAGS = $(CPPFLAGS) $(CONFIG_CFLAGS) $(EXTRA_CFLAGS)
CXXFLAGS = $(CFLAGS)
FFLAGS = -O -fexceptions
Expand Down
29 changes: 2 additions & 27 deletions configure.in
Expand Up @@ -389,7 +389,7 @@ fi
fi

# Cannot use AX_LAPACK since it assumes a Fortran compiler is used
AC_ARG_WITH(lapack, [ --with-lapack=[openblas] (use -llapack -lblas to use system-provided version instead of OpenBLAS. Use --with-lapack=openblas-NEHALEM or other OpenBLAS target to compile against a certain architecture)],[LD_LAPACK="$withval"],[LD_LAPACK="openblas"])
AC_ARG_WITH(lapack, [ --with-lapack=[-llapack -lblas] (use -llapack -lblas to use system-provided version instead of OpenBLAS. Use openblas for automatically detected OpenBLAS. Use --with-lapack=openblas-NEHALEM or other OpenBLAS target to compile against a certain architecture)],[LD_LAPACK="$withval"],[LD_LAPACK="-llapack -lblas"])
AC_MSG_CHECKING([LAPACK flags])
if echo "$LD_LAPACK" | grep -oq "^openblas"; then
LD_LAPACK=`echo $LD_LAPACK | sed s/"^openblas-//"`
Expand Down Expand Up @@ -460,35 +460,10 @@ AC_CHECK_LIB(pthread,pthread_self,[RT_LDFLAGS="$RT_LDFLAGS $LIBS"],[AC_MSG_ERROR

LIBS=""

dnl should we use ipopt?

AC_ARG_WITH(ipopt, [ --with-ipopt=DIR use Ipopt for optimization],
[
WANT_IPOPT="$withval"
], [
WANT_IPOPT="yes"
])

if test "$NO_SUNDIALS" = "yes"; then
NO_IPOPT="yes"
elif test "$WANT_IPOPT" = "yes"; then
AC_CHECK_HEADERS(coin/IpStdCInterface.h, [IPOPT_LDFLAGS=`pkg-config --libs ipopt`; IPOPT_CFLAGS=""], [NO_IPOPT="yes"])
elif test "$WANT_IPOPT" = "no"; then
NO_IPOPT="yes"
else
IPOPT_DIR="$withval"
AC_CHECK_HEADERS($IPOPT_DIR/include/coin/IpStdCInterface.h, [AC_MSG_RESULT(ipopt directory: $IPOPT_DIR); IPOPT_LDFLAGS=`PKG_CONFIG_PATH=$IPOPT_DIR/lib/pkgconfig:$PKG_CONFIG_PATH pkg-config --libs ipopt`; IPOPT_CFLAGS="-I'"$IPOPT_DIR"/include'"], [NO_IPOPT="yes"])
fi

if test "$NO_IPOPT" != "yes" -a "$WANT_IPOPT" = "yes"; then
LIBS=$IPOPT_LDFLAGS
AC_SEARCH_LIBS(CreateIpoptProblem,ipopt,,[NO_IPOPT="yes"])
LIBS=""
fi

if ! test "$NO_IPOPT" = "yes"; then
FINAL_MESSAGES="$FINAL_MESSAGES\nSimulations may use IPOPT: Yes"
WITH_IPOPT="#define WITH_IPOPT"
IPOPT_LDFLAGS="-lipopt -lcoinmumps"
else
FINAL_MESSAGES="$FINAL_MESSAGES\nSimulations may use IPOPT: No"
WITH_IPOPT="/* Without IPOPT */"
Expand Down

0 comments on commit 82c60ee

Please sign in to comment.