[Gdal-dev] Trouble to compile GDAL-cvs with HDF4 in OS X

Andrey Kiselev dron at ak4719.spb.edu
Wed Nov 19 11:44:47 EST 2003


Hi, Lorenzo,

On Wed, Nov 19, 2003 at 05:05:34PM +0100, Lorenzo Moretti wrote:
> I have compiled gdal-cvs in OSX without problem.
> The problem is in GDAL with HDF4 support. I have hdf4.1r5 installed 
> from FINK distibution ( http://fink.sf.net/ ): it install many files 
> in /sw/bin (fp2hdf, gif2hdf, ...), in sw/lib (libdf.a, libmfhdf.a), 
> in /sw/include (atom.h, bitvec.h, ...).
> 
> When I configure gdal with:
> ./configure --mandir=/usr/local/share/man --with-grass=no 
> --with-libtiff=internal --with-geotiff=internal --with-jpeg=internal 
> --with-gif=internal --with-png=internal --with-pg=no --without-python 
> --with-ogdi=no --with-fme=no --with-jasper=no --with-kakadu=no 
> --with-mrsid=no --with-hdf4=/sw --with-threads
> 
> I have this result in config.log:
> ...
> configure:19321: result: no
> configure:20320: checking for FMEObjects
> configure:20325: result: disabled by user
> configure:20476: checking for SDreaddata in -lmfhdf
...
> configure:20529: result: no
> configure:20538: checking for SDreaddata in -lhdf4
> configure:20571: gcc -o conftest -g -O2 -DCPL_MULTIPROC_PTHREAD  
> -DCPL_MULTIPROC_PTHREAD  conftest.c -lhdf4  -L/sw/lib -lz -lpthread 
> -lm -ldl  >&5
> ld: can't locate file for: -lhdf4
> configure:20574: $? = 1
> configure: failed program was:
> #line 20545 "configure"
> #include "confdefs.h"
> ....

Is it the end of the HDF-related log? I think it should be more
information after these two tests (in case you are using recent
snapshot).

> Is this an error ?

Yes, both tests are failed.

> After ./configure I enter make until the end without error (?????), I 
> suppose, and after I enter sudo make install.
> When I enter:
> [lorenzo:~] lor% /usr/local/bin/gdal-config --formats
> gxf gtiff hfa aigrid aaigrid ceos ceos2 iso8211 xpm sdts raw dted mem 
> jdem envisat elas fit vrt usgsdem l1b nitf bmp pcidsk bsb hdf4 gif 
> jpeg png
> [lorenzo:~] lor%
> I see hdf4 in the list.
> 
> Now I want to see the information from Aster files hdf:
> 
> [lorenzo:~] lor% /usr/local/bin/gdalinfo 
> /ASTER_files/AST_L1B_002_01152002101254_05232402150244.hdf
> Driver: HDF4/Hierarchical Data Format Release 4
> Size is 512, 512
> Coordinate System is `'
> Metadata:
>   HDFEOSVersion=HDFEOS_V2.6
>   IDOFASTERGDSDATAGRANULE=ASTL1B 0201101012540205220094
>   RECEIVINGCENTER=EDOS
>   PROCESSINGCENTER=ASTER-GDS
>   SENSORNAME=VNIR
>   POINTINGANGLE=0.025000
>   SETTINGTIMEOFPOINTING=2002-01-10T10:10:22Z
>   SENSORNAME=SWIR
>   ....

Looks like configure fails to detect a library, but build system does it
successful. Anyhow GDAL on your system supports HDF4. Otherwise you
can't get gdalinfo output for HDF files.

> Now I compile Grass with GDAL support and after I use in grass the 
> module r.in.gdal for importing the same file and I have this error:
>   format not recognized

Are you sure GRASS using recently compiled GDAL? Is it possible you have
outdated GDAL binaries somewhere in the system?

> Is it possible to enable GDAL for supporting HDF4 lib in Mac OS X?

Yes, you did it already!


-- 
Andrey V. Kiselev
Home phone:  +7 812 5274898  ICQ# 26871517



More information about the Gdal-dev mailing list