diff --git a/dune/solvers/iterationsteps/mmgstep.cc b/dune/solvers/iterationsteps/mmgstep.cc index dd59802e9e9dcbe7da5a1443790e7002682c5c72..68f9a17c64014cf41eb73340509bdedb57308c1f 100644 --- a/dune/solvers/iterationsteps/mmgstep.cc +++ b/dune/solvers/iterationsteps/mmgstep.cc @@ -4,7 +4,7 @@ #include <dune/solvers/computeenergy.hh> -#ifdef HAVE_IPOPT +#if HAVE_IPOPT #include <dune/solvers/solvers/quadraticipopt.hh> #endif @@ -37,7 +37,7 @@ preprocess() dynamic_cast<SmootherType*>(loopBaseSolver->iterationStep_)->hasObstacle_ = &(*hasObstacle_)[0]; dynamic_cast<SmootherType*>(loopBaseSolver->iterationStep_)->obstacles_ = &(*obstacles_)[0]; -#ifdef HAVE_IPOPT +#if HAVE_IPOPT } else if (typeid(*this->basesolver_) == typeid(QuadraticIPOptSolver<MatrixType,VectorType>)) { QuadraticIPOptSolver<MatrixType,VectorType>* ipoptBaseSolver = dynamic_cast<QuadraticIPOptSolver<MatrixType,VectorType>*> (this->basesolver_); diff --git a/dune/solvers/iterationsteps/multigridstep.cc b/dune/solvers/iterationsteps/multigridstep.cc index 0c2f09f1e8d369bb0ee08a86e2f532352c7dc0fc..890a290b0c006aae53da80ea0ee5031e09f1e70f 100644 --- a/dune/solvers/iterationsteps/multigridstep.cc +++ b/dune/solvers/iterationsteps/multigridstep.cc @@ -5,7 +5,7 @@ #include <dune/solvers/common/genericvectortools.hh> #include "blockgsstep.hh" -#ifdef HAVE_IPOPT +#if HAVE_IPOPT #include <dune/solvers/solvers/quadraticipopt.hh> #endif @@ -166,7 +166,7 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess() dynamic_cast<SmootherType*>(loopBaseSolver->iterationStep_)->ignoreNodes_ = ignoreNodesHierarchy_[0]; } -#ifdef HAVE_IPOPT +#if HAVE_IPOPT else if (typeid(*this->basesolver_) == typeid(QuadraticIPOptSolver<MatrixType,VectorType>)) { QuadraticIPOptSolver<MatrixType,VectorType>* ipoptBaseSolver = dynamic_cast<QuadraticIPOptSolver<MatrixType,VectorType>*> (this->basesolver_); diff --git a/m4/ipopt.m4 b/m4/ipopt.m4 index 2829d00f22aa7ae35b2a3bf72530e2bf9b12635f..985c794d849b118a636431cbf42b931cb84f1df2 100644 --- a/m4/ipopt.m4 +++ b/m4/ipopt.m4 @@ -42,7 +42,7 @@ AS_IF([test x$with_ipopt != xno], [ 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" + IPOPT_CPPFLAGS="$IPOPT_CFLAGS -DENABLE_IPOPT" LDFLAGS="$LDFLAGS $IPOPT_LDFLAGS" CPPFLAGS="$CPPFLAGS $IPOPT_CPPFLAGS" @@ -56,7 +56,7 @@ AS_IF([test x$HAVE_IPOPT = x1], [ AC_SUBST(IPOPT_LIBS, $IPOPT_LIBS) AC_SUBST(IPOPT_LDFLAGS, $IPOPT_LDFLAGS) AC_SUBST(IPOPT_CPPFLAGS, $IPOPT_CPPFLAGS) - AC_DEFINE(HAVE_IPOPT, 1, [Define to 1 if IPOpt library is found]) + AC_DEFINE(HAVE_IPOPT, [ENABLE_IPOPT], [Define to ENABLE_IPOPT if IPOpt library is found]) # add to global list DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $IPOPT_LDFLAGS"