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 Vitali, > I need to install netcdf which to be used by a fortran program on a > linux (ubuntu 11.04) machine. Though I am an experienced computer user, > I've got lost in those multiple options on your website. > > So I downloaded netcdf-fortran-4.2.tar.gz. The package has README but > the INSTALL file with instructions is missing. > > I've tried to run ./configure, but it fails and complains about missing > netcdf.f file > > Do I need to install netcdf for C first? Yes, see: Building netCDF-Fortran Libraries http://www.unidata.ucar.edu/netcdf/docs/netcdf-fortran-install.html which is one of the links on this page that describes how to install the netCDF C library first: Building NetCDF http://www.unidata.ucar.edu/netcdf/docs/building.html > Could you just make a short example in the INSTALL file what steps are > actually needed to install on a typical linux system: > > like > download netcdf-fortran-4.2.tar.gz, uncompress, > $ ./configure > $ make compile > $ make install > or something like this? Yes, that's close. To get all the defaults, you can just do: $ ./configure $ make check $ make install and that will install the C libraries, utilities, and header files in the lib/, bin/, and include/ directories under /usr/local (or whatever you specify as the --prefix=... option to the configure script). Then building the Fortran library is similar, except you need to the configure script where you installed the netCDF C libraries, if it can't find them. > Maybe I don't need to compile netcdf and there is already a binary which > I can install with > > sudo apt-get install netcdf or something like this? Yes, but you won't necessarily get the most recent version from package management systems. For Fedora Linux, for example, you can use $ sudo yum install netcdf.x86_64 or $ sudo yum install netcdf-devel.x86_64 depending on whether you just want the binaries or you also need the sources. > As your website indicates: > > The easiest way to get netCDF is through a package management program, > such as rpm, yum, adept, and others. > NetCDF is available from many different repositories, including the > default Red Hat and Ubuntu repositories. > > Could you give just an simple example how exactly to use rpm, yum? > > You really need to make simple instructions with a typical example in > a single place. Yes, things could be simpler. But they couldn't be cheaper :-) ... --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: ZCZ-420791 Department: Support netCDF Priority: Normal Status: Closed