2017-09-05 115 views
3

我试图在macOS Sierra上安装valgrind(版本10.12.6)。在运行./configure.sh时,出现此错误:在OS X上构建valgrind

checking for a supported version of gcc... Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 no (applellvm-8.1.0) configure: error: please use gcc >= 3.0 or clang >= 2.9 or icc >= 13.0

所以,我检查了我的gcc和clang版本。这些答复如下:

Ankits-MacBook-Air:valgrind ankitshubham$ gcc --version

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Ankits-MacBook-Air:valgrind ankitshubham$ clang --version

Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

我不知道如何检查,如果ICC> = 13.0

这里有什么问题?

回答

1

使用任何流行的跨平台软件包,通常只需使用软件包管理器(如Homebrew)进行安装即可。然后你只需要brew install valgrind就完成了。

还要注意铛和苹果的开发工具已经有类似的有用的调试工具,特别是铛的地址消毒剂和malloc的调试的东西 - 这是来自Xcode的项目设置中方便:

enter image description here

但如果需要,也可以在命令行中使用它。

+0

确实如此。其实我正在关注一个网页教程,其中安装valgrind是其中一个步骤,他们以老式的方式做到了这一点。 –

+1

是的,使用例如Homebrew是别人已经解决了所有的配置/构建/安装问题,并将它们放入脚本中。 –

+0

这对高级Sierra不起作用:“valgrind:由于上游不兼容性,此公式或者未按照预期在macOS 版本上编译或运行, 错误:未满足的需求未能通过此构建。 – tzachs

3

您遇到的问题已在当前的开发库中得到解决。

如果您确实想要构建valgrind,而不是仅仅使用包管理器克隆开发回购(下面的说明)。我假设你没有在寻找valgrind的特定版本,下面的说明将在本文发布日期之前构建版本3.14。

我假设你刚刚下载了release tarball。 如果您改为在repository page上列出的git存储库,它将在Mac上构建得很好10.12.6

从valgrind存储库页面。

To clone code from the current repository (anonymous, read-only git access), do this:

git clone git://sourceware.org/git/valgrind.git To build the cloned code, follow the instructions in the README file that the clone should give you. Alternatively, the following should work:

cd valgrind 
    ./autogen.sh 
    ./configure --prefix=... 
    make 
    make install 

上述步骤在安装了以下版本的clang后运行MacOS 10.12.6的这篇文章的日期工作正常。

clang --version 
Apple LLVM version 9.0.0 (clang-900.0.37) 
Target: x86_64-apple-darwin16.7.0 
Thread model: posix 
InstalledDir: ...