[Gdal-dev] compiling gdal with hdf4 on solaris7

Kingsley Burlinson kgb at synix.com.au
Wed Apr 20 09:47:27 EDT 2005

Hi List
I have a problem compiling Gdal 1.2.6 with HDF4.2r1 support on 
 and wonder if someone can assist me please. I hope to use this in Grass 6.
When I run GDAL configure, it complains it cannot find the hdf4 libraries.
These are actually present OK, the problem seems to really be a failure  
to find the routine SDreaddata that configure uses as a test case.    
Configure reports:
 > checking for FMEObjects... no  
 > checking for SDreaddata in -lmfhdf... no
 > checking for SDreaddata in -lhdf4... no
 > checking for SDreaddata in -lmfhdf... no
 > checking for SDreaddata in -lmfhdf... no
 > configure: error: HDF4 support requested with arg /usr/local/hdf4, 
but neither hdf4 nor mfhdf lib found
The libraries are present  :    ls -l /usr/local/hdf4/lib  shows:
 >  1100960 Feb 19 01:32 libdf.a
 >   227036 Feb 19 01:32 libmfhdf.a
But config.log has a section:
 > Undefined    first referenced
 >  symbol          in file    
 > xdr_enum    /usr/local/hdf4/lib/libmfhdf.a(var.o)  (symbol belongs to 
implicit dependency /usr/lib/libnsl.so.1)
 > With similar errors for xdr_float, xdr_int, xdr_u_long, xdr_double, 
xdr_long and xdr_opaque
I get the same problem with gdal 1.2.3 and gdal 1.2.6 and with either
my own compiled hdf4 or with a pre-compiled binary hdf4.
I have checked libnsl.so.1 using elfdump and it does not contain symbols 
which conflict
with those in the error message.
When I compile hdf4.2r1 and run gmake check, it passes most tests and
then crashes, reporting:
 > gmake[3]: Leaving directory `/disk0/add/gis/hdf4/HDF4.2r1/mfhdf/libsrc'
 > ============================
 > HDF-SD C interfaces tests  
 > ============================
 > srcdir="." ./hdftest > hdfout.new
 > gmake[2]: *** [check] Error 1   
 > gmake[2]: Leaving directory `/disk0/add/gis/hdf4/HDF4.2r1/mfhdf/libsrc'
 > gmake[1]: *** [check-recursive] Error 1
 > gmake[1]: Leaving directory `/disk0/add/gis/hdf4/HDF4.2r1/mfhdf'
 > gmake: *** [check-recursive] Error 1
my hdf4 libs are in /usr/local/hdf4/lib. Includes in 
and I run configure with:
 > ./configure --with-szlib=/usr/local/lib --prefix=/usr/local/hdf4
I cannot understand what is going wrong here and would appreciate any help.
Kingsley Burlinson   Darwin

More information about the Gdal-dev mailing list