【问题标题】:Valgrind on macOS SierramacOS Sierra 上的 Valgrind
【发布时间】:2017-03-31 17:25:32
【问题描述】:

我遵循本指南:

valgrind installation guide

下载包后,我运行了 sh 脚本,但是当我启动make install 命令时,它无法创建文件夹,因为它没有权限(即使我使用了sudo 命令)。

此外,我尝试使用 brew,但出现此错误:

valgrind:此公式在 macOS 上无法编译或按预期运行 由于上游不兼容,版本比 El Capitan 更新。

错误:未满足的要求导致此构建失败。

【问题讨论】:

  • 对于以下人员:自 2017 年 6 月 14 日起,Valgrind 开始为 macOS 10.12 提供初步支持。见valgrind.org/docs/manual/dist.news.html
  • valgrind 使用 @voltento 的建议为我提供了最新版本 valgrind-3.15.0.GIT 的工作

标签: valgrind macos-sierra


【解决方案1】:

您可以从他们的website 下载 Valgrind 的最新版本。然后,您只需./autogen.sh 即可安装 Valgrind。我个人没有遇到任何需要make

然而,不幸的是,即使是最新版本的 Valgrind 在 Mac OS Sierra 上也不是很可用。原因是苹果没有公布导致 Valgrind 崩溃的部分源代码,没有这些源代码,Valgrind 的维护者几乎无能为力。你可以阅读更多关于这个问题的讨论here

因为 Mac OS 内核在Apple Public Source License 下,总有一天它必须开源。因此,与 Sierra 兼容的 Valgrind 版本只是时间问题。

目前,我在 Linux 下使用 Valgrind。我现在只能建议这些。

【讨论】:

  • Apple 最近 released 是 10.12 操作系统的 XNU 的来源。我确信 Valgrind 团队正在努力解决这个问题。
  • 截至 2017 年 1 月 3 日,从 Subversion 中签出的最新 Valgrind 源代码——他们选择的 VCS、版本控制系统——在“签出修订版 16192”时仍然遇到 valgrind: mmap-FIXED(0x0, 253952) failed in UME (load_segment1) with error 12 (Cannot allocate memory). 错误,即在讨论中有所描述。令人厌烦的是,当源显然是在 2016 年 11 月底发布时仍然存在问题。我没有进一步的信息可提供。
  • 可以确认。在 rev 16266 中仍未修复。
  • 今天好像还没有发布兼容 Sierra 的 Valgrind?最新更新是 2016 年 10 月 20 日。
  • 最新版本对我有用。根据 Jonathen Leffler 的评论,我查看了最新的 Valgrind 源代码(“已签出修订版 16393”)并按照valgrind download repository page 上的说明进行操作。我之前在 2016 年 10 月 20 日发布 (valgrind-3.12.0) 时遇到了同样的错误。
【解决方案2】:

最新的 Valgrind(git 版本 3.13.0)现在可以在 MacOS Sierra 上运行,但需要安装 Xcode 命令行工具(安装所需的标头)。

在构建 Valgrind 之前运行它:

xcode-select --install

感谢this post

【讨论】:

  • 另请注意,最新的 Xcode 包含 clang 9,它需要更改配置脚本 - 下载时它只会转到 8。
  • xcode-select: error: command line tools are already installed, use "Software Update" to install updates and homebrew valgrind: This formula either does not compile or function as expected on macOS versions newer than Sierra due to an upstream incompatibility. (high sierra)
  • @rogerdpack 你必须下载并自己构建它,homebrew 还不能安装它
  • OK 看起来高山脉实际上是“一个不同的问题”stackoverflow.com/questions/48714807/… 抱歉打扰了
【解决方案3】:

如果你碰巧还在 Sierra,这有效(但不适用于 High Sierra),就这样做

$ brew install valgrind

 valgrind: This formula either does not compile or function as expected on macOS
 versions newer than Sierra due to an upstream incompatibility.
 Error: An unsatisfied requirement failed this build.

更新:似乎它现在也适用于“High Sierra”OOTB,它现在说:

...versions newer than High Sierra due to an upstream incompatibility...

【讨论】:

    【解决方案4】:

    如果您收到类似于

    的错误

    valgrind:此公式要么无法编译,要么无法按预期运行 由于上游,在比 Sierra 更新的 macOS 版本上 不兼容。

    您可以尝试解决方法brew install --HEAD valgrind 我在这里找到了此信息https://www.gungorbudak.com/blog/2018/04/28/how-to-install-valgrind-on-macos-high-sierra/

    【讨论】:

    猜你喜欢
    • 2018-06-16
    • 2018-07-20
    • 2017-06-28
    • 2017-02-10
    • 1970-01-01
    • 1970-01-01
    • 2017-02-06
    • 2017-05-19
    • 2017-04-16
    相关资源
    最近更新 更多