终于安装成功,用了一个下午,记录如下,以供他人参考:
1.下载netcdf安装包,from:
http://www.unidata.ucar.edu/downloads/netcdf/index.jsp
我下载的目前最新版本4.1.3,但是其实4.1.1就够用了,因为安装过程中我disable掉了4.1.3中比4.1.1改进的地方,比如,hdf4.
2.解压 tar -zxvf netcdf-4.1.3.tar.gz
3. 在解压后的netcdf-4.1.3所在目录执行:
./configure --disable-dap --disable-netcdf-4 --prefix=/usr/local/netcdf
注意:上面红色的两个选项是他人很多次实验后证明必须的(参考资料1)。--disable-dap的原因是缺少一个‘curl’的lib, --disable-netcdf-4是报错中提出的解决办法,尽管我个人暂时没有搞清楚为什么。不写这两个,在configure的时候就会报错,导致后面make失败。
4. make
5. make install,提示安装成功的同时,还会提醒make check,下一步进行。
6. make check
备注:以下为各个步骤执行命令的解释:
$ ./configure
The configuration script will set up the
Makefiles that will be used to build the NetCDF libraries and utilities. It
will also set up the installation directory for the default location of
/usr/local.
If you would like to install the libraries
in another location, use this configure command:
$ ./configure
--prefix=/your/desired/install/directory)
$ make----Make the
libraries
When the
configuration step completes successfully, you can build the libraries using
‘make’.
$ make check-----Testing
NetCDF on Linux*
You can test your
NetCDF libraries using ‘make check’.
$ make install------Installing
NetCDF on Linux*
Install NetCDF
libraries using ‘make install’.
This will install the NetCDF libraries,
include files, and utilities in the default location of /usr/local or the
location specified in the configuration step with the --prefix= option.
参考资料:http://xiaozu.renren.com/xiaozu/106455/335340303 搞定Ubuntu:单机WRF安装(这个解决了我安装中出现的错误,就是disable那两项)
http://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2011/msg00143.html (安装过程我出现了类似的错误,cant find or link to zlibrary;libtool: compile:failed to create '.libs')
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install.html NetCDF installation and porting guide,也有pdf版本
转载本文请联系原作者获取授权,同时请注明本文来自赵丽莉科学网博客。
链接地址:http://blog.sciencenet.cn/blog-237238-547593.html
上一篇:著名建筑学家吴良镛-“面对面”谈城市科学建筑与规划(人居环境
下一篇:国家气象中心气象数据特殊值含义30XXX,31XXX,32XXX