在Linux上安装netcdf4 ,解决"Can't find or link to the hdf5 library"的问题
2012-04-12 21:05
1116 查看
2 Quick Instructions for Installing NetCDF on Unix
Whohas time to read long installation manuals these days?
When building netCDF-4, you must first decide whether to support the use of HDF5 as a storage format.
2.1 Building NetCDF Without HDF5
If you don't want netCDF-4/HDF5, then build like this:./configure --prefix=/home/ed/local --disable-netcdf-4 make check install
(Replace “/home/ed/local” with the name of the directory where netCDF is to be installed.)
If you get the message that netCDF installed correctly, then you are done!
2.2 Building NetCDF With HDF5
If you want to use the HDF5 storage format, you must have the HDF5 1.8.6 release. You must also have the zlib compression library, version 1.2.5. Both of these packages are available from the netCDF-4 ftp site atftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.Make sure you run “make check” for the HDF5 and zlib distributions. They are very well-behaved distributions, but sometimes the build doesn't work (perhaps because of something subtly misconfigured on the target machine). If one of these libraries is not
working, netCDF will have serious problems.
Optionally, you can also build netCDF-4 with the szip 2.0 library (a.k.a. szlib). NetCDF cannot create szipped data files, but can read HDF5 data files that have used szip.
There are license restrictions on the use of szip, see the HDF5 web page: http://hdf.ncsa.uiuc.edu/doc_resource/SZIP/Commercial_szip.html. These license restrictions seem to apply to commercial users who are writing data. (Data readers
are not restricted.) But here at NetCDF World Headquarters, in Sunny Boulder, Colorado, there are no lawyers, only programmers, so please read the szip documents for the license agreement to see how it applies to your situation.
If you wish to use szip, get it from the HDF5 download page: http://hdfgroup.org/HDF5//HDF5/release/beta/obtain518.html href="http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install/Quick-Instructions.html" target=_blank>.
If “make check” fails for either zlib or HDF5, the problem must be resolved before the netCDF-4 installation can continue. For HDF5 problems, send email to the HDF5 help desk: help@hdfgroup.org.
Build zlib like this:
./configure --prefix=/home/ed/local make check install
Then you build HDF5, specifying the location of the zlib library:
./configure --with-zlib=/home/ed/local --prefix=/home/ed/local make check install
Note that for shared libraries, you may need to add the install directory to the LD_LIBRARY_PATH environment variable. See the FAQ for more details on using shared libraries:http://www.unidata.ucar.edu/netcdf/faq.html.
If you are building HDF5 with szip, then include the –with-szlib= option, with the directory holding the szip library.
After HDF5 is done, build netcdf, specifying the location of the HDF5, zlib, and (if built into HDF5) the szip header files and libraries in the CPPFLAGS and LDFLAGS environment variables.
CPPFLAGS=-I/home/ed/local/include LDFLAGS=-L/home/ed/local/lib ./configure --prefix=/home/ed/local make check install
Howdy Stephen!
The --with-hdf5 option has been removed from 4.1.3 (the current release)
and will not be in any future releases.
It might seem more robust, but it is not. It fails badly in the area of
32/64 bit platforms (i.e. platforms that want both a 32 bit and a 64 bit
version of the library installed at the same time.) It also adds a lot
of code to our build system.
The correct way to solve this is with the environment variables, which
leaves full control in the hands of the hands of the user.
The use of the --with options was an plot perpetrated by my evil twin,
who hates netCDF and all it stands for. He roams the Earth, attempting
to convince scientists to store their data in undocumented binary
formats. It makes for an awkward Thanksgiving dinner, but that's family
for you.
Thanks,
cd ../zlib-1.2.5
./configure --prefix=/usr/local/mylib
make check install -j 4
//---------------------------------------------------------------------------
cd hdf5-1.8.7
./configure --with-zlib=/usr/local/mylib --prefix=/usr/local/mylib
make check -j 5
make install
//---------------------------------------------------------------------------
export CPPFLAGS=-I/usr/local/mylib
export LDFLAGS=-L/usr/local/mylib
export LD_LIBRARY_PATH=/usr/local/mylib
//---------------------------------------------------------------------------
修改/etc/profile 改环境变量参数
export NETCDF=/usr/local/netcdf4
PATH=$PATH:$NETCDF/bin
相关文章推荐
- 解决:"Can not find the tag library descriptor for "http://java.sun.com/jsp/jst1/core""问题
- 关于Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/ core"问题解决
- 用VirtualBox 安装LFS常见问题的解决方法:“VFS: Unable to mount root device "hda1" or unknown-block(2,0)”
- Ubuntu 14.04下Redis安装报错:“You need tcl 8.5 or newer in order to run the Redis test”问题解决
- linux之Unable to find the ncurses libraries or the required header files.错误解决办法
- linux之Unable to find the ncurses libraries or the required header files.错误解决办法
- 解决安装vmware-tools出现的“The path "" is not a valid path to the 3.2.0-4-amd64 kernel headers”问题
- eclipse下taglib标准标签库问题Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"
- linux下mysql的卸载、安装全过程及遇到"MySQL提示:The server quit without updating PID file问题的解决办法"
- Can not find the tag library descriptor for "/struts-tags"问题
- 解决:Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"
- [iOS 问题解决]The certificate used to sign "ShowMe_iOS" has either expired or has been revoked.
- Ubuntu 14.04下Redis安装报错:“You need tcl 8.5 or newer in order to run the Redis test”问题解决
- Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" 解决办法
- 编译内核,make menuconfig 出现以下问题Unable to find the ncurses libraries or the及解决
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)
- 安装vmware-tools遇The path "" is not a valid path to the 3.8.13-44.1.1.el6uek.x86_64 kernel问题解决
- 问题解决:it could not find or load the Qt platform plugin "windows"
- Ubuntu 14.04下Redis安装报错:“You need tcl 8.5 or newer in order to run the Redis test”问题解决
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)