Bug 169561 - Need to compile with -fPIC to allow use on x86_64
Need to compile with -fPIC to allow use on x86_64
Product: Fedora
Classification: Fedora
Component: netcdf (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Ed Hill
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2005-09-29 13:44 EDT by Orion Poplawski
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-29 14:11:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Orion Poplawski 2005-09-29 13:44:23 EDT
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):

How reproducible:
Comment 1 Ed Hill 2005-09-29 14:02:28 EDT
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...
Comment 2 Orion Poplawski 2005-09-29 14:11:49 EDT
Gah, so sorry.  I needed to compile my object -fPIC.  Sorry!
Comment 3 Ed Hill 2005-09-29 14:21:07 EDT
No worries!

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.

Note You need to log in before you can comment on or make changes to this bug.