Installing NetCDF-C
Procedure
- Use PuTTY to log in to the server as the root user.
- Create an installation directory.
mkdir -p /path/to/netcdf
- Install the dependencies.
yum install curl libcurl-devel zlib-devel
- Go to the installation directory.
cd /path/to/netcdf
- Obtain the source package and rename it.
wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.3.3.1.tar.gz mv v4.3.3.1.tar.gz netcdf-4.3.3.1.tar.gz
- Decompress the source package.
tar -vxf netcdf-4.3.3.1.tar.gz
- Go to the directory generated after the decompression.
cd netcdf-c-4.3.3.1/
- Configure the compilation.
./configure --prefix=/path/to/netcdf --build=aarch64-linux --enable-shared --enable-netcdf-4 --enable-dap --with-pic --disable-doxygen --enable-static --enable-largefile CC=clang CXX=clang++ FC=flang F77=flang CPPFLAGS="-I/path/to/hdf5/include" LDFLAGS="-L/path/to/hdf5/lib -Wl,-rpath=/path/to/hdf5/lib" CFLAGS="-L/path/to/hdf5/lib -I/path/to/hdf5/include"

- Perform the compilation and installation.
make -j 8

make install

- Set the 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