Octave 软件包安装 netcdf:未找到 nc-config

问题描述

我在 Mac (OSX 10.15.7 Catalina) 上使用 Octave(-gui) 并尝试安装 netcdf 包。我收到一个错误提示未找到 nc-config。 我的 Octave 版本是 6.1.0。我也尝试从本地 tar.gz 安装。 这是我的 Octave 控制台的输出

>> pkg install -forge netcdf

configure: error: nc-config not found
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ -std=gnu++11 accepts -g... yes
checking for mkoctfile... /Applications/Octave-6.1.0.app/Contents/Resources/usr/Cellar/octave-octave-app@6.1.0/6.1.0/bin/mkoctfile-6.1.0
checking for nc-config... no

error: pkg: error running the configure script for netcdf.
error: called from
    configure_make at line 93 column 9
    install at line 196 column 7
    pkg at line 568 column 9

有人可以指出我正确的方向吗?谢谢!

解决方法

更新:这是 Octave.app 中的问题,而不是您做错了什么。请绕过 the Octave.app Issue Page 并讨论如何解决此问题。

这听起来像是您需要安装 netcdf 系统包。 (这是 Octave netcdf 包所依赖的原生 NetCDF 库。)如果你有 Homebrew,你可以用 brew install netcdf 安装它,它可能会工作。

Octave.app 可能应该捆绑 netcdf 本身,因此您不需要在系统上安装它。您可以在 the Octave.app Issues page 提出请求。