NSF Unidata

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

[netCDF #ULD-548860]: [netcdfgroup] NetCDF installation issues

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.



Hi Jenny,

Sorry to have taken so long to respond to your question.

> I'm having trouble installing/using NetCDF, and having looked at the website
> I hope I've picked the right mailing list. Sorry if I'm sending this in
> error.
> 
> I have a macbook pro and I'm new to compiling. I am trying to install NetCDF
> to use with a modelling program called FVCOM, which I also have to compile.
> I had compiled fvcom fine but then realised I needed NetCDF libraries
> installed. On my first attempt to install NetCDF, 'configure' produced this
> error:
> 
> *checking if Fortran "byte" is C "signed char"...
> configure: error: Could not link conftestf.o and conftest.o*

This usually indicates a mismatch between the Fortran compiler and the C 
compiler
found by the "configure" script.  For example, if you have g95 installed as a
Fortran compiler, and are using the Mac /usr/bin/gcc, you will get this error,
because g95 uses a different convention for calling C functions than is
supported by /usr/bin/gcc.  If you don't specify which Fortran or C compiler to
use with the FC and CC environment variables before invoking the configure
script, the script will just use whatever it can find installed in your PATH.

> and after searching online found that they suggested using this line of
> code instead, if you didn't need fortran installed.
> 
> *FC= ./configure*

That says you want to compile with no Fortran compiler, so it will not try
to compile, test, or install the Fortran interface for netCDF.

> as I have already got gfortran installed I thought that would be ok. It
> seemed to work, as after this was typed it compiled and installed fine.
> However, when I tried to compile FVCOM while linking to these libraries, it
> came up with this error:
> 
> *Can't open module file 'netcdf.mod' for reading at (1): No such file or
> directory*
> 
> And there is indeed no netcdf.mod file in the 'include' directory. I'm not
> sure where to go from here... as it seems to be a NetCDF issue at this point
> I thought here was the best place. I read in an archive something about
> telling NetCDF about the existing gfortran libraries when it configures -
> but I have no idea how to do that. Does anybody know how I fix this?

No netcdf.mod file was installed, because setting FC='' specified that you
didn't want or need a Fortran interface.

For MacOS X, I recommend getting gfortran and a compatible gcc, as we have
tested this combination and it works fine.  You can get them from here, for 
example:

  http://hpc.sourceforge.net/

--Russ





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



Ticket Details
===================
Ticket ID: ULD-548860
Department: Support netCDF
Priority: Critical
Status: Closed