[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #CKG-467716]: linking dynamic against static libnetcdf



> Hi!
> 
> I encountered some problems creating a shared lib on x86_64 platform
> when linking against a static libnetcdf.
> 
> Error msg was :
> relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a 
> shared object; recompile with -fPIC
> 
> When using '--disable-shared', the source files are not compiled with
> -fPIC, this is only done with '--enable-shared'. This problem could be
> solved by settting CFLAGS manually, or even better by adding another
> configure option '--with-pic'.  It would be great to let this be set
> automatically or to have a note about this in the INSTALL file.
> 
> I am surely not an expert, but is there any drawback from using -fPIC
> for static builds?
> 
> kind regards
> ralf
> 
> 

I don't know of any drawback to using -fPIC. As you say, the way to do this is 
by setting CFLAGS before running configure.

Good luck!

Ed

Ticket Details
===================
Ticket ID: CKG-467716
Department: Support netCDF
Priority: Normal
Status: Closed


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.