因安装libradtran之前,在系统中安装了UNL-VTRM,两个软件其中有一些配置是一样的,下面的内容是我所有安装的过程,可能有些步骤libradtran不需要。(libradtran必须要安装zlib,gsl,gmp,netcdf,只对这几个软件进行安装,在安装过程可能还需要其他依赖包,这里只是分享了我从之前配置好的环境到安装libradtran所有的过程)
(以下命令均用root身份执行)
一、依赖包安装1、在安装依赖包之前需要将gcc升级,以下所有软件的最好在gcc升级后的情况下进行配置编译
2、安装parallel_studio_xe_2018_update4_cluster_edition
tar -xzvf parallel_studio_xe_2018_update4_cluster_edition.tgz cd parallel_studio_xe_2018_update4_cluster_edition ./install_GUI.sh
输入./install_GUI.sh进入界面化安装以后:
1)默认,阅读完用户协议以后输入accept;
2)默认即可;
3)激活Lic,选择用lic文件激活,输入激活文件lic的完整路径;
4)以后的步骤默认即可。
3、安装m4
tar zxf m4-1.4.18.tar.gz cd m4-1.4.18 ./configure make make check make install二、netcdf安装
在安装之前需要对环境变量进行配置:
export CC=icc
export CXX=icpc
export FC=ifort
export F90=ifort
export F77=ifort
1、安装zlib
tar -zxvf zlib-1.2.8.tar.gz ./configure --prefix=/usr/local/netcdf4-needed make make check make install
2、安装hdf5
tar -zxvf hdf5-1.10.5.tar.gz ./configure --prefix=/usr/local/netcdf4-needed --with-zlib=/usr/local/netcdf4-needed/ make make install
3、安装netcdf-c
tar -zxvf netcdf-4.6.2.tar.gz CPPFLAGS=-I/usr/local/netcdf4-needed/include LDFLAGS=-L/usr/local/netcdf4-needed/lib ./configure --prefix=/usr/local/netcdf4-needed --disable-dap make make check make install
4、安装netcdf-fortran
export LD_LIBRARY_PATH=/usr/local/netcdf4-needed/lib:$LD_LIBRARY_PATH tar -zxvf netcdf-fortran-4.5.0.tar.gz CPPFLAGS=-I/usr/local/netcdf4-needed/include LDFLAGS=-L/usr/local/netcdf4-needed/lib ./configure --prefix=/usr/local/netcdf4-needed make make check make install
5、在~/.bashrc中配置环境信息
#netcdf4.4 export NETCDF=/usr/local/netcdf4-needed export PATH=$NETCDF/bin:$PATH export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH export CPPFLAGS='-I/usr/local/netcdf4-needed/include' export LDFLAGS='-L/usr/local/netcdf4-needed/lib'三、libradtran安装
1、安装gsl
tar zxf gsl-2.7.tar.gz cd gsl-2.7 ./configure make make check make install
2、安装gmp
tar:xz -d gmp-6.2.1.tar.xz tar xvf gmp-6.2.1.tar cd gmp-6.2.1 ./configure make make check make install
3、安装好所有的依赖包之后,对gsl,netcdf,ifport库进行配置
在终端中输入 gedit /etc/profile进行编辑,输入(以下路径分别为gsl库,netcdf和ifport库的路径,可以用find / -name libnetcdff.so,find / -name libgsl.so,find / -name libifport.so分别查找其所在路径):
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/netcdf4-needed/lib:/opt/intel/compilers_and_libraries_2018.5.274/linux/compiler/lib/intel64_lin
4、libradtran
tar -xvf libRadtran-2.0.4.tar.gz cd libRadtran-2.0.4 ./configure --with-libnetcdf=/usr/local/netcdf4-needed make make check make install
我在对libradtran进行编译的时候报错:/opt/xxx/xxx/xxx/xxx/ld:warning libifport.so.5, needed by /usr/local/xxx/xxx/libnetcdf.so.5 not found (try using -rpath or -rpath- link)
提示缺少链接文件,libifport.so.5,但是我在报错中提示的路径当中找到了该文件,说明不是文件丢失,可以通过环境变量配置将路径添加进去:
通过命令查找 find / -name libifport.so.5位置,例如查找到的路径为/opt/local/netcdf/lib/libifport.so.5,在~/.bashrc中添加
export LD_LIBRARY_PATH=/opt/local/netcdf/lib/:$LD_LIBRARY_PATH
重新配置 编译就不会报错了。



