没有合适的资源?快使用搜索试试~ 我知道了~
首页CMAQ安装笔记.pdf
资源详情
资源评论
资源推荐

一、 系统配置
uname -a 可显示电脑以及操作系统的相关信息
Linux bogon 3.10.0-862.el7.x86_64 x86_64 x86_64 x86_64 GNU/Linux
gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
lsb_release -a 显示的是发行版本信息
Description: CentOS Linux release 7.5.1804 (Core)
Release: 7.5.1804
Linux version 3.10.0-862.el7.x86_64 (builder@kbuilder.dev.centos.org)
(gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) )
CentOS Linux release 7.5.1804 (Core)
二、 安装 netcdf
参考网址:https://blog.csdn.net/schumacher2016/article/details/80850240
安装步骤如下:
1. 配置环境(很重要!!!)
在终端输入 export CC=gcc (本系统编译器为 gcc)
2. 开始安装
需要提前安装的库文件有:zlib 和 hdf5 将把这些安装在同一个目录下,方便后面的环
境变量配置。安装路径为:/usr/local/netcdf
安装包存放路径在:
1) 安装 zlib(应该是用于数据压缩,szip 安装同 zlib)
a) 下载地址:ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/
b) 解压 tar -zxvf zlib-1.2.8.tar.gz
c) 配置安装信息. ./configure --prefix=/usr/local/netcdf
其中可以使用/configure--help 来查看可以使用那些选项。这里选择默认选项安装。
d) 编译. Make
e) 检查. make check
f) 安装. make install
安装完成之后会在/usr/local/netcdf 这个目录下生成三个文件 lib include share
2) 安装 hdf5
a) 下载地址:ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/

b) 解压 tar -zxvf hdf5-1.8.13.tar.gz
c) 配置安装信息. ./configure --prefix=/usr/local/netcdf --with-zlib=/usr/local/netcdf
d) 编译 make
e) 检查编译信息 make check
f) 安装 make install
安装完成后,会被安装进/usr/local/netcdf 目录下的四个文件 lib include share bin 中.
3) 安装 curl(非必需)
a) 解压 tar curl-7.55.1.tar.gz
b) 配置安装信息. ./configure --prefix=/usr/local/netcdf --with-zlib=/usr/local/netcdf
c) 编译 make
d) 检查编译信息 make check
e) 安装 make install
4) 安装 netcdf-c
a) 下载地址 ftp://ftp.unidata.ucar.edu/pub/netcdf/old/
b) 解压 tar -zxvf netcdf-4.3.2.tar.gz
c) 配置安装信息 CPPFLAGS=-I/usr/local/netcdf/include LDFLAGS=-L/usr/local/netcdf
/lib ./configure --prefix=/usr/local/netcdf --disable-dap
d) 编译 make
e) 编译信息检查 make check
f) 安装 make install
5) 安装 netcdf c++库
a) tar xf netcdf- cxx4-4.3.0.tar.gz
b) cd netcdf- cxx4-4.3.0
c) LDFLAGS=-L/usr/local/netcdf/lib CPPFLAGS=-I/usr/local/netcdf/include ./configure --
enable-shared --prefix=/usr/local/netcdf
d) make
e) make check
f) sudo make install
6) 安装 netcdf-fortran
a) 告知库文件位置.终端中输入
export LD_LIBRARY_PATH=/usr/local/netcdf /lib:$LD_LIBRARY_PATH
b) 解压 tar -zxvf netcdf-fortran-4.4.0.tar.gz

c) 配 置 安 装 信 息 . CPPFLAGS=-I/usr/local/netcdf/include LDFLAGS=-
L/usr/local/netcdf/lib ./configure --prefix=/usr/local/netcdf
d) 编译 make
e) 编译信息检查 make check
f) 安装 make install
3. 配置环境变量
1) 配置环境变量
终端中输入 vim ~/.bashrc 按进入插入模式,输入如下信息
#netcdf4.4
export NETCDF=/usr/local/netcdf
export PATH=$NETCDF/bin:$PATH
export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH
export CPPFLAGS='-I/usr/local/netcdf/include'
export LDFLAGS='-L/usr/local/netcdf/lib'
输入完成保存退出(先按 esc 键,然后输入:wq 保存退出)
2) .使环境变量生效
终端中输入 source ~/.bashrc
4. 查看安装了那些组件
1) nc-config --all
This netCDF 4.3.2 has been built with the following features:
--cc -> gcc
--cflags -> -I/usr/local/netcdf4-needed/include -I/usr/local/netcdf4-needed/include
--libs -> -L/usr/local/netcdf4-needed/lib -lnetcdf
--has-c++ -> no
--cxx ->
--has-c++4 -> yes
--cxx4 -> yes
--fc -> gfortran
--fflags -> -I/usr/local/netcdf4-needed/include
--flibs -> -L/usr/local/netcdf4-needed/lib -lnetcdff -L/usr/local/netcdf4-needed/lib -lnetcdf
-lnetcdf
--has-f90 -> no
--has-dap -> no
--has-nc2 -> yes
--has-nc4 -> yes
--has-hdf5 -> yes

--has-hdf4 -> no
--has-pnetcdf-> no
--prefix -> /usr/local/netcdf4-needed
--includedir-> /usr/local/netcdf4-needed/include
--version -> netCDF 4.3.2
2) nf-config --all
ThisnetCDF-Fortran 4.4.0 has been built with the following features:
--cc -> icc
--cflags -> -I/usr/local/netcdf4-needed/include-I/usr/local/netcdf4-needed/include
--fc -> ifort
--fflags -> -I/usr/local/netcdf4-needed/include
--flibs -> -L/usr/local/netcdf4-needed/lib -lnetcdff-L/usr/local/netcdf4-needed/lib -lnetcdf -lnetcdf
--has-f90 -> no
--has-f03 -> yes
--has-nc2 -> yes
--has-nc4 -> yes
--prefix -> /usr/local/netcdf4-needed
--includedir->/usr/local/netcdf4-needed/include
--version -> netCDF-Fortran 4.4.0
三、 安装 mpich
1. 下载安装包安装
a) tar xf mpich-3.3.tar.gz
b) cd mpich-3.3
c) ./configure --prefix=/usr/local/mpich
d) make -j 4
e) make -j 4 check
f) sudo make -j 4 install
2. 设置环境变量:
在 ~/.bashrc 添加一下内容:
export PATH=/usr/local/mpich/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/mpich/lib:${LD_LIBRARY_PATH}
export MANPATH=/usr/local/mpich/share/man:${MANPATH}
3. 使环境变量生效
source ~/.bashrc
剩余19页未读,继续阅读






安全验证
文档复制为VIP权益,开通VIP直接复制

评论0