代码之家  ›  专栏  ›  技术社区  ›  orome ErikR

为什么Homebrew报告“无法理解kern.osversion‘14.0.0’”?

  •  5
  • orome ErikR  · 技术社区  · 11 年前

    当我跑步时 brew -- config 我明白了

    HOMEBREW_VERSION: 0.9.5
    ORIGIN: https://github.com/Homebrew/homebrew
    HEAD: bc071fb5448628aea8f066bbc0f37b0ecb4f11ee
    Last commit: 16 hours ago
    HOMEBREW_PREFIX: /usr/local
    HOMEBREW_CELLAR: /usr/local/Cellar
    CPU: quad-core 64-bit haswell
    OS X: 10.10.1-x86_64
    Xcode: 6.1.1
    CLT: 6.1.1.0.1.1416017670
    couldn't understand kern.osversion `14.0.0'
    GCC-4.2: build 5666
    Clang: 6.0 build 600
    X11: 2.7.7 => /opt/X11
    System Ruby: 2.0.0-p481
    Perl: /usr/bin/perl
    Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/bin/python2.7
    Ruby: /usr/bin/ruby
    

    尽管我的Xcode(在Yosemite上)命令行工具似乎是最新的 xcode-select --install )在正确的地方

    /Applications/Xcode.app/Contents/Developer 
    

    根据 xcode-select -print-path ,我的(仅) gcc

    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
    Target: x86_64-apple-darwin14.0.0
    Thread model: posix
    

    根据 brew doctor

    Unexpected static libraries:
        /usr/local/lib/libtclstub8.6.a
        /usr/local/lib/libtkstub8.6.a
    

    然而,我身边有一些可疑的东西,特别是 usr/bin/gcc-4.2 ,其中 --version 给予

    couldn't understand kern.osversion `14.0.0'
    i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
    ...
    

    /usr/bin/i686-apple-darwin11-gcc-4.2.1 ,其中 --版本 也给出了

    couldn't understand kern.osversion `14.0.0'
    i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)    
    ...
    

    什么是 brew--配置 的报告

    无法理解kern.osversion“14.0.0”

    意思是我该做些什么吗?

    1 回复  |  直到 11 年前
        1
  •  3
  •   user707650 user707650    11 年前

    你前段时间在这台机器上升级了OS X吗?我想它们来自一个旧的装置。自从 gcc 默认情况下未安装,操作系统升级可能未删除或替换 全球通信中心 以及其他XCode命令行工具。我不知道你是否真的可以安全地删除它们,但显而易见的是重命名它们(或将它们移动到备份子目录中),这样它们就不在你的目录中了 PATH 这样,自制程序就找不到它们并使用更新的编译器( clang ). 很可能,您的系统(XCode、brew)将照常运行,因为它们将使用 叮当声 在您的系统中找到。

    您看到的错误“无法理解kern.osversion‘14.0.0‘”可能是因为 全球通信中心 是根据较旧的OS X内核版本编译的,而当前版本(Yosemite/14.0)与此版本向后不兼容。

    我不知道到底安装了哪些编译器工具,但我不知道 全球通信中心 ,您可以执行以下操作:

    mv /usr/bin/gcc-4.2 /usr/bin/gcc-4.2-oldOSX10.9
    

    (假设它安装在10.9上;可能安装在更早的版本上)。

    有点遗憾的是,XCode的升级(或者更确切地说,是一个全新的版本)没有检查旧版本的命令行工具,并删除了这些(*)。虽然可以理解,但苹果公司当然假设您不使用正常XCode工具之外的任何东西;他们显然不会以这种方式支持自制软件。

    (*)也许是这样,但如果您跳过了一个或2个版本,那么它可能不会在检查旧版本时返回那么远的时间。