Ticket #2375 (new defect)

Opened 2 months ago

Last modified 2 months ago

Error Compiling GDAL-1.5.1 on AIX 5.3

Reported by: tconrad Assigned to: warmerdam
Priority: normal Milestone:
Component: default Version: 1.5.1
Severity: normal Keywords:
Cc:

Description

Hello:

I'm not sure what is causing this error, but here it is:

exec: /usr/vac/exe/xlcentry(/usr/vac/exe/xlcentry,-qlanglvl=extc99,-qcpluscmt,-qkeyword=inline,-qalias=ansi,-D_AIX,-D_AIX32,-D_AIX41,-D_AIX43,-D_AIX50,-D_AIX51,-D_AIX52,-D_AIX53,-D_IBMR2,-D_POWER,-I../../port,-I../libtiff,-DOGR_ENABLED,-I/opt/apps/ots/include,-I/opt/apps/ots/hdf/v4/include,-I/opt/apps/ots/gdal/port,-I/opt/apps/ots/jpeg/jpeg2000,-I/opt/apps/ots/jpeg/jpeg2000/include,-I/opt/apps/ots/netCDF/v3.6.2,-I/opt/apps/ots/netCDF/v3.6.2/include,-D_LARGE_FILES,-DDEBUG,-DPIC,-qosvar=aix.5.3,-qalias=ansi,-q64,-qlargetype,-q64,-qlargetype,-qmaxmem=-1,-qarch=pwr5x,-g,-qasm_as=/bin/as,-qc_stdinc=/usr/vac/include:/usr/include,-qvac_include_path=/usr/vac/include,-o../../o/.libs/xtiff.o,xtiff.c,/tmp/xlcW0KlMgqa,/tmp/xlcW1KoMgqb,/dev/null,/tmp/xlcLKpMgqeF.lst,/dev/null,/tmp/xlcW2KoMgqc,NULL) "../libtiff/tiff.h", line 77.23: 1506-334 (S) Identifier int64 has already been defined on line 622 of "/usr/include/sys/inttypes.h".

I'm compiling gdal-1.5.1 on AIX 5.3 PowerPC_POWER5 architecture. I will attach some log files.

Any help is much appreciated.

---Thanx

---TConrad

Attachments

gmake.out (164.0 kB) - added by tconrad on 05/15/08 15:51:50.
gmake log
configure.out (11.8 kB) - added by tconrad on 05/15/08 15:55:28.
configure log
gmake.out2 (0.5 MB) - added by tconrad on 05/23/08 10:37:52.
Output of second gmake execution.
gmake.out3 (0.7 MB) - added by tconrad on 05/23/08 10:39:58.
Output of third gmake execution.
gmake.out4 (0.7 MB) - added by tconrad on 05/23/08 10:40:53.
Output of fourth gmake execution.

Change History

05/15/08 15:51:50 changed by tconrad

  • attachment gmake.out added.

gmake log

05/15/08 15:55:28 changed by tconrad

  • attachment configure.out added.

configure log

05/18/08 13:13:55 changed by rouault

It looks like on your system int64 type is defined in /usr/include/sys/inttypes.h.

As a workaround, you can probably try to comment the following line in $(GDAL_ROOT)/frmts/gtiff/libtiff/tiff.h:

typedef TIFF_INT64_T  int64;

But a better fix should be found. I see that in standalone libtiff, there is a configure test for int8, int16, int32. Maybe that's somehow related to that ?

05/23/08 10:37:52 changed by tconrad

  • attachment gmake.out2 added.

Output of second gmake execution.

05/23/08 10:39:58 changed by tconrad

  • attachment gmake.out3 added.

Output of third gmake execution.

05/23/08 10:40:53 changed by tconrad

  • attachment gmake.out4 added.

Output of fourth gmake execution.

05/23/08 10:58:00 changed by tconrad

Okay, I commented out the int64 line in $(GDAL_ROOT)/frmts/gtiff/libtiff/tiff.h and re-compiled gdal. Received a different error message (see attached log file gmake.out2):

