Linuxbrew: configure: error: 无法找到可用的编译器

huangapple go评论191阅读模式
英文:

Linuxbrew: configure: error: could not find a working compiler

问题

在Ubuntu 16.04.7 LTS(xenial)上执行brew install时,我遇到了以下错误,导致每次安装都失败:

检查是否启用Makefile的维护者特定部分... 否
检查ABI=64
检查编译器gcc-13  ... 否
检查ABI=x32
检查编译器gcc-13  ... 否
检查ABI=32
检查编译器gcc-13  ... 否
配置错误:无法找到可工作的编译器,请查看config.log以获取详细信息
英文:

When executing brew install on Ubuntu 16.04.7 LTS (xenial) I am getting the following error which breaks each install:

checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking compiler gcc-13  ... no
checking ABI=x32
checking compiler gcc-13  ... no
checking ABI=32
checking compiler gcc-13  ... no
configure: error: could not find a working compiler, see config.log for details

答案1

得分: 0

  1. 通过执行以下命令创建一个测试文件:echo 'int main(){}' > dummy.c
  2. 运行gcc-13 dummy.c,将会出现下面的错误(请注意,gcc dummy.c 可以正常工作):
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/13/liblto_plugin.so: error loading plugin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/linuxbrew/.linuxbrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/13/liblto_plugin.so)
  1. 运行brew link --force binutils
链接 /home/linuxbrew/.linuxbrew/Cellar/binutils/2.40.reinstall... 创建了 86 个符号链接。

如果您需要将此软件添加到 PATH 中,请考虑运行以下命令:
  echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/binutils/bin:$PATH"' >> ~/.profile
  1. 然后按照建议运行:
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/binutils/bin:$PATH"' >> ~/.profile
  1. 您现在可以选择性地通过运行echo $PATH来检查您的 PATH。
  2. 运行brew config
HOMEBREW_VERSION: 4.0.28
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2b4cfb033757b63ab0b128d01c58db76480956f9
最后提交: 7 天前
Core tap JSON: 13 Jul 21:39 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_GITHUB_API_TOKEN: 已设置
HOMEBREW_MAKE_JOBS: 1
Homebrew Ruby: 2.6.10 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby
CPU: 单核 64 位 Haswell
Clang: 不适用
Git: 2.7.4 => /usr/bin/git
Curl: 7.47.0 => /usr/bin/curl
Kernel: Linux 4.4.0-1160.80.1.vz7.191.4 x86_64 GNU/Linux
操作系统: Ubuntu 16.04.7 LTS (xenial)
主机 glibc: 2.23
/usr/bin/gcc: 5.4.0
/usr/bin/ruby: 2.3.1
glibc: 不适用
gcc@11: 不适用
gcc: 不适用
xorg: 不适用
  1. 现在gcc-13 dummy.c应该不会出现错误。
  2. 现在brew install应该也可以正常工作,不会出现任何错误。
英文:
  1. Create a test file by executing: echo 'int main(){}' > dummy.c
  2. Run gcc-13 dummy.c which will give the error below (please note that gcc dummy.c can work just fine)
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/13/liblto_plugin.so: error loading plugin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/linuxbrew/.linuxbrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/13/liblto_plugin.so)
  1. Run brew link --force binutils
Linking /home/linuxbrew/.linuxbrew/Cellar/binutils/2.40.reinstall... 86 symlinks created.

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/binutils/bin:$PATH"' >> ~/.profile
  1. Then as recommended run:
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/binutils/bin:$PATH"' >> ~/.profile
  1. You can now optionally check your PATH by running: echo $PATH
  2. Run brew config
HOMEBREW_VERSION: 4.0.28
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2b4cfb033757b63ab0b128d01c58db76480956f9
Last commit: 7 days ago
Core tap JSON: 13 Jul 21:39 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 1
Homebrew Ruby: 2.6.10 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby
CPU: single-core 64-bit haswell
Clang: N/A
Git: 2.7.4 => /usr/bin/git
Curl: 7.47.0 => /usr/bin/curl
Kernel: Linux 4.4.0-1160.80.1.vz7.191.4 x86_64 GNU/Linux
OS: Ubuntu 16.04.7 LTS (xenial)
Host glibc: 2.23
/usr/bin/gcc: 5.4.0
/usr/bin/ruby: 2.3.1
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A
  1. Now gcc-13 dummy.c should give no error
  2. And now the brew install should work without any error as well

huangapple
  • 本文由 发表于 2023年7月14日 07:46:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76683893.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定