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

20040310: error in compiling netcdf

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.


  • Subject: 20040310: error in compiling netcdf
  • Date: Wed, 10 Mar 2004 08:49:30 -0700

Bernard,

>Date: Wed, 10 Mar 2004 00:48:58 +0100 (CET)
>From: Bernard Legras <address@hidden>
>Organization: ?
>To: Steve Emmerson <address@hidden>
>Subject: Re: 20040224: error in compiling netcdf 

The above message contained the following:

> This is a more detailed report on the problem of undefined pgiFortran
> when using pgi compiler.
> I do
> -bash-2.05b$ export F90=pgf90
> -bash-2.05b$ export F77=pgf90
> -bash-2.05b$ export CXX=c++
> -bash-2.05b$ export CC=gcc
> -bash-2.05b$ export FFLAGS="-O3 -fastsse -tp athlonxp -Minfo -Mextend"
> -bash-2.05b$ export F90FLAGS="-O3 -fastsse -tp athlonxp -Minfo -Mextend"
> -bash-2.05b$ export CFLAGS="-O3 -m32 -msse"
> -bash-2.05b$ ./configure --prefix=/usr/local
> in addition, I have also PGI=/usr/local/pgi
> 
> make returns
> 
> (...)
> 
> make[2]: Entering directory 
> `/home/priv/legras/install-mdk92-amd64/src/netcdf-3.5.1/src/fortran'
> gcc -c -O3 -m32 -msse -I../libsrc  -DNDEBUG fort-attio.c
> In file included from ncfortran.h:13,
>                  from fort-attio.c:6:
> cfortran.h:134:3: #error "cfortran.h:  Can't find your environment among:    
...

This is expected.  The C compiler must be told what Fortran-calling-C
conventions to use.  This is done by defining a C macro in the
environment variable CPPFLAGS before executing the "configure" script.
For the Portland Group Fortran compiler, this macro is "pgiFortran".
The installation instructions in the file "INSTALL.html" or on the
webpage

    http://my.unidata.ucar.edu/content/software/netcdf/INSTALL.html

contain examples of this.

> The compilation is OK if I put "#define pgiFortran" at the beginning of 
> cfortran.h

That's another way.  That netCDF distribution won't build on a different
system, however, which is why the examples show the use of the CPPFLAGS
envronment variable.

Regards,
Steve Emmerson