Problems with pgf90 and netcdf 4.1.1

Hi,

I’ve installed pgi 10.4 on our HPC cluster running SuSE SLES10SP2.
To install the latest netcdf software, hdf5 was installed, and netcdf could be compiled.

But when I try to use the netcdf I get sometimes this error message.
What does it mean ?


I used two example files from netcdf. One for f77 code, and the same for f90.

pgf90 sfc_pres_temp_rd.f
-I/usr/local/apps/netcdf/4.1.1_pgi/include
-L/usr/local/apps/netcdf/4.1.1_pgi/lib
-L/usr/local/apps/hdf/hdf5_pgi/lib
-lhdf5 -lhdf5_hl -lnetcdf

Is working without any failure.

pgf90 sfc_pres_temp_rd.f90
-I/usr/local/apps/netcdf/4.1.1_pgi/include
-L/usr/local/apps/netcdf/4.1.1_pgi/lib
-L/usr/local/apps/hdf/hdf5_pgi/lib
-lhdf5 -lhdf5_hl -lnetcdf

/usr/bin/ld:
/usr/local/apps/netcdf/4.1.1_pgi/lib/libnetcdf.a(netcdf4.o)(.data+0x3428):
reloc against `.text’: error 2
/usr/bin/ld: final link failed: Nonrepresentable section on output

What’s wrong ?

A second question:
We have a couple of different compiler installed (everybody has code witch only
get compiled using A,B,C …).

What is a good solution to set the env. automatically (with a single source command),
to set include paths, lib pathes etc. pp. ?
We are using gcc,gfortran,pgi,sun and intel ;(

Thanks and bye, Peer

Hi Perr,

/usr/bin/ld:
/usr/local/apps/netcdf/4.1.1_pgi/lib/libnetcdf.a(netcdf4.o)(.data+0x3428):
reloc against `.text': error 2
/usr/bin/ld: final link failed: Nonrepresentable section on output

I have not encountered this before nor have I been able to recreate the error here. How was NetCDF built? (i.e. what compiler environment variables were set before running configure). Also, if you used gcc to build the C portions for the library, which version of gcc did you use?

While most likely not related, UNIDATA did fix a bug in NetCDF that caused a problem when building with PGI 10.4. Just in case, you might try downloading the 4.1.2 package.

See: [netCDF #QKT-594390]: call nf90_open - error "type not consistent"


What is a good solution to set the env. automatically (with a single source command),

Have you tried using environment modules? http://modules.sourceforge.net/

  • Mat

Hi,

I could, after playing around with the compiler flags and building a new hdf5 (static and shared) successfully compile netcdf 4.1.1 and also the 4.1.2 beta.
I used the 10.6 PGI and 5 mins ago also the 10.9. Static libs are working correctly,
but running the configure script from netcdf always gives error messages like

checking whether the pgcc linker (pgf90 -m elf_x86_64) supports shared libraries… no

and finally no shared libs are created. But we need the shared libs for mpi code!

Any idea ?

export CXX=pgcpp
export F77=pgf90
export FC=pgf90
export LD=pgf90
export CFLAGS=“-O2” # also with -fPIC and/or -fpic
export FFLAGS=“-O2 -Msignextend” # also with -fPIC and/or -fpic
export CPPFLAGS=“-DpgiFortran” # also with -fPIC and/or -fpic

./configure --prefix=/usr/local/apps/netcdf/4.1.2-pgi106
–enable-netcdf4
–enable-shared
–disable-cxx
–with-hdf5=/usr/local/apps/hdf/hdf5_pgi106/