netcdf4.2及以上版本的安装:For C and Fortran

http://bbs.06climate.com/forum.php?mod=viewthread&tid=15197

截止netcdf4.1.3版本,C lib和fortran lib没有分开。从4.2版本开始分开。这就导致了netcdf-fortran-4.2的安装麻烦了一点。先安装zlib和hdf5.

1,确保安装了netcdf C 库:
CPPFLAGS=-I/path/netcdf4.3-C/include LDFLAGS=-L/path/netcdf4.3-C/lib ./configure --prefix=/path/netcdf4.3-C CC=icc FC=ifort
--with-zlib=。。。。。
make
make check
sudo make install


2,For fortran-netcdf


export LD_LIBRARY_PATH=/path/netcdf4.3-all/lib:${LD_LIBRARY_PATH}(重要)


CPPFLAGS=-I/path/netcdf4.3-C/include LDFLAGS=-L/path/netcdf4.3-C/lib ./configure --prefix=/path/netcdf4.3-C CC=icc FC=ifort


make
make check
sudo make install

make install check


在.bashrc中设置一下就好了~~~


详细可参考:http://www.unidata.ucar.edu/soft ... ortran-install.html

推荐一种简易方法:哈佛大学GEOS_CHEM研究小组比较好~~~他把这些都集成了~~~你需要的话,可以去下载安装,一个命令,netcdf4.2-c,netcdf4.2-fortran和hdf5等等都安装好了~~~
-------+---------+-------------------------------------  
Config | Install |             Package  
-------+---------+------------------------------------- 
  ok   |   ok    | zlib-1.2.6     
  ok   |   ok    | hdf5-1.8.8     
  ok   |   ok    | netcdf-4.2     
  ok   |   ok    | netcdf-fortran-4.2
-------+---------+-------------------------------------

http://acmg.seas.harvard.edu/geos/doc/man/index.htmlor  
http://acmg.seas.harvard.edu/geos/doc/man/


安装方法如下:
本帖隐藏的内容
To build the netCDF-4.2 library (and the dependent ZLIB and HDF5 libraries) using the Intel Fortran Compiler (ifort), type one of the following commands:
make PREFIX=root_library_dir                         # If you have the Intel C compilersmake PREFIX=root_library_dir GCC=yes                 # If you don't have the Intel C compilers
To build the libraries for the PGI compiler, type one of the following commands:
make COMPILER=pgi PREFIX=root_library_dir            # If you have the PGI C compilersmake COMPILER=pgi PREFIX=root_library_dir GCC=yes    # If you don't have the PGI C compilers

GEOS-Chem-Libraries安装步骤
进入GEOS-Chem-Libraries
make PREFIX=root_library_dir GCC=yes(默认使用ifort编译器,GNU C/C++ compilers (gcc, g++))
安装成功后设置环境变量(在.bashrc中添加以下语句)
ROOT_LIBRARY_DIR=root_library_dir
GC_BIN=$ROOT_LIBRARY_DIR/bin
GC_INCLUDE=$ROOT_LIBRARY_DIR/include
GC_LIB=$ROOT_LIBRARY_DIR/lib
export GC_BIN
export GC_INCLUDE
export GC_LIB
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值