Installing NetCDF-Fortran
Procedure
- Use PuTTY to log in to the server as the root user.
- Run the following commands to load the compiler and Open MPI. If the commands have been run, skip this step.
export PATH=/path/to/GNU/bin:/path/to/OPENMPI/bin:$PATH export LD_LIBRARY_PATH=/path/to/GNU/lib64:/path/to/OPENMPI/lib:$LD_LIBRARY_PATH
- Run the following command to decompress the NetCDF-Fortran installation package:
tar zxvf netcdf-fortran-4.4.5.tar.gz
- Run the following command to go to the directory generated after the decompression:
cd netcdf-fortran-4.4.5
- Run the following commands to perform configuration:
export MPICC=mpicc export MPICXX=mpicxx export MPIFC=mpifort ./configure --prefix=$NETCDF --enable-shared --with-pic --disable-doxygen --enable-largefile --enable-static CPPFLAGS=" -I${HDF5}/include -I${NETCDF}/include" LDFLAGS=" -L${HDF5}/lib -L${NETCDF}/lib -Wl,-rpath=${HDF5}/lib -Wl,-rpath=${NETCDF}/lib" CFLAGS="-L${HDF5}/lib -L${NETCDF}/lib -I${HDF5}/include -I${NETCDF}/include" CXXFLAGS=" -L${HDF5}/lib -L${NETCDF}/lib -I${HDF5}/include -I${NETCDF}/include" FCFLAGS=" -L${HDF5}/lib -L${NETCDF}/lib -I${HDF5}/include -I${NETCDF}/include" CC=$MPICC CXX=$MPICXX FC=$MPIFC F77=$MPIFC - Run the following commands to perform the compilation and installation:
make -j 16 make install
- Run the following commands to load environment variables:
export PATH=/path/to/NETCDF/bin:$PATH export LD_LIBRARY_PATH=/path/to/NETCDF/lib:$LD_LIBRARY_PATH
Parent topic: Configuring the Compilation Environment