Installing NetCDF-Fortran
Procedure
- Use PuTTY to log in to the server as the root user.
- Go to the NetCDF-C installation directory you created in Installing NetCDF-Fortran.
cd /path/to/NETCDF
- Obtain the NetCDF-Fortran installation package.
wget https://codeload.github.com/Unidata/netcdf-fortran/tar.gz/refs/tags/v4.5.2 --no-check-certificate
- Rename and decompress the NetCDF-Fortran installation package.
mv v4.5.2 netcdf-fortran-4.5.2.tar.gz tar -zxvf netcdf-fortran-4.5.2.tar.gz
- Go to the directory generated after the decompression.
cd netcdf-fortran-4.5.2
- Perform the configuration.
./configure --prefix=/path/to/NETCDF --build=aarch64-unknown-linux-gnu --enable-shared --with-pic --disable-doxygen --enable-largefile --enable-static CC=gcc CXX=g++ FC=gfortran F77=gfortran CPPFLAGS="-I/path/to/HDF5/include -I/path/to/NETCDF/include" LDFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -Wl,-rpath=/path/to/HDF5/lib -Wl,-rpath=/path/to/NETCDF/lib"CFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -I/path/to/HDF5/include -I/path/to/NETCDF/include" CXXFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -I/path/to/HDF5/include -I/path/to/NETCDF/include" FCFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -I/path/to/HDF5/include -I/path/to/NETCDF/include"

- Perform the compilation and installation.
make -j

make install

- Verify the installation.
ls /path/to/NETCDF/bin ls /path/to/NETCDF/lib
If the following information is displayed, the installation is successful:

Parent topic: Configuring the Compilation Environment