[gdal-dev] Building gdal 1.9.1 on AIX with

chen zhen zhenchen17 at gmail.com
Thu Aug 30 22:01:53 PDT 2012


Hi All,

I met a compile problem when trying to build gdal 1.9.1 on AIX
platform with xlc toolset. Here is the compile log:

-----------------------------------------------------------------------------------------------------------------------------------------------------
make[2]: Entering directory `/home/sdb/BeyonDB_20/ads_3rlib/gdal/frmts/ers'
/bin/sh /home/sdb/BeyonDB_20/ads_3rlib/gdal/libtool --mode=compile
--tag=CXX xlc_r -q32 -q32  -Wall
-I/home/sdb/BeyonDB_20/ads_3rlib/gdal/port
-I/home/sdb/BeyonDB_20/ads_3rlib/gdal/gcore
-I/home/sdb/BeyonDB_20/ads_3rlib/gdal/alg
-I/home/sdb/BeyonDB_20/ads_3rlib/gdal/ogr
-I/home/sdb/BeyonDB_20/ads_3rlib/gdal/ogr/ogrsf_frmts -I../raw
-DOGR_ENABLED -I/home/sdb/BeyonDB_20/ads_3rlib/gdal/port
-I/home/sdb/BeyonDB_20/ads_3rlib/jpeg/temp
-I/home/sdb/BeyonDB_20/ads_3rlib/jpeg/temp/include
-I/home/sdb/BeyonDB_20/ads_3rlib/zlib/temp
-I/home/sdb/BeyonDB_20/ads_3rlib/zlib/temp/include  -c -o
../o/ersdataset.lo ersdataset.cpp
libtool: compile:  xlc_r -q32 -q32 -Wall
-I/home/sdb/BeyonDB_20/ads_3rlib/gdal/port
-I/home/sdb/BeyonDB_20/ads_3rlib/gdal/gcore
-I/home/sdb/BeyonDB_20/ads_3rlib/gdal/alg
-I/home/sdb/BeyonDB_20/ads_3rlib/gdal/ogr
-I/home/sdb/BeyonDB_20/ads_3rlib/gdal/ogr/ogrsf_frmts -I../raw
-DOGR_ENABLED -I/home/sdb/BeyonDB_20/ads_3rlib/gdal/port
-I/home/sdb/BeyonDB_20/ads_3rlib/jpeg/temp
-I/home/sdb/BeyonDB_20/ads_3rlib/jpeg/temp/include
-I/home/sdb/BeyonDB_20/ads_3rlib/zlib/temp
-I/home/sdb/BeyonDB_20/ads_3rlib/zlib/temp/include -c ersdataset.cpp
-o ../o/ersdataset.o
xlc_r: 1501-289 (W) Option -Wall was incorrectly specified. The option
will be ignored.
"ersdataset.cpp", line 690.41: 1540-0207 (S) No common type found for
operands with type "CPLString" and "const char [4]".
"ersdataset.cpp", line 691.42: 1540-0207 (S) No common type found for
operands with type "CPLString" and "const char [6]".
"ersdataset.cpp", line 692.42: 1540-0207 (S) No common type found for
operands with type "CPLString" and "const char [7]".
"ersdataset.cpp", line 1048.51: 1540-0207 (S) No common type found for
operands with type "CPLString" and "const char [4]".
"ersdataset.cpp", line 1049.52: 1540-0207 (S) No common type found for
operands with type "CPLString" and "const char [6]".
"ersdataset.cpp", line 1050.52: 1540-0207 (S) No common type found for
operands with type "CPLString" and "const char [7]".
make[2]: *** [../o/ersdataset.lo] Error 1
make[2]: Leaving directory `/home/sdb/BeyonDB_20/ads_3rlib/gdal/frmts/ers'
-------------------------------------------------------------------------------------------------------------------------------------------------------

the correspond source code in ersdataset.cpp is :
-------------------------------------------------------------------------------------------------------------------------------------------------------
    oSRS.importFromERM( osProj.size() ? osProj : "RAW",
                        osDatum.size() ? osDatum : "WGS84",
                        osUnits.size() ? osUnits : "METERS" );
-------------------------------------------------------------------------------------------------------------------------------------------------------

It seems the compiler can't convert a CPLString to a const char []
format. However there is a cast operator in CPLString declaration:

------------------------------------------------------------------------------------------------------------------------------------------------------

    operator const char* (void) const { return c_str(); }
------------------------------------------------------------------------------------------------------------------------------------------------------

I am not sure why the xlc compiler can't recognize this cast
operation, maybe it think const char [] and   const char * are
different?

 I modified the source code a bit which does an explicit cast, it at
least passed the compiling.

-------------------------------------------------------------------------------------------------------------------------------------------------------
    oSRS.importFromERM( osProj.size() ? (const char *)osProj : "RAW",
                        osDatum.size() ? (const char *)osDatum : "WGS84",
                        osUnits.size() ? (const char *)osUnits : "METERS" );
-------------------------------------------------------------------------------------------------------------------------------------------------------

I  am looking for if there is any way working around this issue(such
as adding a compile parameter to xlc) or should this be a patch that
mkes gdal playing will on AIX?

Regards,

zhen


More information about the gdal-dev mailing list