This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> I am trying to build netcdf 3.6.3 on CentOS release 5.2 64 bit machine. > I get the following error when linking against the newly built netcdf > library. > > /usr/bin/ld: /opt/lib64/libnetcdf.a(attr.o): relocation R_X86_64_32 > against `a local symbol' can not be used when making a shared object; > recompile with -fPIC > /opt/lib64/libnetcdf.a(attr.o): could not read symbols: Bad value > > The netcdf build goes just fine, and all tests are successful. I don't > see any notes specific to building on 64 bit machines except "Some > platforms support special options to build in 64-bit mode. " But Linux > is not listed, only AIX, IRIX, and SUNOS. > > I am using gcc/g++ version 4.1.2 > > Any compile flags I should be using? > > Thanks, > > Patrick West > Tetherless World Constellation > Rensselaer Polytechnic Institute > Howdy Patrick! This is not a 64-bit problem, but a shared library problem. Sounds like your application wants to link against a shared library. By default, only static netCDF libraries are build. Rebuild netCDF with the --enable-shared configure option. Please let me know if this doesn't help. Thanks, Ed Ticket Details =================== Ticket ID: KRD-878925 Department: Support netCDF Priority: Normal Status: Closed