netcdf ビルドログ @ pifront
- 作業日 2021/05/24
- 作業者 高橋芳幸
前準備
$ export LC_CTYPE=C $ module load mpt
.bashrc にも書いておく
準備
必要なファイルの取得
必要なファイル
- netcdf
wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.8.0.tar.gz wget https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.5.3.tar.gz
ビルド
ビルドは ~/tmp/netcdf で行う.
netcdf-c
展開
$ tar xvf netcdf-c-4.8.0.tar.gz $ cd netcdf-c-4.8.0
環境変数の設定, configure, make
$ export NCDIR=$HOME/local/netcdf-c-4.8.0-fortran-4.5.3-hpe
$ export CC=gcc
$ export CXX=g++
$ export CPP=cpp
$ export CXXCPP=cpp
$ ./configure --prefix=${NCDIR}
$ make
$ make check
$ make install
netcdf-fortran
展開
$ tar xvf netcdf-fortran-4.5.3.tar.gz $ cd netcdf-fortran-4.5.3
環境変数の設定, configure, make
$ NFDIR=${NCDIR}
$ export LD_LIBRARY_PATH=${NCDIR}/lib:${LD_LIBRARY_PATH}
$ export F77=gfortran
$ export FC=gfortran
$ export CPPFLAGS="-I${NCDIR}/include"
$ export LDFLAGS="-L${NCDIR}/lib"
$ ./configure --prefix=${NFDIR}
$ make check |& tee make_check.log
$ make install |& tee install.log
.bashrc の編集
$ emacs -nw ~/.bashrc
export NCDIR=$HOME/local/netcdf-c-4.8.0-fortran-4.5.3-intel
export LD_LIBRARY_PATH=${NCDIR}/lib:${LD_LIBRARY_PATH}
export PATH=${NCDIR}/bin:${PATH}
参考情報
- https://www.unidata.ucar.edu/software/netcdf/docs/netCDF-CMake.html
- https://www.unidata.ucar.edu/software/netcdf/docs/building_netcdf_fortran.html