netcdf ビルドログ @ vizfront

  • 作業日 2018/09/18 修正
  • 作業者 高橋芳幸

準備

必要なファイルの取得

必要なファイル

  • netcdf
ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.4.1.1.tar.gz
ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-4.4.4.tar.gz

ビルド

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

展開

$ tar xvf netcdf-4.4.1.1.tar.gz
$ tar xvf netcdf-fortran-4.4.4.tar.gz

netcdf(-c)

環境変数の設定, configure, make

$ export CC=icc
$ export CXX=icpc
$ export CFLAGS='-O3 -xAVX -ip -no-prec-div -static-intel'
$ export CXXFLAGS='-O3 -xAVX -ip -no-prec-div -static-intel'
$ export CPPFLAGS="-I/home/G15023/yot/local/zlib-1.2.11-intel/include -I/home/G15023/yot/local/hdf5-1.8.20-intel/include"
$ export LDFLAGS="-L/home/G15023/yot/local/zlib-1.2.11-intel/lib -L/home/G15023/yot/local/hdf5-1.8.20-intel/lib"
$ export F77=ifort
$ export FC=ifort
$ export F90=ifort
$ export FFLAGS='-O3 -xAVX -ip -no-prec-div -static-intel'
$ export CPP='icc -E'
$ export CXXCPP='icpc -E'

$ cd netcdf-4.4.1.1

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

$ 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/