如何使用yum安装netcdf-cxx?
当我使用Yum安装NetCDF cxx时,遇到了一些问题。 首先,我使用以下代码进行安装:
>>> yum install -y netcdf-cxx netcdf-cxx-devel netcdf netcdf-devel
然后,我查看安装结果,发现/usr/lib64
目录下存在libnetcdf_c++.so
。那么,可以说安装成功了。
>>> locate libnet
/usr/lib64/.libnettle.so.4.7.hmac
/usr/lib64/.libnettle.so.4.hmac
/usr/lib64/libnetcdf.settings
/usr/lib64/libnetcdf.so
/usr/lib64/libnetcdf.so.7
/usr/lib64/libnetcdf.so.7.2.0
/usr/lib64/libnetcdf_c++.so
/usr/lib64/libnetcdf_c++.so.4
/usr/lib64/libnetcdf_c++.so.4.2.0
/usr/lib64/libnetcdff.so
/usr/lib64/libnetcdff.so.5
/usr/lib64/libnetcdff.so.5.3.1
/usr/lib64/libnettle.so.4
/usr/lib64/libnettle.so.4.7
/usr/share/perl5/Net/libnet.cfg
/usr/share/perl5/Net/libnetFAQ.pod
但是,当我执行 nc-config --all 时,结果是 NetCDF-cxx 没有安装。
This netCDF 4.3.3.1 has been built with the following features:
--cc -> gcc
--cflags -> -I/usr/include -I/usr/include/hdf
--libs ->
--has-c++ -> no
--cxx ->
--has-c++4 -> no
--cxx4 ->
--fc -> gfortran
--fflags -> -I/usr/include
--flibs -> -lnetcdff
--has-f90 -> yes
--has-dap -> yes
--has-nc2 -> yes
--has-nc4 -> yes
--has-hdf5 -> yes
--has-hdf4 -> yes
--has-pnetcdf-> no
--prefix -> /usr
--includedir-> /usr/include
--version -> netCDF 4.3.3.1
我应该如何使用 Yum 正确安装 netcdf-cxx
?
When I used Yum to install NetCDF cxx, I encountered some problems.
First, I use the following code to install:
>>> yum install -y netcdf-cxx netcdf-cxx-devel netcdf netcdf-devel
Then, I checked the installation results and found that libnetcdf_c++.so
exists in the /usr/lib64
directory. So,it can be said that the installation was successful.
>>> locate libnet
/usr/lib64/.libnettle.so.4.7.hmac
/usr/lib64/.libnettle.so.4.hmac
/usr/lib64/libnetcdf.settings
/usr/lib64/libnetcdf.so
/usr/lib64/libnetcdf.so.7
/usr/lib64/libnetcdf.so.7.2.0
/usr/lib64/libnetcdf_c++.so
/usr/lib64/libnetcdf_c++.so.4
/usr/lib64/libnetcdf_c++.so.4.2.0
/usr/lib64/libnetcdff.so
/usr/lib64/libnetcdff.so.5
/usr/lib64/libnetcdff.so.5.3.1
/usr/lib64/libnettle.so.4
/usr/lib64/libnettle.so.4.7
/usr/share/perl5/Net/libnet.cfg
/usr/share/perl5/Net/libnetFAQ.pod
However, when I execute nc-config --all
, the result is that NetCDF-cxx is not installed.
This netCDF 4.3.3.1 has been built with the following features:
--cc -> gcc
--cflags -> -I/usr/include -I/usr/include/hdf
--libs ->
--has-c++ -> no
--cxx ->
--has-c++4 -> no
--cxx4 ->
--fc -> gfortran
--fflags -> -I/usr/include
--flibs -> -lnetcdff
--has-f90 -> yes
--has-dap -> yes
--has-nc2 -> yes
--has-nc4 -> yes
--has-hdf5 -> yes
--has-hdf4 -> yes
--has-pnetcdf-> no
--prefix -> /usr
--includedir-> /usr/include
--version -> netCDF 4.3.3.1
What should I do to install netcdf-cxx
correctly using Yum?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在使用大约 10 年前的 netCDF 版本。正如您所注意到的,C++ 库似乎在那里,因此问题可能只是 nc-config 程序出现错误,而 netCDF C++ 则正常。要测试这一点,只需在构建 C++ 程序时使用 C 库标志,事情可能会正常工作。否则,请升级到更新的操作系统和 netCDF 版本:)
You are using a ~10 year old version of netCDF. As you note, it appears the C++ libraries are there, so the issue might simply be that the
nc-config
program is at fault and netCDF C++ is fine. To test this, just use the C-library flags when you build a C++ program and things might work fine. Otherwise, upgrade to a newer OS and netCDF version :)