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

[netCDF #QVK-623215]: Problem compiling netCDF.pm



Pablo,

> We are trying to compile netCDF.pm into out system with perl 5.8.8. We have
> netCDF in it. See the sequence of information below following the install
> instructions and the error we can coming into. We tried to add the -fPIC
> option to the compilation command and reran make but still having problems.
> 
> Any ideas?

From the output of the "make" command, it looks like the netCDF library wasn't 
compiled with the "-fPIC" option, which is necessary in order to work with the 
netCDF-Perl package. Try reinstalling the netCDF package using the "-fPIC" 
option in the CFLAGS variable.

> Thanks,
> 
> Pablo
> 
> [root@MFL-LW-SWAN src]# uname -a
> Linux MFL-LW-SWAN 2.6.18-194.11.3.el5 #1 SMP Mon Aug 23 15:51:38 EDT 2010 
> x86_64 x86_64 x86_64 GNU/Linux
> 
> VERSION - 1.2.4
> 
> [root@MFL-LW-SWAN src]# which gcc
> /usr/bin/gcc
> 
> [root@MFL-LW-SWAN src]# more configure.log
> Script started on Tue 11 Jan 2011 06:29:37 PM UTC
> [root@MFL-LW-SWAN src]# ./condifure
> bash: ./condifure: No such file or directory
> [root@MFL-LW-SWAN src]# ./configure
> creating cache ./config.cache
> checking for manual-page index command...
> checking for perl... perl
> checking for perl manual page directory...
> checking for value of perl POLLUTE variable... 0
> checking for neqn... neqn
> checking for tbl... tbl
> checking for c89... c89
> checking type of operating system... linux
> checking for tar flags... -chof
> checking for netCDF header-file... -I
> checking for netCDF library...
> checking for package version... 1.2
> 
> ./configure: ERROR: The following variables need values:
> 
> VARIABLE     DESCRIPTION                EXAMPLE
> --------     -------                    -------
> PERL_MANDIR  perl manual directory      /usr/local/man
> CPP_NETCDF   netCDF header              -I/usr/local/unidata/include
> LD_NETCDF    netCDF library             -L/usr/local/unidata/lib -lnetcdf
> 
> For each variable above, this script will now request that you input
> a value appropriate for your system (note that this value will not
> be interpolated by a shell -- so don't use shell substitutions).
> Alternatively, you can interrupt this script, set the above variables
> in the environment or in the file CUSTOMIZE, and then re-execute this
> script.  (Variables referring to executable programs needn't be set if
> the relevant directory is added to PATH.  See file INSTALL for details.)
> 
> Enter a value for the perl manual directory (e.g. "/usr/local/man"):
> /usr/share/man
> 
> Enter a value for the netCDF header (e.g. "-I/usr/local/unidata/include"):
> -I/usr/local/include
> 
> Enter a value for the netCDF library (e.g. "-L/usr/local/unidata/lib 
> -lnetcdf"):
> -L/usr/local/lib -lnetcdf
> 
> updating cache ./config.cache
> creating ./config.status
> creating Makefile
> creating perl/Makefile.PL
> creating port/master.mk
> creating port/Makefile
> 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'
> 
> [root@MFL-LW-SWAN src]# 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
> 
> makefile.log
> 
> cd perl && perl Makefile.PL POLLUTE=0
> Checking if your kit is complete...
> Looks good
> Writing Makefile for NetCDF
> 
> make.log
> 
> [root@MFL-LW-SWAN src]# make
> make[1]: Entering directory `/tmp/netcdf-perl-1.2.4/src'
> make[2]: Entering directory `/tmp/netcdf-perl-1.2.4/src'
> 
> making `dynamic' in directory /tmp/netcdf-perl-1.2.4/src/perl
> 
> make[3]: Entering directory `/tmp/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
> Please specify prototyping behavior for NetCDF.xs (see perlxs manual)
> gcc -c  -I/usr/local/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  \
> -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 `/tmp/netcdf-perl-1.2.4/src/perl'
> make[2]: *** [perl/dynamic] Error 1
> make[2]: Leaving directory `/tmp/netcdf-perl-1.2.4/src'
> make[1]: *** [decision] Error 2
> make[1]: Leaving directory `/tmp/netcdf-perl-1.2.4/src'
> make: *** [all] Error 2
> [root@MFL-LW-SWAN src]#
> 
> Dr. Pablo Santos
> National Weather Service
> Meteorologist In Charge
> 11691 SW 17th Terrace
> Miami, FL, 33165
> 305-229-4500


Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: QVK-623215
Department: Support netCDF Perl
Priority: Normal
Status: Closed