[ADOL-C] fmax conflict with c++ gcc 4.4.6

Antoine De Blois antoine.deblois at aero.bombardier.com
Mon Apr 22 11:02:22 EDT 2013


Hi Kshitij,

I already use the ADOL-C 2.4.1. My error is in fact with fmax using adouble as arguments. I get the following complaint by the compiler:

/usr/include/c++/4.4.6/tr1_impl/cmath(525): error: no instance of constructor "adub::adub" matches the argument list  argument types are: (adouble)
        return fmax(__type(__x), __type(__y));
                    ^
          detected during instantiation of "__gnu_cxx::__promote_2<_Tp, _Up>::__type std::fmax(_Tp, _Up) [with _Tp=adouble, _Up=adouble]" at line 74

Just so I understand, what was removed exactly in 2.4.1? Because in my adouble.h, fmin and fmax are there (at line 226 to 231).
Regards,
Antoine 

-----Message d'origine-----
De : Kshitij Kulshreshtha [mailto:kshitij at math.upb.de] 
Envoyé : Monday, April 22, 2013 10:54 AM
À : Antoine De Blois
Cc : adol-c at list.coin-or.org
Objet : Re: [ADOL-C] fmax conflict with c++ gcc 4.4.6

fmin/fmax definitions for double type are now standard in all C/C++ compilers that support C99 and C++11 standards. So these have been removed in the latest ADOL-C version 2.4.1. Please use that.

As on 2013-04-22 16:45h, Antoine De Blois did write:
> Hi everyone,
> 
> We recently upgraded our linux cluster from redhat rhel5 to rhel6, which comes with the upgrade gcc 4.4.6. The latter has an fmax function defined in the <cmath>, which results in a conflict with the ADOL-C implementation.
> 
> Has anyone came up with a simple fix for that? I tried to define a new namespace, as follows, without success:
> 
> namespace AD
> {
> template <typename ADdouble1, typename ADdouble2> inline adouble 
> fmax(ADdouble1 a, ADdouble2 b) {
>    return fmax(a,b);
> }
> }
> 
> But when I try to use it, the function get caught into the locint 
> StoreManagerLocintBlock::next_loc()
> 
> of tape_handling.cpp
> 
> and I do not understand why.
> 
> Thank you for your time and efforts,
> Antoine
> 
> _______________________________________________
> ADOL-C mailing list
> ADOL-C at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/adol-c
> 

--
Dr. Kshitij Kulshreshtha

Institut für Mathematik,
Universität Paderborn,
Warburger Straße 100,
33098 Paderborn.

Büro: A3.235

Privatanschrift:
Arnikaweg 62
33100 Paderborn.



More information about the ADOL-C mailing list