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

[netCDF #IIA-403412]: NetCDF-4.0.1 shared library compiler options



Hi Sriki,

> I would like to build shared NetCDF pkg. to be used with netcdf-perl.
> 
> I was able to build Netcdf shared with pgi compilers but got an error in 
> running the test in netcdf-perl pkg.
> Perl on our system uses gcc.
> netcdf-perl support (Steve) told me to compile NetCDF using gcc also.
> 
> Could you please email me the compiler options to build a shared library to 
> be used with the netcdf-perl pkg.?

As far as I know, it should work to just specify CC=gcc and use the 
"--enable-shared" option
to the configure script when you build netCDF.  If your installed version of 
gcc is much
different from the version of gcc used to build perl, there may be a problem, 
but otherwise
it should work.

If it doesn't, an alternative would be rebuilding perl with the same version of 
pgcc you used
for the netcdf library.  The Portland Group has recently made available new 
information about
building various versions of netCDF with various versions of the PGI compilers 
on various
platforms:

  http://www.pgroup.com/resources/tips.htm#NETCDF

but I don't see any similar information for building perl ...

--Russ

> 
> I appreciate your help,
> sriki
> ************************************************************************
> uname -a
> Linux 2.6.9-55.ELsmp #1 SMP Fri Apr 20 16:36:54 EDT 2007 x86_64 x86_64 x86_64 
> GNU/Linux
> **************************************************************************
> gcc -v
> gcc -v
> Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
> --infodir=/usr/share/info --enable-shared --enable-threads=posix 
> --disable-checking --with-system-zlib --enable-__cxa_atexit 
> --disable-libunwind-exceptions --enable-java-awt=gtk 
> --host=x86_64-redhat-linux
> Thread model: posix
> gcc version 3.4.6 20060404 (Red Hat 3.4.6-8)
> ********************************************************************************
> pgf90 -V
> 
> pgf90 7.1-4 64-bit target on x86-64 Linux -tp p7-64
> Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
> Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
> *******************************************************************************
> perl -V
> perl -V
> Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
> Platform:
> osname=linux, osvers=2.6.9-22.18.bz155725.elsmp, 
> archname=x86_64-linux-thread-multi
> uname='linux hs20-bc1-3.build.redhat.com 2.6.9-22.18.bz155725.elsmp #1 smp 
> thu nov 17 15:34:08 est 2005 x86_64 x86_64 x86_64 gnulinux '
> config_args='-des -Doptimize=-O2 -g -pipe -m64 -Dversion=5.8.5 
> -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, 
> Inc. -Dinstallprefix=/usr -Dprefix=/usr -Dlibpth=/usr/local/lib64 /lib64 
> /usr/lib64 -Dprivlib=/usr/lib/perl5/5.8.5 
> -Dsitelib=/usr/lib/perl5/site_perl/5.8.5 
> -Dvendorlib=/usr/lib/perl5/vendor_perl/5.8.5 
> -Darchlib=/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi 
> -Dsitearch=/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi 
> -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi 
> -Darchname=x86_64-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib 
> -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db 
> -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio 
> -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr 
> -Dinc_version_list=5.8.4 5.8.3 5.8.2 5.8.1 5.8.0'
> hint=recommended, useposix=true, d_sigaction=define
> usethreads=define use5005threads=undef useithreads=define 
> usemultiplicity=define
> useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
> use64bitint=define use64bitall=define uselongdouble=undef
> usemymalloc=n, bincompat5005=undef
> Compiler:
> cc='gcc', ccflags ='-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',
> optimize='-O2 -g -pipe -m64',
> cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe 
> -I/usr/local/include -I/usr/include/gdbm'
> ccversion='', gccversion='3.4.6 20060404 (Red Hat 3.4.6-2)', gccosandvers=''
> intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
> d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
> ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
> alignbytes=8, prototype=define
> Linker and Libraries:
> ld='gcc', ldflags =''
> libpth=/usr/local/lib64 /lib64 /usr/lib64
> libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
> perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
> libc=/lib/libc-2.3.3.so, so=so, useshrplib=true, libperl=libperl.so
> gnulibc_version='2.3.4'
> Dynamic Linking:
> dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E 
> -Wl,-rpath,/usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/CORE'
> cccdlflags='-fPIC', lddlflags='-shared'
> 
> 
> Characteristics of this binary (from libperl):
> Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_64_BIT_INT 
> USE_64_BIT_ALL USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
> Built under linux
> Compiled at Jul 24 2006 18:28:14
> %ENV:
> PERL_MANDIR="."
> @INC:
> /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi
> /usr/lib/perl5/5.8.5
> /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi
> /usr/lib64/perl5/site_perl/5.8.4/x86_64-linux-thread-multi
> /usr/lib64/perl5/site_perl/5.8.3/x86_64-linux-thread-multi
> /usr/lib64/perl5/site_perl/5.8.2/x86_64-linux-thread-multi
> /usr/lib64/perl5/site_perl/5.8.1/x86_64-linux-thread-multi
> /usr/lib64/perl5/site_perl/5.8.0/x86_64-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.5
> /usr/lib/perl5/site_perl/5.8.4
> /usr/lib/perl5/site_perl/5.8.3
> /usr/lib/perl5/site_perl/5.8.2
> /usr/lib/perl5/site_perl/5.8.1
> /usr/lib/perl5/site_perl/5.8.0
> /usr/lib/perl5/site_perl
> /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi
> /usr/lib64/perl5/vendor_perl/5.8.4/x86_64-linux-thread-multi
> /usr/lib64/perl5/vendor_perl/5.8.3/x86_64-linux-thread-multi
> /usr/lib64/perl5/vendor_perl/5.8.2/x86_64-linux-thread-multi
> /usr/lib64/perl5/vendor_perl/5.8.1/x86_64-linux-thread-multi
> /usr/lib64/perl5/vendor_perl/5.8.0/x86_64-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.8.5
> /usr/lib/perl5/vendor_perl/5.8.4
> /usr/lib/perl5/vendor_perl/5.8.3
> /usr/lib/perl5/vendor_perl/5.8.2
> /usr/lib/perl5/vendor_perl/5.8.1
> /usr/lib/perl5/vendor_perl/5.8.0
> /usr/lib/perl5/vendor_perl
> ************************************************************************************
> 
> 

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: IIA-403412
Department: Support netCDF
Priority: Normal
Status: Closed