bugGNU Octave - Bugs: bug #47212, Faddeeva build failure: need...

 
 

bug #47212: Faddeeva build failure: need better configure test for std::isinf / std::isnan

Submitter:  None
Submitted:  Sun 21 Feb 2016 02:16:12 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 23 Mar 2016 06:23:42 AM UTC, comment #6: 

I fixed this in a slightly different way on the default branch here:

http://hg.savannah.gnu.org/hgweb/octave/rev/ffbd3e86e0be

If this doesn't fix the problem for you let us know on this bug report.

Mike Miller <mtmiller>
Group Member
Fri 04 Mar 2016 01:37:33 AM UTC, comment #5: 

No build failures now! Thank you Mike!

There are still the unrelated failures related to inf and nan described in bug #47214, but if not many users have old compilers, that can be downgraded at your discretion.

Anonymous
Thu 03 Mar 2016 09:52:58 PM UTC, comment #4: 

Can you please try the attached patch? The configure tests have actually already been in place for quite a while, but Fadeeva uses its own faulty logic. Let me know if this patch allows you to compile with gcc 4.6 (you shouldn't have to run configure again, just patch and make if you have an already partially-built tree).

(file #36538)

Mike Miller <mtmiller>
Group Member
Thu 03 Mar 2016 05:56:58 PM UTC, comment #3: 

Yes, the intention is to use std::isinf and std::isnan when building under C++11, see

http://hg.savannah.gnu.org/hgweb/octave/file/0196666bf900/liboctave/cruft/Faddeeva/Faddeeva.cc#l184

The way it tells that the compiler is building to the C++11 standard is by the value of the __cplusplus macro. Unfortunately, gcc 4.6 doesn't do this correctly (probably because it was still early in the development to the standard).

With gcc 4.6 on Ubuntu 12.04:


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
$ gcc -x c++ -dM -E <(:) | grep __cplusplus
#define __cplusplus 1
$ gcc -x c++ -std=gnu++0x -dM -E <(:) | grep __cplusplus
#define __cplusplus 1


These macros are supposed to be


$ gcc -x c++ -dM -E <(:) | grep __cplusplus
#define __cplusplus 199711L
$ gcc -x c++ -std=gnu++11 -dM -E <(:) | grep __cplusplus
#define __cplusplus 201103L


So the logic in Fadeeva.cc is failing here. I think this could actually be improved by checking for std::isinf and std::isnan in configure rather than relying on the C++ version.

Mike Miller <mtmiller>
Group Member
Sun 21 Feb 2016 05:29:02 PM UTC, comment #2: 

Thanks for the report. I also see that you are building with gcc 4.6, which may be partially to blame. There may have been fixes to the libstdc++ headers that are relevant to this resolution error. I don't see any build errors with gcc 5.3.1.

We may still want to make this change to accomodate older compilers.

Mike Miller <mtmiller>
Group Member
Sun 21 Feb 2016 02:27:07 PM UTC, comment #1: 

Changing isnan and isinf to std::isnan and std::isinf in Fadeeva.cc solves the build problem.

Please verify that the semantics are equivalent.

Anonymous
Sun 21 Feb 2016 02:16:12 PM UTC, original submission:  

This may be a namespace side-effect of the move to C++11. An overloaded function "isnan(double&)" in Faddeeva is ambiguous and is mapped to the wrong function.

Could the authors of Faddeeva specify the namespace to be used for isnan? Is it std::isnan?


/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../octave  -I../octave/liboctave/array -I../octave/liboctave/cruft/misc -Iliboctave/numeric -I../octave/liboctave/numeric -Iliboctave/operators -I../octave/liboctave/operators -I../octave/liboctave/system -I../octave/liboctave/util -Ilibgnu -I../octave/libgnu -I/usr/local/ATLAS/include -I/usr/local/include -I/usr/include -fopenmp -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -std=c++0x  -Wall -O3 -pipe -pthread -fopenmp -s -MT liboctave/cruft/Faddeeva/liboctave_cruft_libcruft_la-Faddeeva.lo -MD -MP -MF liboctave/cruft/Faddeeva/.deps/liboctave_cruft_libcruft_la-Faddeeva.Tpo -c -o liboctave/cruft/Faddeeva/liboctave_cruft_libcruft_la-Faddeeva.lo `test -f 'liboctave/cruft/Faddeeva/Faddeeva.cc' || echo '../octave/'`liboctave/cruft/Faddeeva/Faddeeva.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../octave -I../octave/liboctave/array -I../octave/liboctave/cruft/misc -Iliboctave/numeric -I../octave/liboctave/numeric -Iliboctave/operators -I../octave/liboctave/operators -I../octave/liboctave/system -I../octave/liboctave/util -Ilibgnu -I../octave/libgnu -I/usr/local/ATLAS/include -I/usr/local/include -I/usr/include -fopenmp -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -std=c++0x  -Wall -O3 -pipe -pthread -fopenmp -s -MT liboctave/cruft/Faddeeva/liboctave_cruft_libcruft_la-Faddeeva.lo -MD -MP -MF liboctave/cruft/Faddeeva/.deps/liboctave_cruft_libcruft_la-Faddeeva.Tpo -c ../octave/liboctave/cruft/Faddeeva/Faddeeva.cc  -fPIC -DPIC -o liboctave/cruft/Faddeeva/.libs/liboctave_cruft_libcruft_la-Faddeeva.o
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc: In function 'cmplx Faddeeva::erf(cmplx, double)':
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:355:21: error: call of overloaded 'isnan(double&)' is ambiguous
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:355:21: note: candidates are:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:236:1: note: int isnan(double)
/usr/include/c++/4.6/cmath:552:3: note: bool std::isnan(long double)
/usr/include/c++/4.6/cmath:548:3: note: bool std::isnan(double)
/usr/include/c++/4.6/cmath:544:3: note: bool std::isnan(float)
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc: In function 'cmplx Faddeeva::Dawson(cmplx, double)':
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:521:21: error: call of overloaded 'isnan(double&)' is ambiguous
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:521:21: note: candidates are:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:236:1: note: int isnan(double)
/usr/include/c++/4.6/cmath:552:3: note: bool std::isnan(long double)
/usr/include/c++/4.6/cmath:548:3: note: bool std::isnan(double)
/usr/include/c++/4.6/cmath:544:3: note: bool std::isnan(float)
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc: In function 'cmplx Faddeeva::w(cmplx, double)':
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:740:26: error: call of overloaded 'isinf(const double&)' is ambiguous
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:740:26: note: candidates are:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:203:1: note: int isinf(double)
/usr/include/c++/4.6/cmath:534:3: note: bool std::isinf(long double)
/usr/include/c++/4.6/cmath:530:3: note: bool std::isinf(double)
/usr/include/c++/4.6/cmath:526:3: note: bool std::isinf(float)
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:741:27: error: call of overloaded 'isnan(const double&)' is ambiguous
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:741:27: note: candidates are:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:236:1: note: int isnan(double)
/usr/include/c++/4.6/cmath:552:3: note: bool std::isnan(long double)
/usr/include/c++/4.6/cmath:548:3: note: bool std::isnan(double)
/usr/include/c++/4.6/cmath:544:3: note: bool std::isnan(float)
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:821:16: error: call of overloaded 'isnan(const double&)' is ambiguous
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:821:16: note: candidates are:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:236:1: note: int isnan(double)
/usr/include/c++/4.6/cmath:552:3: note: bool std::isnan(long double)
/usr/include/c++/4.6/cmath:548:3: note: bool std::isnan(double)
/usr/include/c++/4.6/cmath:544:3: note: bool std::isnan(float)
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:925:16: error: call of overloaded 'isnan(const double&)' is ambiguous
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:925:16: note: candidates are:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:236:1: note: int isnan(double)
/usr/include/c++/4.6/cmath:552:3: note: bool std::isnan(long double)
/usr/include/c++/4.6/cmath:548:3: note: bool std::isnan(double)
/usr/include/c++/4.6/cmath:544:3: note: bool std::isnan(float)
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:927:16: error: call of overloaded 'isnan(const double&)' is ambiguous
../octave/liboctave/cruft/Faddeeva/Faddeeva.cc:927:16: note: candidates are:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:236:1: note: int isnan(double)
/usr/include/c++/4.6/cmath:552:3: note: bool std::isnan(long double)
/usr/include/c++/4.6/cmath:548:3: note: bool std::isnan(double)
/usr/include/c++/4.6/cmath:544:3: note: bool std::isnan(float)
make[2]: *** [liboctave/cruft/Faddeeva/liboctave_cruft_libcruft_la-Faddeeva.lo] Error 1


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #36538:  bug47212.diff added by mtmiller (1KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-23 mtmiller StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-03-03 mtmiller Attached File- Added bug47212.diff, #36538
        StatusConfirmed Patch Submitted
    2016-03-03 mtmiller StatusNone Confirmed
        SummaryFaddeeva build failure due to unresolved namespace Faddeeva build failure: need better configure test for std::isinf / std::isnan

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code