[OS-tickets] [Optimization Services] #3: Problem compiling on AIX (CppAD trouble?)

Optimization Services coin-trac at coin-or.org
Fri Aug 10 12:53:44 EDT 2007


#3: Problem compiling on AIX (CppAD trouble?)
------------------------+---------------------------------------------------
 Reporter:  andreasw    |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  major       |   Milestone:          
Component:  component1  |     Version:          
 Keywords:              |  
------------------------+---------------------------------------------------
 I'm trying to compile on AIX (IBM's xlC compiler).

 The first set of problems comes in because CppAD is using the identifiers
 "isfinite" and "isnan", which on AIX is the name of preprocessor macros,
 defined in /usr/include/math.h.  I got around this problem buy renaming
 "isfinite" and "isnan" in CppAD's near_equal.hpp and nan.hpp.  But maybe
 the issue is related that you use <math.h> in C++ code, whereas the C++
 standard says you should use <cmath>.  In Ipopt, I check for each C header
 if the C++ version is there, and if not, if the C version is there, and
 include the files accordingly.  There is macro for testing in coin.m4.  In
 Ipopt's configure.ac I use:

 {{{
 AC_COIN_CHECK_CXX_CHEADER(math)
 }}}

 and then the source code has:

 {{{
 #ifdef HAVE_CMATH
 # include <cmath>
 #else
 # ifdef HAVE_MATH_H
 #  include <math.h>
 # else
 #  error "don't have header file for math"
 # endif
 #endif
 }}}

 Once I'm able to get through that point, I get tons of error messages like
 the following:

 {{{
 "/u/andreasw/home4/COIN-svn/CoinAll/branches/all-
 trunk/cppad/../cppad/local/std_math_unary.hpp", line 322.9: 1540-0215 (S)
 The wrong number of arguments have been specified for
 "CppAD::AD<double>::cos() const".
 "/u/andreasw/home4/COIN-svn/CoinAll/branches/all-
 trunk/cppad/../cppad/local/std_math_unary.hpp", line 322.9: 1540-0700 (I)
 The previous message was produced while processing
 "CppAD::AD<double>::cos() const".
 "/u/andreasw/home4/COIN-svn/CoinAll/branches/all-
 trunk/cppad/../cppad/local/std_math_unary.hpp", line 322.9: 1540-0700 (I)
 The previous message was produced while processing
 "CppAD::cos<double>(const AD<double> &)".
 "../../../../../../../CoinAll/branches/all-
 trunk/OS/src/OSCommonInterfaces/OSnLNode.cpp", line 1157.23: 1540-0700 (I)
 The previous message was produced while processing
 "OSnLNodeCos::constructCppADTape(std::map<int,int,std::less<int>,std::allocator<std::pair<const
 int,int> > > *, CppAD::vector<CppAD::AD<double> > *)".
 }}}

-- 
Ticket URL: <https://projects.coin-or.org/OS/ticket/3>
Optimization Services <http://projects.coin-or.org/OS>
An interface for Web services implementing optimization.



More information about the OS-tickets mailing list