Installing NetCDF-Fortran
Procedure
- Use PuTTY to log in to the server as the root user.
- Run the following command to decompress the NetCDF-Fortran installation package:
tar -xvf netcdf-fortran-4.4.1.tar.gz
- Run the following command to go to the directory generated after the decompression:
cd netcdf-fortran-4.4.1
- Run the following commands to set environment variables before compilation:
export CPPFLAGS="-I/path/to/HDF5/include -I/path/to/NETCDF/include" export LDFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -Wl,-rpath=/path/to/HDF5/lib -Wl,-rpath=/path/to/NETCDF/lib" export CFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -I/path/to/HDF5/include -I/path/to/NETCDF/include" export CXXFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -I/path/to/HDF5/include -I/path/to/NETCDF/include" export FCFLAGS="-L/path/to/HDF5/lib -L/path/to/NETCDF/lib -I/path/to/HDF5/include -I/path/to/NETCDF/include"
- Run the following command to perform the configuration:
./configure --prefix=/path/to/NETCDF --build=aarch64-unknown-linux-gnu --enable-shared --with-pic --disable-doxygen --enable-largefile --enable-static
- Run the following commands to compile and install NetCDF-Fortran:
make -j 16 make install
- Run the following command to release the environment variables:
unset CC CXX FC F77 CPPFLAGS LDFLAGS CFLAGS CXXFLAGS FCFLAGS
Parent topic: Configuring the Compilation Environment