Installing NetCDF-Fortran
Procedure
- Download the NetCDF-Fortran source package.
- Upload the source package to its installation directory on the server, for example, /path/to/download/netcdf-fortran.
- Go to the source package directory.
cd /path/to/download/netcdf-fortran
- Decompress the installation package.
tar -zxvf netcdf-fortran-4.5.2.tar.gz
- Switch to the directory of the configure script.
cd netcdf-fortran-4.5.2
- Install NetCDF-Fortran.
./configure --prefix=/path/to/install/NETCDF --build=aarch64-unknown-linux-gnu --enable-shared --with-pic --disable-doxygen --enable-largefile --enable-static CC=mpicc CXX=mpicxx FC=mpifort F77=mpifort CPPFLAGS=" -fPIC -I/path/to/install/HDF5/include -I/path/to/install/NETCDF/include" LDFLAGS="-L/path/to/install/HDF5/lib -L/path/to/install/NETCDF/lib -Wl,-rpath=/path/to/install/HDF5/lib -Wl,-rpath=/path/to/install/NETCDF/lib" CFLAGS=" -fPIC -L/path/to/install/HDF5/lib -L/path/to/install/NETCDF/lib -I/path/to/install/HDF5/include -I/path/to/install/NETCDF/include" CXXFLAGS=" -fPIC -L/path/to/install/HDF5/lib -L/path/to/install/NETCDF/lib -I/path/to/install/HDF5/include -I/path/to/install/NETCDF/include" FCFLAGS=" -fPIC -L/path/to/install/HDF5/lib -L/path/to/install/NETCDF/lib -I/path/to/install/HDF5/include -I/path/to/install/NETCDF/include"
- Modify the libtool file in the current directory.
vi libtool
In line 11787, change wl="" to wl="-Wl,".
In line 11939, change wl="" to wl="-Wl,".
The line numbers may vary according to each NetCDF-Fortran version. Search for wl="" to determine the line numbers.
- Perform the compilation and installation.
make make install
Parent topic: Configuring the Compilation Environment