netcdf ビルドログ @ vizfront

  • 作業日 2019/08/12
  • 作業者 高橋芳幸

準備

必要なファイルの取得

必要なファイル

  • netcdf
https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.7.0.tar.gz
https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.4.5.tar.gz

ビルド

ビルドは ~/tmp/netcdf で行う.

展開

$ tar xvf netcdf-c-4.7.0.tar.gz
$ tar xvf netcdf-fortran-4.4.5.tar.gz

netcdf-c

環境変数の設定, configure, make

$ export NCDIR=/home/G15023/yot/local/netcdf-c4.7.0-gcc-f4.4.5-ifort
$ export CC=gcc
$ export CFLAGS=
$ export F77=ifort
$ export FC=ifort
$ export F90=ifort
$ export FFLAGS='-convert big_endian -assume byterecl'
$ export CPPFLAGS="-I/home/G15023/yot/local/zlib-1.2.11-gnu/include -I/home/G15023/yot/local/hdf5-1.8.20-gnu/include"
$ export LDFLAGS="-L/home/G15023/yot/local/zlib-1.2.11-gnu/lib -L/home/G15023/yot/local/hdf5-1.8.20-gnu/lib"
$ export CPP=cpp

$ cd netcdf-c-4.7.0

$ ./configure --prefix=${NCDIR} --disable-dap --enable-netcdf-4 --enable-byterange

$ make |& tee make.log
$ make check
$ make install |& tee install.log

netcdf-fortran

環境変数の設定, configure, make

$ cd ../netcdf-fortran-4.4.4

$ export LD_LIBRARY_PATH=/home/G15023/yot/local/netcdf-4.4.1.1-fortran-4.4.4-intel/lib:${LD_LIBRARY_PATH}
$ export CPPFLAGS="-I/home/G15023/yot/local/netcdf-4.4.1.1-fortran-4.4.4-intel/include"
$ export LDFLAGS="-L/home/G15023/yot/local/netcdf-4.4.1.1-fortran-4.4.4-intel/lib"

$ ./configure --prefix=/home/G15023/yot/local/netcdf-4.4.1.1-fortran-4.4.4-intel

$ make |& tee make.log
$ make check
$ make install |& tee install.log

.bash_profile の編集

$ emacs -nw ~/.bash_profile

LD_LIBRARY_PATH=/home/G15023/yot/local/netcdf-4.4.1.1-fortran-4.4.4-intel/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

参考情報

  • https://software.intel.com/en-us/articles/performance-tools-for-software-developers-building-netcdf-with-the-intel-compilers/