[gdal-dev] fail to building GDAL in AIX 7.1
Even Rouault
even.rouault at spatialys.com
Sun Feb 7 00:29:34 PST 2016
Le vendredi 05 février 2016 20:24:06, Ivan Lucena a écrit :
> I am getting this error:
>
>
> /usr/local/remote/packages/gcc_remote/4.2.1/bin/../lib/gcc/powerpc-ibm-aix5
> .2.0.0/4.2.1/../../../../include/c++/4.2.1/cmath:447: error: 'long double
> std::tanh(long double)' conflicts with previous using declaration 'long
> double tanh(long double)' gdalwarpkernel.cpp: In function 'void
> GWKAverageOrModeThread(void*)': gdalwarpkernel.cpp:5017: error: call of
> overloaded 'ceil(float)' is ambiguous /usr/include/math.h:975: note:
> candidates are: long double ceil(long double) /usr/include/math.h:945:
> note: float ceil(float)
> /usr/include/math.h:345: note: double ceil(double)
>
>
> I don't get this error when building with gcc 4.7.1 in a Linux 64 Intel
> environment.
>
>
> Is this error related to the gcc version or AIX? Any suggestions?
Perhaps some incompatibility betwenn GCC cmath header and
AIX /usr/include/math.h ?
You could try removing #include <cmath> in that file and replacing
the use of std::ceil() with just ceil(). This still builds on x86 :
Index: alg/gdalwarpkernel.cpp
===================================================================
--- alg/gdalwarpkernel.cpp (revision 33113)
+++ alg/gdalwarpkernel.cpp (working copy)
@@ -32,7 +32,6 @@
#include <vector>
#include <algorithm>
-#include <cmath>
#include <cfloat>
#include "gdalwarper.h"
#include "gdal_alg_priv.h"
@@ -5014,7 +5013,7 @@
if ( nCount > 0 )
{
std::sort(dfValuesTmp.begin(), dfValuesTmp.end());
- int quantIdx = std::ceil(quant * dfValuesTmp.size() - 1);
+ int quantIdx = ceil(quant * dfValuesTmp.size() - 1);
dfValueReal = dfValuesTmp[quantIdx];
dfBandDensity = 1;
But this is a sign that the compilation environment is not sane and you
may have other issues elsewhere, and you'd likely get even more problems with trunk
gcc 4.2 is very ancient. Perhaps you need to upgrade to a more recent version
to get it working on AIX. Looking at
http://www.perzl.org/aix/index.php?n=Main.Gcc , gcc 4.2 & AIX 7.1 doesn't look as a
supported combination (at least not by this site)
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list