exec: /usr/vacpp/exe/xlCentry(/usr/vacpp/exe/xlCentry,-D_AIX,-D_AIX32,-D_AIX41,-D_AIX43,-D_AIX50,-D_AIX51,-D_AIX52,-D_AIX53,-D_IBMR2,-D_POWER,-DDEBUG,-I../gtiff/libtiff,-I../vrt,-I/opt/apps/ots/gdal/port,-I/opt/apps/ots/gdal/gcore,-I/opt/apps/ots/gdal/alg,-I/opt/apps/ots/gdal/ogr,-I/opt/apps/ots/gdal/ogr/ogrsf_frmts,-DOGR_ENABLED,-I/opt/apps/ots/include,-I/opt/apps/ots/hdf/v4/include,-I/opt/apps/ots/hdf/v5-1.6.7/include,-I/opt/apps/ots/gdal/port,-I/opt/apps/ots/jpeg/jpeg2000,-I/opt/apps/ots/jpeg/jpeg2000/include,-I/opt/apps/ots/netCDF/v3.6.2,-I/opt/apps/ots/netCDF/v3.6.2/include,-DJPEG_SUPPORTED,-I../jpeg/libjpeg,-DPIC,-qosvar=aix.5.3,-qalias=ansi,-q64,-qlargetype,-q64,-qlargetype,-qmaxmem=-1,-qarch=pwr5x,-g,-qasm_as=/bin/as,-qcpp_stdinc=/usr/vacpp/include:/usr/include,-qc_stdinc=/usr/vac/include:/usr/include,-o../o/.libs/nitfdataset.o,nitfdataset.cpp,/tmp/xlcW0ECmj7a,/tmp/xlcW1ECmj7b,/dev/null,/tmp/xlcLEDmj7eF.lst,/dev/null,/tmp/xlcW2EDmj7c,NULL) "/opt/apps/ots/include/jconfig.h", line 12.9: 1540-0848 (S) The macro name "HAVE_STDLIB_H" is already defined with a different definition. "/opt/apps/ots/gdal/port/cpl_config.h", line 118.9: 1540-0425 (I) "HAVE_STDLIB_H" is defined on line 118 of "/opt/apps/ots/gdal/port/cpl_config.h".

So I commented out the HAVE_STDLIB_H line in cpl_config.h and re-compiled gdal. Received the following error message (see attached log file gmake.out3):

exec: /usr/vacpp/exe/xlCentry(/usr/vacpp/exe/xlCentry,-D_AIX,-D_AIX32,-D_AIX41,-D_AIX43,-D_AIX50,-D_AIX51,-D_AIX52,-D_AIX53,-D_IBMR2,-D_POWER,-DDEBUG,-I/opt/apps/ots/gdal/port,-I/opt/apps/ots/gdal/gcore,-I/opt/apps/ots/gdal/alg,-I/opt/apps/ots/gdal/ogr,-I/opt/apps/ots/gdal/ogr/ogrsf_frmts,-I/opt/apps/ots/gdal/ogr,-Ihdf-eos,-DOGR_ENABLED,-I/opt/apps/ots/include,-I/opt/apps/ots/hdf/v4/include,-I/opt/apps/ots/hdf/v5-1.6.7/include,-I/opt/apps/ots/gdal/port,-I/opt/apps/ots/jpeg/jpeg2000,-I/opt/apps/ots/jpeg/jpeg2000/include,-I/opt/apps/ots/netCDF/v3.6.2,-I/opt/apps/ots/netCDF/v3.6.2/include,-DPIC,-qosvar=aix.5.3,-qalias=ansi,-q64,-qlargetype,-q64,-qlargetype,-qmaxmem=-1,-qarch=pwr5x,-g,-qasm_as=/bin/as,-qcpp_stdinc=/usr/vacpp/include:/usr/include,-qc_stdinc=/usr/vac/include:/usr/include,-o../o/.libs/hdf4dataset.o,hdf4dataset.cpp,/tmp/xlcW0cW3Kaa,/tmp/xlcW1cW3Kab,/dev/null,/tmp/xlcLc_3KaeF.lst,/dev/null,/tmp/xlcW2cX3Kac,NULL) "hdf4dataset.h", line 54.5: 1540-0403 (S) "UNKNOWN" is already defined. "/opt/apps/ots/hdf/v4/include/mfhdfi.h", line 25.5: 1540-0425 (I) "UNKNOWN" is defined on line 25 of "/opt/apps/ots/hdf/v4/include/mfhdfi.h". "hdf4dataset.h", line 80.24: 1540-0040 (S) The text "iSubdatasetType" is unexpected. "HDF4SubdatasetType" may be undeclared or ambiguous.

