我试着用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.
我试过brew install --HEAD Valgrind
。
相反,在成功安装依赖项autoconf
、automake
和libtool
之后,当它试图安装val差制时,我会得到一个配置错误:
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)
我的操作系统是macOS Mojave(10.14),所以这是否意味着我现在不能用Homebrew安装一个功能良好的Valgrind?
发布于 2019-02-22 01:51:46
基于这个补丁、这个职位和这个答案的源代码解决方案(相当痛苦)安装。
$ git clone https://github.com/Echelon9/valgrind.git
$ cd valgrind
$ git checkout feature/v3.14/macos-mojave-support-v2
$ ./autogen.sh
$ ./configure --prefix=/where/you/want/it/installed --enable-only64bit
$ make
如果得到以下错误:No rule to make target '/usr/include/mach/mach_vm.defs’
,则需要运行xcode-select --install
。如果您还没有Xcode,您可能需要从应用程序商店安装Xcode。一旦完成,您将需要编辑coregrind/Makefile
搜索:
am__append_19 = \
/usr/include/mach/mach_vm.defs \
/usr/include/mach/task.defs \
/usr/include/mach/thread_act.defs \
/usr/include/mach/vm_map.defs
在对下面的文件夹进行双重检查后,在每行前面加上:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
最终结果应是:
am__append_19 = \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/mach_vm.defs \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/task.defs \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/thread_act.defs \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/mach/vm_map.defs
现在再次运行make
,应该可以找到包含的内容。但这并不一定意味着它会编译。我得到了以下错误:
vg_preloaded.c:136:19: error: expected ';' before 'const'
__private_extern__ const char *__crashreporter_info__ = "Instrumented by Valgrind " VERSION;
解决这一问题的方法是添加以下行:
#define __private_extern__ extern
提交给下列文件:
coregrind/m_syscall.c
coregrind/m_syswrap/syswrap-darwin.c
coregrind/vg_preloaded.c
最后,您需要祈祷不要出现其他错误:
$ make
$ make install
发布于 2019-07-01 07:14:50
您可以在以下位置使用macOS 10.14.5 Mojave的实验版Val差尔:
https://github.com/sowson/valgrind
要使用它的命令是:
brew install --HEAD https://raw.githubusercontent.com/sowson/valgrind/master/valgrind.rb
它仍然是试验性的,还需要一些工作,但是对于简单的项目来说,已经.享受吧!
发布于 2019-07-29 21:44:15
另外:我发现这个在我的OSX 10.14上对我有用。
brew install --HEAD https://raw.githubusercontent.com/LouisBrunner/valgrind-macos/master/valgrind.rb
一种正在努力使OSX正确的分支。一些东西帮我们渡过难关,直到我们得到一个真正的精力充沛的版本。
https://stackoverflow.com/questions/52732036
复制相似问题