Red Hat Bugzilla – Bug 169561
Need to compile with -fPIC to allow use on x86_64
Last modified: 2007-11-30 17:11:14 EST
Description of problem:
When trying to link to the netcdf library on x86_64, I get:
/usr/bin/ld: ncmex.o: relocation R_X86_64_32 against `a local symbol' can not be
used when making a shared object; recompile with -fPIC
Please recompile with -fPIC. I already had to do this with my hdf package.
Version-Release number of selected component (if applicable):
Hi Orion, are you certain that you've encountered a bug in netCDF? The
"ncmex.o" file that you list is not included in netCDF -- its usually part of an
add-on netCDF-for-MatLAB toolbox. And if you look in the netcdf.spec file
you'll see that I am indeed using CPPFLAGS="-fPIC" so the vast majority of the
library (which is in C) does get compiled with that flag.
Or, do I also need to pass "-fPIC" for the bits compiled with gfortran (or g77)
as well? If so, I'll try to see how to do that...
Gah, so sorry. I needed to compile my object -fPIC. Sorry!
And I don't think anyone is using the F90 parts of the netCDF static
library to build any shared libs but, just to be safe, I've added "-fPIC"
for them as well and checked that into CVS. They're building right now
so a new version for FC4+ will be out soon-ish.