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

Re: 20011216: NetCDF install problems on Mac OS 10



>cc: address@hidden
>From: Andrew Robertson <address@hidden>
>Subject: NetCDF install problems on Mac OS 10
>Organization: International Research Institute for climate prediction (IRI)
>Keywords: 200112161314.fBGDElN16168 netCDF MacOS-10

Hi Andy,

> I'm having trouble installing NetCDF on Macintosh OS X 10.1.1 . The
> command "make" gives an error, and there seem to be errors in
> config.log & configure.log. Diagnostic items A-F are listed below.
 ...
> A)
> [localhost:netcdf/netcdf-3.5.0/src] root# uname -a
> Darwin localhost 5.1 Darwin Kernel Version 5.1: Tue Oct 30 00:06:34 PST 
> 2001; root:xnu/xnu-201.5.obj~1/RELEASE_PPC  Power Macintosh powerpc
> 
> B)
> [localhost:netcdf/netcdf-3.5.0/src] root# more VERSION
> 3.5.0
> 
> C)
> [localhost:netcdf/netcdf-3.5.0/src] root# which $CC; which $FC
> /usr/bin/cc
> /usr/local/bin/f2c

The first problem is that /usr/local/bin/f2c can't be used directly as
the Fortran compiler; instead, use /usr/local/bin/fc which is a script
that calls f2c that should have been installed when you installed f2c.

> D)
> [localhost:netcdf/netcdf-3.5.0/src] root# more configure.log
> creating cache ./config.cache
> checking for top-level source-directory
> /Users/andy/netcdf/netcdf-3.5.0/src
> checking for m4 preprocessor
> checking for m4... m4
> checking m4 flags...
> checking C compiler "/usr/bin/cc"... works
> checking how to make dependencies... false
> checking how to run the C preprocessor... /usr/bin/cc -E -traditional-cpp
> checking user-defined Fortran-77 compiler "/usr/local/bin/f2c"... works
> checking for Fortran preprocessor... cc -E -C
> checking user-defined Fortran-90 compiler " "... failed to compile test 
> program
> configure: warning: The Fortran-90 interface will not be built
> checking for nm utility
> checking for nm... nm
> checking nm flags...
> checking for C-equivalent to Fortran routine "SUB"... nm: can't open 
> file: conft
> est.o (No such file or directory)
> configure: error: not found

Use of f2c instead of fc explains the above error, since f2c won't
make a ".o" file from a ".f" file.

After you change the FC environment variable, just delete config.cache
and run the configure script again.  Expect some errors in config.log;
they occur normally in compiling test programs to determine the
compilation environment before creating Makefiles.  There will be some
warning messages you can ignore.  

I just tried it on a Mac OS X 10.1.1 system with the settings:

 CC=/usr/bin/cc
 CPPFLAGS=-Df2cFortran
 FC=/sw/bin/fc         # this is where "fink" installed f2c on our system
 FFLAGS=-w
 F90=''
 M4FLAGS=''

and "make all" seemed to work OK.  To get "make test" to work I had to
make sure the environment variable FPP was unset, although we had been
recommending FPP='cc -E -C' in our INSTALL instructions.  I've just
changed the INSTALL web page to reflect this change:

  http://www.unidata.ucar.edu/packages/netcdf/INSTALL.html#macosx

--Russ