intall WRF on centos

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Maplematics/article/details/83018616

Install HDF5

下载:https://support.hdfgroup.org/HDF5/
tar -xf hdf5-1.8.18.tar

./configure --prefix=/usr/local/HDF5  --with-zlib=/usr/local/zlib --enable-fortran --enable-fortran2003

make (这一步会有很多 warning,不用管,只要保证 make check 成功)

make check
make install
make check-install

说明:1、在./configure 时,注意加上选项 --enable-fortran --enable-fortran2003,否则报错

ld: cannot find -lhdf5_fortran

参考:https://debug.fanzheng.org/post/hdf5-error-when-compiling-WRF.html

2、HDF5 是依赖于 zlib 的,若 zlib 未按照
默认路径安装,configure zlib部分必不可少。

Error

WRF HDF5 not set in environment

Add the following in the .bashrc file

export HDF5=/home/sss/hdf5
export PATH=/home/sss/hdf5/bin:$PATH
export LD_LIBRARY_PATH=/home/sss/hdf5/lib:$LD_LIBRARY_PATH

Install netcdf-c

下载: http://www.unidata.ucar.edu/software/netcdf/

export CC=icc
export CXX=icpc
export CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
export F77=ifort
export FC=ifort
export F90=ifort
export FFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
export CPP='icc -E'
export CXXCPP='icpc -E'
export CPPFLAGS=-I/usr/local/HDF5/include
export LDFLAGS=-L/usr/local/HDF5/lib
export LD_LIBRARY_PATH=$/usr/local/HDF5/lib
./configure --prefix=/usr/local/netcdf  --disable-netcdf-4
make
make check # This is just to check the compilation. You'd better not to skip this.
make install

error occured when make check

error while loading shared libraries: libimf.so

solution:

locate libimf.so

and found that

/opt/intel/composer_xe_2015.1.133/compiler/lib/ia32/libimf.so
/opt/intel/composer_xe_2015.1.133/compiler/lib/intel64/libimf.so
/opt/intel/composer_xe_2015.1.133/compiler/lib/mic/libimf.so
/opt/intel/itac/9.0.2.045/intel64/bin/rtlib/libimf.so

add the following line in the .bashrc file

export LD_LIBRARY_PATH="/opt/intel/composer_xe_2015.1.133/compiler/lib/intel64:$LD_LIBRARY_PATH"

source .bashrc

solved.

猜你喜欢

转载自blog.csdn.net/Maplematics/article/details/83018616