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

[Support #STV-915256]: Problems building netcdf

Hi Peer,

> I'm currently trying to build netcdf 3.6.3
> on our HPC cluster. We are running SLES10SP2 (x86_64).
> The build worked without any problems for the gcc and gfortran.
> But for the sun compiler (sun studio 12.1) the fortran interfaces
> seems to be missing.
> The build is working without any faults.
> Running the test (make check) shows
> test_get.o: In function `test_nf_get_var1_text_':
> test_get.F:(.text+0x35): undefined reference to `nf_open_'
> test_get.F:(.text+0x103): undefined reference to `nf_get_var1_text_'
> All the nf_ stuff is missing.
> I'll set the following env.:
> xport CPPFLAGS="-Df2cFortran -D__FUNCTION__=__func__ -DsunFortran"
> export CC=suncc
> export FC=sunf90
> export F90=sunf90
> export CXX=sunCC
> export CFLAGS=-fast
> export FFLAGS="-dalign -fast"
> export FCFLAGS="-dalign -fast"
> ./configure --enable-shared --enable-separate-fortran
> --prefix=/usr/local/apps/netcdf/3.6.3_sun
> The rest is working well - any idea ?

I suspect having both -Df2cFortran and -DsunFortran included in the
CPPFLAGS is a problem, as these indicate different, and possibly
conflicting, conventions for calling C functions from Fortran.

A report from a user of a build that works for Sun Studio 12 compilers
for netCDF-4.1 is here:


Note that if you get the latest source version 4.1.1


and build it on a platform that has no HDF5 library installed or by 
explicitly specifying "--disable-netcdf-4", then it will build just 
the netCDF-3 APIs, such as were provided in version 3.6.3.  Several 
bugs have been fixed since the release of 3.6.3, and there have also 
been some portability fixes, so it may work better for you.

Please let us know if the above ideas don't solve the problem.


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

Ticket Details
Ticket ID: STV-915256
Department: Support netCDF
Priority: Normal
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.