Frank, Thanks.
Another problem. I got the similar situation with this post : http://trac.osgeo.org/gdal/ticket/2375. It is caused by minor difference definition in inttypes.h between Linux( CentOS 6.3 at hand) and AIX (6.1). int32 data type is defined intypes.h on AIX but not on Linux. There is a conflict in shpopen.c by defining int32 by hand. There is no good way tell the platform strictly unless adding preprocessor -DAIX or something like: #ifndef _H_INTTYPES /* inttypes.h macro on AIX compared to _INTTYPES_H on Linux */ .... #endif Any comments? Regards, zhen > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Frank Warmerdam > Sent: Friday, August 31, 2012 2:18 PM > To: [email protected] > Subject: Re: [gdal-dev] Building gdal 1.9.1 on AIX with > > On 12-08-30 10:01 PM, chen zhen wrote: > > 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? > > Zhen, > > I don't know why this confuses xlc but the work around is harmless enough so > please feel free to submit a patch via trac once the build completes > successfully. > > Best regards, > > > -- > ---------------------------------------+-------------------------------- > ---------------------------------------+------ > I set the clouds in motion - turn up | Frank Warmerdam, > [email protected] > light and sound - activate the windows | http://home.gdal.org/warmerda > and watch the world go round - Rush | Geospatial Software Developer > > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
