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.
Peter, > I have encountered a problem compiling netcdfperl on a Linux box > The Netcdfperl version is 1.2.3 (, from VERSION; just downloaded > tarballtoday). Here are > stats on the machine > > uname -a > Linux tsaina.uaa.alaska.edu 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 12 17:58:20 EDT > 2007 > x86_64 x86_64 x86_64 GNU/Linux > > which cc > /usr/bin/cc > > more config.log > This file contains any messages produced by compilers while > running configure, to aid debugging if configure makes a mistake. > > configure:635: checking for manual-page index command > configure:648: checking for perl > configure:694: checking for perl manual page directory > configure:712: checking for value of perl POLLUTE variable > configure:759: checking for neqn > configure:791: checking for tbl > configure:1099: checking for c89 > configure:1186: checking type of operating system > configure:1263: checking for tar flags > configure:1279: checking for netCDF header-file > configure:1306: checking for netCDF library > configure:1335: checking for package version > > make.out>> > make[1]: Entering directory `/users/olsson/ftp/netcdf-perl-1.2.3/src' > make[2]: Entering directory `/users/olsson/ftp/netcdf-perl-1.2.3/src' > > making `dynamic' in directory /users/olsson/ftp/netcdf-perl-1.2.3/src/perl > > make[3]: Entering directory `/users/olsson/ftp/netcdf-perl-1.2.3/src/perl' > gcc -c -I/usr/local/include -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING > -fno-strict-aliasing > -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 > -I/usr/include/gdbm -O2 -g -pipe -m64 -DVERSION=\"1.2.3\" > -DXS_VERSION=\"1.2.3\" -fPIC > "-I/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE" NetCDF.c > Running Mkbootstrap for NetCDF () > chmod 644 NetCDF.bs > rm -f blib/arch/auto/NetCDF/NetCDF.so > gcc -shared NetCDF.o -o blib/arch/auto/NetCDF/NetCDF.so -L/usr/local/lib > -lnetcdf > /usr/bin/ld: /usr/local/lib/libnetcdf.a(putget.o): relocation R_X86_64_32S > against `a > local symbol' can not be used when making a shared object; recompile with > -fPIC > /usr/local/lib/libnetcdf.a: could not read symbols: Bad value > collect2: ld returned 1 exit status > make[3]: *** [blib/arch/auto/NetCDF/NetCDF.so] Error 1 > make[3]: Leaving directory `/users/olsson/ftp/netcdf-perl-1.2.3/src/perl' > make[2]: *** [perl/dynamic] Error 1 > make[2]: Leaving directory `/users/olsson/ftp/netcdf-perl-1.2.3/src' > make[1]: *** [decision] Error 2 > make[1]: Leaving directory `/users/olsson/ftp/netcdf-perl-1.2.3/src' > make: *** [all] Error 2 > > test.log: N/A > > config.log N/A > > recompile with -fPIC > > I am unclear as to "what" to recompile/relink with -fPIC. I notice that the > Makefile > in src/perl has: "Makefile:CCCDLFLAGS = -fPIC" so it gets in there at some > level. > > I am NOT a master of shared libraries, and that seems to be the problem. Can > you give me > some suggestions, PLZ? I suspect that the netCDF library wasn't compiled using the "-fPIC" option, which allows it to become part of a shared library. Try rebuilding the netCDF library -- using the "-fPIC" compiler option -- and reinstalling it. Then try rebuilding the netCDFPerl package. Let me know if this doesn't work. > PQO > > ___________________________________________________________ > | > | Dr. Peter Q. Olsson, > | Alaska State Climatologist, Alaska State Climate Center > | Chief Scientist, Alaska Experimental Forecast Facility > | University of Alaska Anchorage > | 2811 Merrill Field Drive > | Anchorage, AK 99501 > | voice: (907) 786-7234, fax (907) 786-7237| Regards, Steve Emmerson Ticket Details =================== Ticket ID: NOS-863856 Department: Support netCDF Perl Priority: Normal Status: Closed