[gdal-dev] HDF-Problems when compiling

Andreas H. lists at hilboll.de
Fri Sep 9 10:20:44 EDT 2011


Hi everyone,

I'm trying to compile GDAL 1.8.1 from source on a x86_64 machine, compiling
against the libraries which come shipped with Enthought's Python
distribution.

So, what I'm doing is this:

$ export CFLAGS="-I/hb/USER/lib/epd-7.1-1-x86_64/include -fPIC"
$ export CXXFLAGS="-I/hb/USER/lib/epd-7.1-1-x86_64/include -fPIC"
$ export LDFLAGS="-L/hb/USER/lib/epd-7.1-1-x86_64/lib"
$ ./configure --prefix=/hb/USER/.virtualenvs/pydoas
--with-hdf5=/hb/USER/lib/epd-7.1-1-x86_64
--with-netcdf=/hb/USER/lib/epd-7.1-1-x86_64
--with-hdf4=/hb/USER/lib/epd-7.1-1-x86_64
$ make

I get the following error:

relocation R_X86_64_32 against `a local symbol' can not be used when
making a shared object; recompile with -fPIC
/usr/local/lib/libmfhdf.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libgdal.la] Error 1
make[1]: Leaving directory `/gpfs/hb/USER/.virtualenvs/pydoas/tmp/gdal-1.8.1'
make: *** [check-lib] Error 2

I don't understand the error message, as -fPIC is part of my CFLAGS and
CXXFLAGS?!

When I instead just disable hdf4

$ ./configure --prefix=/hb/USER/.virtualenvs/pydoas
--with-hdf5=/hb/USER/lib/epd-7.1-1-x86_64
--with-netcdf=/hb/USER/lib/epd-7.1-1-x86_64 --without-hdf4
$ make

I get the following:

libtool: link: ranlib .libs/libgdal.a
/usr/bin/sed: can't read /usr/lib/libhdf5_hl.la: No such file or directory
libtool: link: `/usr/lib/libhdf5_hl.la' is not a valid libtool archive
make[1]: *** [libgdal.la] Error 1
make[1]: Leaving directory `/gpfs/hb/USER/.virtualenvs/pydoas/tmp/gdal-1.8.1'
make: *** [check-lib] Error 2

Why does the system try to access /usr/lib/libhdf5_hl.la even though I
specified a different path to ./configure?

Any help is more than welcome ...

Cheers,
Andreas.


PS:

$  gcc -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3
--enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/
--with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap
--with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.3
--enable-linux-futex --without-system-libunwind --with-cpu=generic
--build=x86_64-suse-linux
Thread model: posix
gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux)




More information about the gdal-dev mailing list