Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#2699 closed defect (fixed)

old libtiff incompatible with gdal trunk

Reported by: warmerdam Owned by: warmerdam
Priority: high Milestone: 1.6.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: gtiff
Cc: ilucena, dron

Description (last modified by warmerdam)

Hi there,

Downloading the nightly source distribution gdal-svn-trunk-2008.11.20.tar.gz on a RedHat Linux,

$ cat /etc/redhat-release
Enterprise Linux Enterprise Linux AS release 4 (October Update 7)

It is resulting in a error on gt_overview

% ./configure --prefix=/home/joe/utils/gdal
% make
...
Error:
 gt_overview.cpp:75: error: `TIFFFreeDirectory' was not declared in this scope
 gt_overview.cpp:75: warning: unused variable 'TIFFFreeDirectory'
 make[2]: *** [../o/gt_overview.o] Error 1
 make[2]: Leaving directory
 `/home/joe/GDAL/gdal-svn-trunk-2008.11.20/frmts/gtiff'
 make[1]: *** [gtiff-install-obj] Error 2
 make[1]: Leaving directory
 `/home/joe/GDAL/gdal-svn-trunk-2008.11.20/frmts'
 make: *** [frmts-target] Error 2

GDAL should be able to build and run with older versions of libtiff, even if there is some esoteric functionality that is broken.

Change History (5)

comment:1 by warmerdam, 15 years ago

Description: modified (diff)
Status: newassigned

comment:2 by Even Rouault, 15 years ago

If I remember well, this is not new with gdal trunk. This exists also with 1.5.X and maybe older

comment:3 by warmerdam, 15 years ago

Resolution: fixed
Status: assignedclosed

I have modified trunk (r15787) to avoid use of TIFFFreeDirectory() and TIFFIsCODECConfigured() based on the TIFFLIB_VERSION setting.

With these changes it seems libtiff versions as old as 3.6.0 work fine. 3.5.x seems to lack some stuff related to how libgeotiff works that makes it impractical to support.

I reviewed (but did not test) GDAL 1.5.x and it does not seem to use TIFFFreeDirectory() or the CODEC function. So apparently there is no need for work here.

comment:4 by Even Rouault, 15 years ago

Cc: ilucena dron added

Hum,

/home/even/gdal/branches/1.5/gdal/frmts/gtiff$ grep TIFFFreeDir *.c*
tif_overview.c:    TIFFFreeDirectory( hTIFF );

So we have a problem with 1.5 too (I looked at tags 1.4.1, and we use TIFFFreeDirectory too). But people on Linux couldn't see the issue because of 2 reasons :

  • TIFFFreeDirectory in GDAL < 1.6.0 was used in a .c file, and GCC only emits a warning when a symbol is not found in the headers whereas it errors if it's a .cpp file.
  • TIFFFreeDirectory in libtiff-3.6.0 is not officialy public but is declared as 'extern', so with GCC, it is still exported. However it is not in libtiff.def, so people compiling on Windows would run into a linking problem.

So people could compile 1.5 branch against libtiff-3.6.0 on Linux, but that's somehow a miracle...

comment:5 by warmerdam, 15 years ago

Even,

I have confirmed your finding. I have modified (r15797) tif_overview.c to only call TIFFFreeDirectory() with libtiff 3.8.0 and later as in trunk.

Thanks,

Note: See TracTickets for help on using tickets.