如何使用yum安装netcdf-cxx?

发布于 2025-01-13 04:32:40 字数 1512 浏览 4 评论 0原文

当我使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

茶花眉 2025-01-20 04:32:40

您正在使用大约 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 :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文