Skip to content
Snippets Groups Projects
Commit ccc989e7 authored by Elias Pipping's avatar Elias Pipping Committed by pipping
Browse files

Add and use ENABLE_IPOPT

Ipopt is now no longer automatically enabled when found, while
any program that is passed IPOPT_CPPFLAGS will continue to use it.

[[Imported from SVN: r12962]]
parent fd8af5e9
Branches
Tags
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <dune/solvers/computeenergy.hh> #include <dune/solvers/computeenergy.hh>
#ifdef HAVE_IPOPT #if HAVE_IPOPT
#include <dune/solvers/solvers/quadraticipopt.hh> #include <dune/solvers/solvers/quadraticipopt.hh>
#endif #endif
...@@ -37,7 +37,7 @@ preprocess() ...@@ -37,7 +37,7 @@ preprocess()
dynamic_cast<SmootherType*>(loopBaseSolver->iterationStep_)->hasObstacle_ = &(*hasObstacle_)[0]; dynamic_cast<SmootherType*>(loopBaseSolver->iterationStep_)->hasObstacle_ = &(*hasObstacle_)[0];
dynamic_cast<SmootherType*>(loopBaseSolver->iterationStep_)->obstacles_ = &(*obstacles_)[0]; dynamic_cast<SmootherType*>(loopBaseSolver->iterationStep_)->obstacles_ = &(*obstacles_)[0];
#ifdef HAVE_IPOPT #if HAVE_IPOPT
} else if (typeid(*this->basesolver_) == typeid(QuadraticIPOptSolver<MatrixType,VectorType>)) { } else if (typeid(*this->basesolver_) == typeid(QuadraticIPOptSolver<MatrixType,VectorType>)) {
QuadraticIPOptSolver<MatrixType,VectorType>* ipoptBaseSolver = dynamic_cast<QuadraticIPOptSolver<MatrixType,VectorType>*> (this->basesolver_); QuadraticIPOptSolver<MatrixType,VectorType>* ipoptBaseSolver = dynamic_cast<QuadraticIPOptSolver<MatrixType,VectorType>*> (this->basesolver_);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <dune/solvers/common/genericvectortools.hh> #include <dune/solvers/common/genericvectortools.hh>
#include "blockgsstep.hh" #include "blockgsstep.hh"
#ifdef HAVE_IPOPT #if HAVE_IPOPT
#include <dune/solvers/solvers/quadraticipopt.hh> #include <dune/solvers/solvers/quadraticipopt.hh>
#endif #endif
...@@ -166,7 +166,7 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess() ...@@ -166,7 +166,7 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess()
dynamic_cast<SmootherType*>(loopBaseSolver->iterationStep_)->ignoreNodes_ = ignoreNodesHierarchy_[0]; dynamic_cast<SmootherType*>(loopBaseSolver->iterationStep_)->ignoreNodes_ = ignoreNodesHierarchy_[0];
} }
#ifdef HAVE_IPOPT #if HAVE_IPOPT
else if (typeid(*this->basesolver_) == typeid(QuadraticIPOptSolver<MatrixType,VectorType>)) { else if (typeid(*this->basesolver_) == typeid(QuadraticIPOptSolver<MatrixType,VectorType>)) {
QuadraticIPOptSolver<MatrixType,VectorType>* ipoptBaseSolver = dynamic_cast<QuadraticIPOptSolver<MatrixType,VectorType>*> (this->basesolver_); QuadraticIPOptSolver<MatrixType,VectorType>* ipoptBaseSolver = dynamic_cast<QuadraticIPOptSolver<MatrixType,VectorType>*> (this->basesolver_);
......
...@@ -42,7 +42,7 @@ AS_IF([test x$with_ipopt != xno], [ ...@@ -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 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 in IPOPT_CPPFLAGS (namely, -I<path>)in IPOPT_CFLAGS with ipopt 3.10.1.
dnl We therefore copy it by hand dnl We therefore copy it by hand
IPOPT_CPPFLAGS="$IPOPT_CFLAGS" IPOPT_CPPFLAGS="$IPOPT_CFLAGS -DENABLE_IPOPT"
LDFLAGS="$LDFLAGS $IPOPT_LDFLAGS" LDFLAGS="$LDFLAGS $IPOPT_LDFLAGS"
CPPFLAGS="$CPPFLAGS $IPOPT_CPPFLAGS" CPPFLAGS="$CPPFLAGS $IPOPT_CPPFLAGS"
...@@ -56,7 +56,7 @@ AS_IF([test x$HAVE_IPOPT = x1], [ ...@@ -56,7 +56,7 @@ AS_IF([test x$HAVE_IPOPT = x1], [
AC_SUBST(IPOPT_LIBS, $IPOPT_LIBS) AC_SUBST(IPOPT_LIBS, $IPOPT_LIBS)
AC_SUBST(IPOPT_LDFLAGS, $IPOPT_LDFLAGS) AC_SUBST(IPOPT_LDFLAGS, $IPOPT_LDFLAGS)
AC_SUBST(IPOPT_CPPFLAGS, $IPOPT_CPPFLAGS) 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 # add to global list
DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $IPOPT_LDFLAGS" DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $IPOPT_LDFLAGS"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment