netcdf ビルドログ @ pi-VizStudio

  • 作業日 2017/07/04
  • 作業者 松田幸樹

準備

必要なファイルの取得

必要なファイル

  • 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/opt/HDF5/1.8.15-p1-icc/include"
$ export LDFLAGS="-L/opt/HDF5/1.8.15-p1-icc/lib64"
$ 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
$ mkdir -p ~/local/netcdf-4.4.1.1-fortran-4.4.4-intel

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

$ 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/matsudak/local/netcdf-4.4.1.1-fortran-4.4.4-intel/lib:${LD_LIBRARY_PATH}
$ export CPPFLAGS="-I/home/G15023/matsudak/local/netcdf-4.4.1.1-fortran-4.4.4-intel/include"
$ export LDFLAGS="-L/home/G15023/matsudak/local/netcdf-4.4.1.1-fortran-4.4.4-intel/lib"

$ ./configure --prefix=/home/G15023/matsudak/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/matsudak/local/netcdf-4.4.1.1-fortran-4.4.4-intel/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH