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.
Chen, > To: address@hidden > From: <address@hidden> > Subject: > Organization: UCAR/Unidata The above message contained the following: > I am trying to install the netCDF package on my PC running linux > (Redhat 7.3). But I ran into some problems when I tried to make the > source codes. The steps I did are as follows: > > The shell I used was BASH. > > [root@localhost root]# cd /home/ > > [root@localhost home]# tar -xpf netcdf.tar > > > > [root@localhost home]# export CC=/usr/bin/gcc > > [root@localhost home]# export FC=/usr/bin/g77 > > [root@localhost home]# export FFLAGS="-O -Wno-globals" > > [root@localhost home]# export F90=/usr/pgi/linux86/bin/pgf90 > > [root@localhost home]# export CXX=/usr/bin/g++ On a Linux system and using the gcc compiler, the environment variable CPPFLAGS must contain the string "-Df2cFortran"; otherwise, the Fortran interface can't be built due the problem you encountered: ... > Making `all' in directory /home/netcdf-3.5.0/src/fortran > > > > make[2]: Entering directory `/home/netcdf-3.5.0/src/fortran' > > /usr/bin/gcc -c -O -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: > - MIPS cc and f77 2.0. (e.g. Silicon Graphics, DECstations, ...) - > IBM AIX XL C and FORTRAN Compiler/6000 Version 01.01.0000.0000 - VAX > VMS CC 3.1 and FORTRAN 5.4. - Alpha VMS > DEC C 1.3 and DEC FORTRAN 6.0. - Alpha OSF DEC > C and DEC Fortran for OSF/1 AXP Version 1.2 - Apollo DomainOS > 10.2 (sys5.3) with f77 10.7 and cc 6.7. - CRAY > - NEC SX-4 SUPER-UX > - CONVEX > - Sun > - PowerStation Fortran with Visual C++ > - HP9000s300/s700/s800 Latest test with: HP-UX > A.08.07 A 9000/730 - LynxOS: cc or gcc with f2c. The file INSTALL.html contains examples of building on a Linux system. Please try the following: 1. Go to the top-level source directory of the package. 2. Perform steps 3 through 5 described near the end of the file INSTALL.html 3. Ensure that the environment variable CPPFLAGS contains the string "-Df2cFortran", for example export CPPFLAGS=Df2cFortran or setenv CPPFLAGS Df2cFortran depending on your user-shell. 4. Perform steps 6 through 9 described near the end of the file INSTALL.html Please let me know if this helps. Regards, Steve Emmerson