From 5aa810ed4958f6b00d5c7714f1bcb0db1c8a0bee Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Mon, 5 Nov 2012 18:45:02 +0000 Subject: [PATCH] Complete rely on pkg-config to figure out the correct flags for ipopt. Previously parts of the flags were hand-coded in ipopt.m4. That lead to difficult-to-interpret compiler, linker, and run-time bugs. Taking everything from pkg-config makes these issues go away. Touch wood. One consequene is that the include paths into IPOpt need to change. But that shouldn't really regard anyone but me. [[Imported from SVN: r7295]] --- dune/solvers/solvers/quadraticipopt.hh | 4 ++-- m4/ipopt.m4 | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dune/solvers/solvers/quadraticipopt.hh b/dune/solvers/solvers/quadraticipopt.hh index b1b2732a..f91600a8 100644 --- a/dune/solvers/solvers/quadraticipopt.hh +++ b/dune/solvers/solvers/quadraticipopt.hh @@ -19,8 +19,8 @@ #include <dune/solvers/common/canignore.hh> #include <dune/solvers/solvers/iterativesolver.hh> -#include "coin/IpTNLP.hpp" -#include "coin/IpIpoptApplication.hpp" +#include "IpTNLP.hpp" +#include "IpIpoptApplication.hpp" /** \brief Implementation class used to pipe quadratic problems to the IPOpt interior-point solver diff --git a/m4/ipopt.m4 b/m4/ipopt.m4 index 3255ba32..5a167ae0 100644 --- a/m4/ipopt.m4 +++ b/m4/ipopt.m4 @@ -38,13 +38,11 @@ AS_IF([test x$with_ipopt != xno], [ AC_MSG_WARN([IPOpt not found in $IPOPTROOT]) ]) - dnl FIXME: We have two problems with the information provided by pkg-config: - dnl (1) What we would expect in IPOPT_CPPFLAGS (namely, -I<path>) - dnl ends up in IPOPT_CFLAGS with ipopt 3.10.1 - dnl (2) IPOPT_CFLAGS contain -I<prefix>/include/coin rather than - dnl -I<prefix>/include. We currently include <coin/..> everywhere. - IPOPT_CPPFLAGS="-I$IPOPTROOT/include" - + dnl For some strange reason, PKG_CHECK_MODULES puts the stuff we would expect + dnl in IPOPT_CPPFLAGS (namely, -I<path>)in IPOPT_CFLAGS with ipopt 3.10.1. + dnl We therefore copy it by hand + IPOPT_CPPFLAGS="$IPOPT_CFLAGS" + LDFLAGS="$LDFLAGS $IPOPT_LDFLAGS" CPPFLAGS="$CPPFLAGS $IPOPT_CPPFLAGS" LIBS="$LIBS $IPOPT_LIBS" @@ -54,7 +52,7 @@ AS_IF([test x$with_ipopt != xno], [ # if header is found... AS_IF([test x$HAVE_IPOPT = x1], [ AC_LINK_IFELSE([AC_LANG_PROGRAM( - [#include "coin/IpIpoptApplication.hpp"], + [#include "IpIpoptApplication.hpp"], [Ipopt::SmartPtr<Ipopt::IpoptApplication> app = new Ipopt::IpoptApplication();])], [], [HAVE_IPOPT="0" -- GitLab