如何使用Homebrew在macOS Catalina(10.15)上安装Valgrind?


11

我尝试使用命令brew install Valgrind安装Valgrind,并且收到一条消息:

“ valgrind:由于上游不兼容,该公式无法在比Sierra更高的macOS版本上编译或正常运行。错误:未满足的要求导致此构建失败。”

我还尝试在代码的开头部分“ brew edit valgrind”并将“ sourceware.org/git/valgrind.git”替换为“ git://sourceware.org/git/valgrind.git”,然后在“ Iterm”上写道:brew install --HEAD valgrind”,但它给了我:

Last 15 lines from /Users/m/Library/Logs/Homebrew/valgrind/02.configure:
checking for gcc-ar... no
checking for perl... /usr/bin/perl
checking for gdb... /no/gdb/was/found/at/configure/time
checking dependency style of clang... none
checking for diff -u... yes
checking for clang option to accept ISO C99... none needed
checking for a supported version of gcc... ok (clang-11.0.0)
checking build system type... x86_64-pc-darwin
checking host system type... x86_64-pc-darwin
checking for a supported CPU... ok (x86_64)
checking for a 64-bit only build... yes
checking for a 32-bit only build... no
checking for a supported OS... ok (darwin)
checking for the kernel version... unsupported (19.0.0)
configure: error: Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x and 17.x (Mac OS X 10.6/7/8/9/10/11 and macOS 10.12/13)

READ THIS: https://docs.brew.sh/Troubleshooting

Answers:



1

效果惊人!参见https://github.com/LouisBrunner/valgrind-macos/issues/5

不是Homebrew,您需要从源代码进行编译,但这并不困难。

1. git clone https://github.com/LouisBrunner/valgrind-macos.git
2. cd valgrind
3. sudo ./autogen.sh
4. sudo ./configure --prefix=/where/you/want/it/installed --enable-only64bit
5. copy the [contents][1] to ./coregrind/m_mach/mach_basics.c
6. sudo make 
7. sudo make install

请享用!


github的今天版本似乎有一些改进。我从这里的方向进行了构建,并进行了一些更改:1.不需要步骤5。2.不需要在步骤3、4和6上使用sudo。到目前为止,在Catalina 10.15.4上似乎运行良好。
Bob Murphy

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.