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.
Jonathan, > I removed the older netcdf installation (done by someone else) and > downloaded 3.6.3 and built it with the -fPIC options there. > > # grep PIC make.log > gcc -c -I/usr/local/netcdf-3.6.3/include -D_REENTRANT -D_GNU_SOURCE > -fno-strict-aliasing -pipe -Wdeclaration-after-statement > -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 > -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 > -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 > -mtune=generic -DVERSION=\"1.2.4\" -DXS_VERSION=\"1.2.4\" -fPIC > "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" NetCDF.c > > > now when trying to build netcdf-perl I get past the "make" (no errors) > but the "make-test" errors out: > > > # export PERL_MANDIR=/usr/share/man; export > CPP_NETCDF=-I/usr/local/netcdf-3.6.3/include; export > LD_NETCDF="-L/usr/local/netcdf-3.6.3/lib -lnetcdf" > > # ./configure > configure.log > expanding `include's in file `Makefile' > expanding `include's in file `perl/Makefile.PL' > expanding `include's in file `port/master.mk' > expanding `include's in file `port/Makefile' > > # make perl/Makefile > makefile.log > Note (probably harmless): No library found for -lnetcdf The "No library found..." message is an ill omen. It means that perl(1) was unable to locate the netCDF library when it generated the makefile in the perl/ subdirectory. > # cat makefile.log > cd perl && perl Makefile.PL POLLUTE=0 > Checking if your kit is complete... > Looks good > Writing Makefile for NetCDF > > # make > make.log > Please specify prototyping behavior for NetCDF.xs (see perlxs manual) > > # cat make.log > make[1]: Entering directory `/root/netcdf-perl-1.2.4/src' > make[2]: Entering directory `/root/netcdf-perl-1.2.4/src' > > making `dynamic' in directory /root/netcdf-perl-1.2.4/src/perl > > make[3]: Entering directory `/root/netcdf-perl-1.2.4/src/perl' > /usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap > /usr/lib/perl5/5.8.8/ExtUtils/typemap NetCDF.xs > NetCDF.xsc && mv > NetCDF.xsc NetCDF.c > gcc -c -I/usr/local/netcdf-3.6.3/include -D_REENTRANT -D_GNU_SOURCE > -fno-strict-aliasing -pipe -Wdeclaration-after-statement > -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 > -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 > -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 > -mtune=generic -DVERSION=\"1.2.4\" -DXS_VERSION=\"1.2.4\" -fPIC > "-I/usr/lib64/perl5/5.8.8/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 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions > -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic NetCDF.o > -o blib/arch/auto/NetCDF/NetCDF.so \ > \ > > chmod 755 blib/arch/auto/NetCDF/NetCDF.so > cp NetCDF.bs blib/arch/auto/NetCDF/NetCDF.bs > chmod 644 blib/arch/auto/NetCDF/NetCDF.bs > make[3]: Leaving directory `/root/netcdf-perl-1.2.4/src/perl' > > returning to directory /root/netcdf-perl-1.2.4/src > > make[2]: Leaving directory `/root/netcdf-perl-1.2.4/src' > make[1]: Leaving directory `/root/netcdf-perl-1.2.4/src' > test ! -f perl/so_locations || chmod a+w perl/so_locations > > > > # make test > test.log > Can't load 'blib/arch/auto/NetCDF/NetCDF.so' for module NetCDF: > blib/arch/auto/NetCDF/NetCDF.so: undefined symbol: ncopts at > /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230. > at test.pl line 5 > Compilation failed in require at test.pl line 5. > BEGIN failed--compilation aborted at test.pl line 5. > make[2]: *** [test_dynamic] Error 2 > make[1]: *** [perl/test] Error 1 > make: *** [test] Error 2 "ncopts" being an undefined symbol is consistent with the build procedure not finding the netCDF library. What does the /usr/local/netcdf-3.6.3/lib directory contain? > # cat test.log > make[1]: Entering directory `/root/netcdf-perl-1.2.4/src' > > making `test' in directory /root/netcdf-perl-1.2.4/src/perl > > make[2]: Entering directory `/root/netcdf-perl-1.2.4/src/perl' > cp NetCDF.pm blib/lib/NetCDF.pm > AutoSplitting blib/lib/NetCDF.pm (blib/lib/auto/NetCDF) > PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl > make[2]: Leaving directory `/root/netcdf-perl-1.2.4/src/perl' > make[1]: Leaving directory `/root/netcdf-perl-1.2.4/src' > > > > Jonathan Regards, Steve Emmerson Ticket Details =================== Ticket ID: SZN-475812 Department: Support netCDF Perl Priority: Normal Status: Closed