mkdir -p /path/to/NETCDF
yum install curl* -y
cd /path/to/NETCDF
wget https://codeload.github.com/Unidata/netcdf-c/tar.gz/refs/tags/v4.7.3 --no-check-certificate
mv v4.7.3 netcdf-c-4.7.3.tar.gz tar -zxvf netcdf-c-4.7.3.tar.gz
cd netcdf-c-4.7.3
./configure --prefix=/path/to/NETCDF --build=aarch64-unknown-linux-gnu --enable-shared --enable-netcdf-4 --enable-dap --with-pic --disable-doxygen --enable-static --enable-largefile CC=gcc CXX=g++ FC=gfortran F77=gfortran 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"
make -j
make install
ls /path/to/NETCDF/bin ls /path/to/NETCDF/lib
回显信息显示如下内容,表示安装成功。
export PATH=/path/to/NETCDF/bin:$PATH export LD_LIBRARY_PATH=/path/to/NETCDF/lib:$LD_LIBRARY_PATH