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

Lorenzo Moretti lorenzo.moretti at bologna.enea.it
Wed Nov 19 13:13:21 EST 2003


Hi, Andrey


>  > -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).

It's not complete !!!
from config.log

........
configure:19268: checking for ffopen in -lcfitsio
configure:19301: gcc -o conftest -g -O2 -DCPL_MULTIPROC_PTHREAD  
-DCPL_MULTIPROC_PTHREAD  conftest.c -lcfitsio  -lz -lpthread -lm 
-ldl  >&5
ld: can't locate file for: -lcfitsio
configure:19304: $? = 1
configure: failed program was:
#line 19275 "configure"
#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char ffopen ();
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
      extern "C"
#  endif
    int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
ffopen ();
   ;
   return 0;
}
configure:19321: result: no
configure:20320: checking for FMEObjects
configure:20325: result: disabled by user
configure:20476: checking for SDreaddata in -lmfhdf
configure:20509: gcc -o conftest -g -O2 -DCPL_MULTIPROC_PTHREAD  
-DCPL_MULTIPROC_PTHREAD  conftest.c -lmfhdf  -L/sw/lib -lz -lpthread 
-lm -ldl  >&5
ld: Undefined symbols:
_DFKNTsize
_DFKconvert
_DFKgetPNSC
_DFKislitendNT
_DFKisnativeNT
_HCcreate
_HCgetcompress
_HDget_special_info
_HEPclear
_HEpush
_HMCcreate
_HMCreadChunk
_HMCsetMaxcache
_HMCwriteChunk
_HPregister_term_func
_HXcreate
_Hendaccess
_Hinquire
_Hnewref
_Hsetaccesstype
_Vaddtagref
_Vattach
_Vdetach
_error_top
_DFKsetNT
_HDmemfill
_HLcreate
_Hread
_Hseek
_Hsetlength
_Hstartaccess
_Hstartread
_Hwrite
_Vgettagref
_Vntagrefs
_DFdiput
_DFdisetup
_DFdiwrite
_Hclose
_Hdeldd
_Hgetelement
_Hishdf
_Hlength
_Hopen
_Hputelement
_VFfieldorder
_VFfieldtype
_VHmakegroup
_VHstoredata
_VHstoredatam
_VSattach
_VSdelete
_VSdetach
_VSgetclass
_VSinquire
_VSread
_VSseek
_VSsetfields
_VSwrite
_Vdelete
_Vfindclass
_Vfinish
_Vgetclass
_Vgetnext
_Vinitialize
_Vinquire
_Visvg
_Visvs
_vexistvg
_vexistvs
_ANannlen
_ANannlist
_ANend
_ANendaccess
_ANnumann
_ANreadann
_ANstart
_DFdiget
_DFdiread
_Hnextread
configure:20512: $? = 1
configure: failed program was:
#line 20483 "configure"
#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char SDreaddata ();
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
      extern "C"
#  endif
    int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
SDreaddata ();
   ;
   return 0;
}
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"

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char SDreaddata ();
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
      extern "C"
#  endif
    int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
SDreaddata ();
   ;
   return 0;
}
configure:20591: result: no
configure:20604: checking for SDreaddata in -lmfhdf
configure:20637: gcc -o conftest -g -O2 -DCPL_MULTIPROC_PTHREAD  
-DCPL_MULTIPROC_PTHREAD  conftest.c -lmfhdf -ldf -ljpeg -lz -L/sw/lib 
-lz -lpthread -lm -ldl  >&5
configure:20640: $? = 0
configure:20643: test -s conftest
configure:20646: $? = 0
configure:20657: result: yes
configure:21072: checking for NCScbmOpenFileView in -lNCSEcw
configure:21105: gcc -o conftest -g -O2 -DCPL_MULTIPROC_PTHREAD  
-DCPL_MULTIPROC_PTHREAD  conftest.c -lNCSEcw  -L/sw/lib -lmfhdf -ldf 
-lz -lpthread -lm -ldl  >&5
ld: can't locate file for: -lNCSEcw
configure:21108: $? = 1
configure: failed program was:
#line 21079 "configure"
#include "confdefs.h"

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char NCScbmOpenFileView ();
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
      extern "C"
#  endif
    int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
NCScbmOpenFileView ();
   ;
   return 0;
}
configure:21125: result: no
configure:21178: checking for Kakadu JPEG2000 support
configure:21190: result: not requested.
configure:21216: checking for MrSID support
configure:21228: result: not requested.
.........

>  > Is this an error ?
>
>Yes, both tests are failed.

Arghh !!!!


>  > 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.

When I enter:

[lorenzo:~] lor% /usr/local/bin/gdal-config --libs
-L/usr/local/lib -lgdal
[lorenzo:~] lor%

At the beginning of ./configure I see 3 lines of SDreaddata:

.......
checking for FMEObjects... disabled by user
checking for SDreaddata in -lmfhdf... no
checking for SDreaddata in -lhdf4... no
checking for SDreaddata in -lmfhdf... yes
jpeg2000 support disabled.
.......

It'strange


>  > 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?

I have built Grass binaries from grass53cvs source with this gdal 
binaries (--with-gdal=/usr/local/bin/gdal-config). I have new gdal 
binaries.
Grass import my SPOT files, QuickBird files but not Aster file (hdf). I read:
  ... not recognised as a supported file format

Is it an error in gdal or grass?

Have I to recompile grass?

Which tool can I use for converting this file from gdal?

I have a file named libgdal.la in /usr/local/lib
# libgdal.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.0a (1.1220.2.25 2003/08/01 
19:08:35) Debian: 49 $
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname='libgdal.1.dylib'

# Names of this library.
library_names='libgdal.1.1.9.dylib libgdal.1.1.dylib libgdal.1.dylib 
libgdal.dylib'

# The name of the static archive.
old_library='libgdal.a'

# Libraries that this one depends upon.
dependency_libs=' /sw/lib/libodbc.la -L/sw/lib /sw/lib/libiconv.la 
-lmfhdf -ldf -lz -lpthread -lm -ldl'

# Version information for libgdal.
current=2
age=1
revision=9

# Is this an already installed library?
installed=yes

# Should we warn about portability when linking against -modules?
shouldnotlink=no

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='/usr/local/lib'

There is -lmfhdf and -ldf. Mmmhhhh !!!

>  > Is it possible to enable GDAL for supporting HDF4 lib in Mac OS X?
>
>Yes, you did it already!
>

Thanks

-- 
________________________________________________________________________
||      Lorenzo Moretti        e-mail: lorenzo.moretti at bologna.enea.it     
||/|/|  ENEA prot              Web: http://wwwamb.bologna.enea.it/    
||   |  via Don Fiammelli, 2   FTP: ftp://ftpamb.bologna.enea.it/ (ris.)
~~~~~~  40128 BOLOGNA - ITALY  Ph: +39-0516098086  Fax: +39-0516098131
________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20031119/1b53146e/attachment.html


More information about the Gdal-dev mailing list