Bug 169561 - Need to compile with -fPIC to allow use on x86_64
Summary: Need to compile with -fPIC to allow use on x86_64
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: netcdf
Version: 4
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ed Hill
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-09-29 17:44 UTC by Orion Poplawski
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-09-29 18:11:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Orion Poplawski 2005-09-29 17:44:23 UTC
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):
netcdf-devel-3.6.0-6.p1.fc4

How reproducible:
everytime

Comment 1 Ed Hill 2005-09-29 18:02:28 UTC
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 18:11:49 UTC
Gah, so sorry.  I needed to compile my object -fPIC.  Sorry!

Comment 3 Ed Hill 2005-09-29 18:21:07 UTC
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.