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.
Peter, > I have given this a go and have now hopefully installed HDF5. Good! The next step requires that you build and install the netCDF C library before you can build and install netCDF Fortran. Were you able to build and install the netCDF C library, which uses the HDF5 library you just installed? Documentation for how to do this is here: http://www.unidata.ucar.edu/netcdf/docs/getting_and_building_netcdf.html#build_default and here's an example of how to do this, assuming you're using a Unix shell that sets environment variables in the standard way: $ cd /path/to/netcdf-C/source/directory $ NCDIR=/home/mse_sw/netcdf # where you want to install the netCDF C library $ H5DIR=/home/mse_sw/hdf5 # where you have already installed the HDF5 library $ CPPFLAGS="-I${H5DIR}/include" LDFLAGS="-L${H5DIR}/lib" ./configure --prefix=${NCDIR} $ make check $ make install Then you can build and install netCDF-Fortran as described in detail here: http://www.unidata.ucar.edu/netcdf/docs/building_netcdf_fortran.html An example for how this might look for you is: $ cd /path/to/netcdf-Fortran/source/directory $ NFDIR=/home/mse_sw/netcdf-4.4.1 # where you want to install the netCDF-Fortran library $ LD_LIBRARY_PATH=${NCDIR}/lib CPPFLAGS="-I${NCDIR}/include" LDFLAGS="-L${NCDIR}/lib" \ FC=ifort F77=ifort ./configure --prefix=${NFDIR} $ make check $ make install This is assuming the defaults, installing the HDF5 and netCDF-C libraries as shared libraries. > However, when trying to install NetCDF-Fortran-4.4.1 I tried to configure > using the following > > ./configure --prefix=/home/mse_sw/netcdf-4.4.1 --enable-f90 F77=ifort FC=ifort > > We want to link to ifort on the our system so hence the F77 & FC, > But im not sure this is right or even enough?? > > This gives me a WARNING: unrecognized options: --enable-f90 > But seems to run through OK. Right, --enable-f90 is not one of the options this configure script understands, because it's not included in the output from invoking $ ./configure --help > When I then try to run make check > This results in errors which I don't understand > make[2]: *** [nf_test] Error 1 > make[2]: Leaving directory `/home/SF_SRC/netcdf-fortran-4.4.1/nf_test' > make[1]: *** [check-am] Error 2 > make[1]: Leaving directory `/home/SF_SRC/netcdf-fortran-4.4.1/nf_test' > make: *** [check-recursive] Error 1 > [root@fotcluster2 netcdf-fortran-4.4.1]# I don't understand those errors either, as there's not enough context. > I'm afraid I don't full understand how to set the various flags such as > CPPFLAGS etc. > Also when linking HDF5 to zlib we used the --with-zlib command. > > But how does NETCDF know where HDF5 and zlib is installed. It doesn't use the --with-hdf5 option, but instead uses the values of the CPPFLAGS and LDFLAGS environment variables. > I'm really sorry for troubling you, but this is a little beyond my knowledge > and any help would be most appreciated. > Also an explanation to setting flags and how to would be most appreciated. I hope the examples above are sufficient. If you're using csh as your shell instead of a standard Unix shell such as bash or ksh, you'll need to use different syntax, as explained in the building_netcdf_fortran.html doc referenced above. --Russ > Regards > Peter Mills > > > ________________________________________ > From: Peter Mills > Sent: 22 January 2015 15:32 > To: address@hidden > Subject: RE: [netCDF #QFD-237189]: netcdf-c-4.3.3 (TWO CHECKS FAILED) > > Hi Russ, > > I have tried to install zlib and hdf5 but get errors during the make check of > HDF5. > I have summarised my steps and have copy the log files to the bottom of this > email > > Would you be able to have a look and let me know what the problem is, please. > > Our system is Centos 6.6, with Fortran Compiler and C Compiler installed. > > To access these I loaded a module environment file. > > Steps taken > > I have download and installed zlib.1.2.8 > Configured using the following commands > > ./configure –prefix=home/mse_sw/zlib.1.2.8 > make check > make install > > this seems to have installed well. > > I then tried to install hdf5 using the following commands to configure > > ./configure --prefix=/home/mse_sw/hdf5 --enable-fortran --enable-cxx > --with-zlib=/home/mse_sw/zlib.1.2.8/ >> compile.txt (SEE BELOW) > > This seems to go well but I get loads of warnings similar to this: > > plugin.c:303: warning: will never be executed > plugin.c:303: warning: will never be executed > plugin.c:303: warning: will never be executed > plugin.c:303: warning: will never be executed > plugin.c:305: warning: will never be executed > plugin.c:305: warning: will never be executed > plugin.c:305: warning: will never be executed > plugin.c:305: warning: will never be executed > plugin.c:305: warning: will never be executed > plugin.c:307: warning: will never be executed > plugin.c:307: warning: will never be executed > plugin.c:307: warning: will never be executed > plugin.c:307: warning: will never be executed > plugin.c:307: warning: will never be executed > > > Then when I try to do a make check, once again this all seems to go wrong - > see make _check.txt > > I would be really grateful if you could advise me what is wrong and if I have > missed any vital steps. > > I haven’t set any environment variables for flags such as CC , FC etc > > > ----------------------------------------------------------------------------------------------------------------------------------------------- > ________________________________ > [http://www.plymouth.ac.uk/images/email_footer.gif]<http://www.plymouth.ac.uk/worldclass> > > This email and any files with it are confidential and intended solely for the > use of the recipient to whom it is addressed. If you are not the intended > recipient then copying, distribution or other use of the information > contained is strictly prohibited and you should not rely on it. If you have > received this email in error please let the sender know immediately and > delete it from your system(s). Internet emails are not necessarily secure. > While we take every care, Plymouth University accepts no responsibility for > viruses and it is your responsibility to scan emails and their attachments. > Plymouth University does not accept responsibility for any changes made after > it was sent. Nothing in this email or its attachments constitutes an order > for goods or services unless accompanied by an official order form. > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: QFD-237189 Department: Support netCDF Priority: Normal Status: Closed