Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 621810 - sci-libs/gdal-2.0.x: parsing cpl_port.h header with gcc-5 with c++0x / c++11 flag fails due to ambiguous isnan and isinf
Summary: sci-libs/gdal-2.0.x: parsing cpl_port.h header with gcc-5 with c++0x / c++11 ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sci-geo Project
URL: https://trac.osgeo.org/gdal/ticket/6489
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-15 02:40 UTC by Maciej Mrozowski
Modified: 2018-05-06 03:07 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
gdal isnan workaround for gcc-5.4 (gdal-2.0.3-gcc53-isnan.patch,650 bytes, patch)
2017-06-15 02:40 UTC, Maciej Mrozowski
Details | Diff
emerge --info (emerge--info.txt,19.61 KB, text/plain)
2017-06-15 02:41 UTC, Maciej Mrozowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Mrozowski gentoo-dev 2017-06-15 02:40:10 UTC
Created attachment 476512 [details, diff]
gdal isnan workaround for gcc-5.4

Compilation of dev-games/flightgear-2017.2.1 (which enables -std=c++11) with gdal (2.0.2 or 2.0.3) fails:

In file included from /usr/include/gdal/cpl_conv.h:35:0,
                 from /tmp/portage/dev-games/simgear-2017.2.1/work/simgear-2017.2.1/simgear/scene/dem/SGDemTile_gdal.cxx:39:
/tmp/portage/dev-games/simgear-2017.2.1/work/simgear-2017.2.1/simgear/scene/dem/SGDemTile_gdal.cxx: In member function 'void SGDemTile::doWarp(int, char*, GDALDatasetH, char**, char**)':
/usr/include/gdal/cpl_port.h:395:30: error: 'isnan' was not declared in this scope
 #  define CPLIsNan(x) isnan(x)
                              ^
/tmp/portage/dev-games/simgear-2017.2.1/work/simgear-2017.2.1/simgear/scene/dem/SGDemTile_gdal.cxx:547:13: note: in expansion of macro 'CPLIsNan'
         if (CPLIsNan(dfReal))
             ^
/usr/include/gdal/cpl_port.h:395:30: note: suggested alternative:
 #  define CPLIsNan(x) isnan(x)
                              ^
/tmp/portage/dev-games/simgear-2017.2.1/work/simgear-2017.2.1/simgear/scene/dem/SGDemTile_gdal.cxx:547:13: note: in expansion of macro 'CPLIsNan'
         if (CPLIsNan(dfReal))
             ^
In file included from /tmp/portage/dev-games/simgear-2017.2.1/work/simgear-2017.2.1/simgear/constants.h:35:0,
                 from /tmp/portage/dev-games/simgear-2017.2.1/work/simgear-2017.2.1/simgear/math/SGGeod.hxx:21,
                 from /tmp/portage/dev-games/simgear-2017.2.1/work/simgear-2017.2.1/simgear/scene/dem/SGDemTile.hxx:10,
                 from /tmp/portage/dev-games/simgear-2017.2.1/work/simgear-2017.2.1/simgear/scene/dem/SGDemRoot.hxx:5,
                 from /tmp/portage/dev-games/simgear-2017.2.1/work/simgear-2017.2.1/simgear/scene/dem/SGDem.hxx:31,
                 from /tmp/portage/dev-games/simgear-2017.2.1/work/simgear-2017.2.1/simgear/scene/dem/SGDemTile_gdal.cxx:46:
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/cmath:641:5: note:   'std::isnan'
     isnan(_Tp __x)
     ^

This seems to be already resolved upstream in some newer versions (see URL) but I tried that patch and it doesn't work, obviously, since it requires gdal user to define HAVE_CXX11...
So I propose attached patch instead (check GCC and __cplusplus >= 201103L).
Comment 1 Maciej Mrozowski gentoo-dev 2017-06-15 02:41:12 UTC
Created attachment 476514 [details]
emerge --info
Comment 2 Maciej Mrozowski gentoo-dev 2018-05-06 03:07:01 UTC
Fixed with bump to 2.2.3.

https://github.com/gentoo/gentoo/commit/bfe3c66ba7340f890a0d70dc0b1d02a18c4f6668