gdal setup with netCDF

Frank Warmerdam warmerdam at POBOX.COM
Wed Jan 10 14:07:58 EST 2007


edfialk wrote:
> Hi! I'm trying to get GDAL configured for netCDF output (i.e. convert x file
> to netCDF).
> 
> So, I install netcdf-3.6.1 (configure, make, make install).
> I configure GDAL --with-netcdf=/usr/local/src/netcdf-3.6.1
> 
> ...
>   NETCDF support:            yes
> ...
> 
> then i run make for GDAL, and I get:
> ...
> /usr/bin/ld: /usr/local/src/netcdf-3.6.1/lib/libnetcdf.a(attr.o): relocation
> R_X86_64_32S against `a local symbol' can not be used when making a shared
> object; recompile with -fPIC
> /usr/local/src/netcdf-3.6.1/lib/libnetcdf.a: could not read symbols: Bad
> value
> collect2: ld returned 1 exit status
> make[1]: *** [libgdal.la] Error 1
> make[1]: Leaving directory `/usr/local/src/gdal-1.3.2'
> make: *** [check-lib] Error 2
> 
> 
> Bad value? I got the latest netCDF from
> http://www.unidata.ucar.edu/software/netcdf/...
> Anyone have any ideas?

Ed,

To link object code into a shared library (on some platforms) it needs to
be compiled with -fPIC.  I think you will need to go back to your netcdf
build, and doctor up the Makefile to include this option.

If there is a libnetcdf.so, linking against that would also resolve the
problem.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the mapserver-users mailing list