[gdal-dev] build gdal-1.6.0 on CentOS Linux error

Gong, Shawn (Contractor) Shawn.Gong at drdc-rddc.gc.ca
Mon Apr 20 16:00:25 EDT 2009


Hi list,

I am trying to build gdal-1.6.0 on a 64-bit CentOS Linux.
Error message shows that -fPIC must be used.

However after I have added -fPIC in HDF4.2r4's CFLAGS in Makefile and in
Gdal CFLAGS in GDALmake.opt, the error persists:
/usr/bin/ld: /home/sgong/build_openev/dist/lib/libmfhdf.a(mfsd.o):
relocation R_X86_64_32 against `a local symbol' can not be used when
making a shared object; recompile with -fPIC

Would someone help?

thanks,
Shawn


==============================================
make[1]: Entering directory `/home/sgong/build_openev/gdal-1.6.0'
/bin/sh /home/sgong/build_openev/gdal-1.6.0/libtool --mode=link
g++   -I/usr/include -lsqlite3 -L/home/sgong/build_openev/dist/lib
-lhdf5  -L/home/sgong/build_openev/dist/lib -lmfhdf -ldf -lsz
-L/home/sgong/build_openev/dist -L/home/sgong/build_openev/dist/lib
-ljpeg -L/home/sgong/build_openev/dist
-L/home/sgong/build_openev/dist/lib -lnetcdf -lz
-L/home/sgong/build_openev/dist -L/home/sgong/build_openev/dist/lib  -lm
-lrt -ldl        -o libgdal.la
/home/sgong/build_openev/gdal-1.6.0/frmts/o/*.lo
/home/sgong/build_openev/gdal-1.6.0/gcore/*.lo
/home/sgong/build_openev/gdal-1.6.0/port/*.lo
/home/sgong/build_openev/gdal-1.6.0/alg/*.lo
/home/sgong/build_openev/gdal-1.6.0/ogr/ogrsf_frmts/o/*.lo
./ogr/ogrgeometryfactory.lo ./ogr/ogrpoint.lo ./ogr/ogrcurve.lo
./ogr/ogrlinestring.lo ./ogr/ogrlinearring.lo ./ogr/ogrpolygon.lo
./ogr/ogrutils.lo ./ogr/ogrgeometry.lo ./ogr/ogrgeometrycollection.lo
./ogr/ogrmultipolygon.lo ./ogr/ogrsurface.lo ./ogr/ogrmultipoint.lo
./ogr/ogrmultilinestring.lo ./ogr/ogr_api.lo ./ogr/ogrfeature.lo
./ogr/ogrfeaturedefn.lo ./ogr/ogrfeaturequery.lo
./ogr/ogrfeaturestyle.lo ./ogr/ogrfielddefn.lo
./ogr/ogrspatialreference.lo ./ogr/ogr_srsnode.lo ./ogr/ogr_srs_proj4.lo
./ogr/ogr_fromepsg.lo ./ogr/ogrct.lo ./ogr/ogr_opt.lo
./ogr/ogr_srs_esri.lo ./ogr/ogr_srs_pci.lo ./ogr/ogr_srs_usgs.lo
./ogr/ogr_srs_dict.lo ./ogr/ogr_srs_panorama.lo ./ogr/ogr_srs_erm.lo
./ogr/swq.lo ./ogr/ogr_srs_validate.lo ./ogr/ogr_srs_xml.lo
./ogr/ograssemblepolygon.lo ./ogr/ogr2gmlgeometry.lo
./ogr/gml2ogrgeometry.lo \
            -rpath /home/sgong/build_openev/dist/lib \
            -no-undefined \
            -version-info 14:0:13
libtool: link: rm -fr  .libs/libgdal.la.lnkscript
libtool: link: creating GNU ld script: .libs/libgdal.la.lnkscript
libtool: link: g++ -shared -nostdlib
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtbeginS.o
.libs/libgdal.la.lnkscript  -Wl,-rpath
-Wl,/home/sgong/build_openev/dist/lib -Wl,-rpath
-Wl,/home/sgong/build_openev/dist/lib -lsqlite3
-L/home/sgong/build_openev/dist/lib
/home/sgong/build_openev/dist/lib/libhdf5.so
/home/sgong/build_openev/dist/lib/libmfhdf.a
/home/sgong/build_openev/dist/lib/libdf.a
/home/sgong/build_openev/dist/lib/libsz.so
-L/home/sgong/build_openev/dist -ljpeg
/home/sgong/build_openev/dist/lib/libnetcdf.a -lz -lrt -ldl
-L/usr/lib/gcc/x86_64-redhat-linux/4.1.2
-L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64 -lstdc++ -lm -lc -lgcc_s
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtendS.o
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crtn.o
-Wl,-soname -Wl,libgdal.so.1 -o .libs/libgdal.so.1.13.0
/usr/bin/ld: /home/sgong/build_openev/dist/lib/libmfhdf.a(mfsd.o):
relocation R_X86_64_32 against `a local symbol' can not be used when
making a shared object; recompile with -fPIC
/home/sgong/build_openev/dist/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 `/home/sgong/build_openev/gdal-1.6.0'
make: *** [check-lib] Error 2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090420/6ae523a0/attachment.html


More information about the gdal-dev mailing list