尝试安装 wgrib2 时配置错误

尝试安装 wgrib2 时配置错误

我有同样的问题:尝试在 mint 中安装 wgrib2 时配置错误:配置:错误:C 编译器无法创建可执行文件

但是,我不确定如何解决这个问题。我对 Linux 不太熟悉。

以下是与原始帖子相同的命令的输出:

$ type -a cc
cc is /usr/bin/cc

$ echo $CC
gcc

$ ls -Alh $(command -v cc) 
lrwxr-xr-x  1 root  wheel     5B May 27 20:46 /usr/bin/cc -> clang

我究竟需要什么才能让编译器正常工作?

编辑:

这是错误:

checking build system type... x86_64-apple-darwin19.6.0
checking host system type... x86_64-apple-darwin19.6.0
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/eli.turaskyriskpulse.com/Documents/Misc/wgrib/grib2/libaec-1.0.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** [/Users/eli.turaskyriskpulse.com/Documents/Misc/wgrib/grib2/lib/libaec.a] Error 77

答案1

您的问题与 mint Linux 用户不同。那个人试图使用未安装的编译器(icc)。 Intel C 编译器 (icc) 并不是为 Intel CPU 编译代码的 C 编译器的通用名称。

您使用的是 MacOS,并且在编译 AEC 库时遇到问题。您应该尝试真正的 gnu C 编译器 (gcc) 而不是 clang。

看: https://bovineaerospace.wordpress.com/2017/08/20/how-to-install-wgrib2-in-osx/

其他安装页面也呼应了此建议。

相关内容