I then commented out the UNKNOWN line in file hdf4dataset.h and re-compiled. Got the following error (see attached log file gmake.out4):

exec: /usr/vacpp/exe/xlCentry(/usr/vacpp/exe/xlCentry,-D_AIX,-D_AIX32,-D_AIX41,-D_AIX43,-D_AIX50,-D_AIX51,-D_AIX52,-D_AIX53,-D_IBMR2,-D_POWER,-DDEBUG,-I/opt/apps/ots/gdal/port,-I/opt/apps/ots/gdal/gcore,-I/opt/apps/ots/gdal/alg,-I/opt/apps/ots/gdal/ogr,-I/opt/apps/ots/gdal/ogr/ogrsf_frmts,-I/opt/apps/ots/gdal/ogr,-Ihdf-eos,-DOGR_ENABLED,-I/opt/apps/ots/include,-I/opt/apps/ots/hdf/v4/include,-I/opt/apps/ots/hdf/v5-1.6.7/include,-I/opt/apps/ots/gdal/port,-I/opt/apps/ots/jpeg/jpeg2000,-I/opt/apps/ots/jpeg/jpeg2000/include,-I/opt/apps/ots/netCDF/v3.6.2,-I/opt/apps/ots/netCDF/v3.6.2/include,-DPIC,-qosvar=aix.5.3,-qalias=ansi,-q64,-qlargetype,-q64,-qlargetype,-qmaxmem=-1,-qarch=pwr5x,-g,-qasm_as=/bin/as,-qcpp_stdinc=/usr/vacpp/include:/usr/include,-qc_stdinc=/usr/vac/include:/usr/include,-o../o/.libs/hdf4dataset.o,hdf4dataset.cpp,/tmp/xlcW0ix7lMa,/tmp/xlcW1i17lMb,/dev/null,/tmp/xlcLi17lMeF.lst,/dev/null,/tmp/xlcW2i17lMc,NULL) "hdf4dataset.cpp", line 743.33: 1540-0216 (S) An expression of type "hdf_vartype_t" cannot be converted to type "HDF4SubdatasetType".

Clearly I'm going down the wrong path. Any suggestions?

05/23/08 11:49:41 changed by mloskot

The tiff.h fix is to wrap lines 68-78 with

#ifdef _AIX
   /* lines 68-78 go here */
#endif

The HAVE_STDLIB_H is issue with jconfig.h sucked from external libjpeg located in /opt/apps/ots/include/jconfig.h. Unfortunately, GDAL internal copy of libjpeg has the same issue and the duplicates are incorrect here, should be managed in more centralized way but not per internal library. Anyway, the fix is to wrap lines 11-12 in jconfig.h with:

#ifndef HAVE_STDDEF_H
#define HAVE_STDDEF_H 1
#endif
#ifndef HAVE_STDLIB_H
#define HAVE_STDLIB_H 1
#endif

The undefined UNKNOWN is a bug in older versions of GDAL. It has been fixed recently (#2296). So, SVN version is recommended to use to get that fix. Then the last problem with

An expression of type "hdf_vartype_t" cannot be converted to type "HDF4SubdatasetType".

should be solved as well.

Hope it helps.

05/23/08 22:41:16 changed by mloskot

  • type changed from task to defect.

05/28/08 17:39:42 changed by tconrad

Thanks for the help you have given me so far.

I tried several things. Tried the tiff.h fix but it failed. Could not get it to work. So I commented out the line containing int64. Implemented the HAVE_STDDEF_H/HAVE_STDLIB_H fix and the UNKNOWN fix. These seemed to work. Re-compiling gave me the following error:

"gstTypes.h", line 43.41: 1540-0400 (S) "int64" has a conflicting declaration. "/usr/include/sys/inttypes.h", line 622.33: 1540-0425 (I) "int64" is defined on line 622 of "/usr/include/sys/inttypes.h".

I edited gstTypes.h, commenting out the line containing int64. Re-compiling gave me:

"netcdfdataset.h", line 150.32: 1540-0274 (S) The name lookup for "NC_MAX_NAME" did not find a declaration.
"netcdfdataset.cpp", line 143.24: 1540-0274 (S) The name lookup for "NC_MAX_NAME" did not find a declaration.
"netcdfdataset.cpp", line 417.14: 1540-0274 (S) The name lookup for "NC_INT" did not find a declaration.
"netcdfdataset.cpp", line 491.5: 1540-0274 (S) The name lookup for "nc_inq_varndims" did not find a declaration.
"netcdfdataset.cpp", line 536.16: 1540-0274 (S) The name lookup for "nc_get_vara_uchar" did not find a declaration.
"netcdfdataset.cpp", line 539.16: 1540-0274 (S) The name lookup for "nc_get_vara_short" did not find a declaration.
"netcdfdataset.cpp", line 544.20: 1540-0274 (S) The name lookup for "nc_get_vara_long" did not find a declaration.
"netcdfdataset.cpp", line 547.20: 1540-0274 (S) The name lookup for "nc_get_vara_int" did not find a declaration.
"netcdfdataset.cpp", line 551.16: 1540-0274 (S) The name lookup for "nc_get_vara_float" did not find a declaration.
"netcdfdataset.cpp", line 559.16: 1540-0274 (S) The name lookup for "nc_get_vara_double" did not find a declaration.
"netcdfdataset.cpp", line 572.19: 1540-0274 (S) The name lookup for "nc_strerror" did not find a declaration.
"netcdfdataset.cpp", line 1662.9: 1540-0274 (S) The name lookup for "nc_put_att_text" did not find a declaration.
"netcdfdataset.cpp", line 1720.22: 1540-0274 (S) The name lookup for "NC_MAX_DIMS" did not find a declaration.

I have other questions, but for now: Any suggestions?

05/28/08 19:04:43 changed by mloskot

Actually, I made a mistake in the #ifdef _AIX fix, it should be #ifndef so these lines are compiled on all but AIX:

#ifndef _AIX
   /* lines 68-78 go here */
#endif

Also, GDAL/OGR sources (and sources of internal versions of dependencies, like libtiff) should be scanned for all places where int16, int32, int64 typdefes are defined and such lines have to be wrapped with #ifndef _AIX.

The errors about missing declarations in NetCDF driver seem to be related to Incompatibility with NetCDF Libraries issue. Check also the netcdf option build error thread.

05/30/08 18:05:47 changed by tconrad

Adding the "ifndef _AIX" wrappers was a big help. Thanks!

The netCDF errors did not go away. The tips (such as "-DHAVE_NETCDF") given in the references you gave did not help. Anything else I can try?

05/30/08 18:11:14 changed by rouault

Hum, if you do not need netcdf support, try building with --with-netcdf=no

06/03/08 18:33:13 changed by tconrad

Okay---after trying many, many, many, many things, I finally got what I think is a clean build.

Maybe I should quit while I'm ahead, but I have another question. It's about Xerces. I have tried and tried to get gdal to build with Xerces. I've done this by, among many other things, specifying --with-xerces=/opt/apps/ots/xerces, which is where xerces is installed on my system. Nothing so far has worked. Any suggestions?