首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在macOS Mojave(10.14)上安装Homebrew?

如何在macOS Mojave(10.14)上安装Homebrew?
EN

Stack Overflow用户
提问于 2018-10-10 03:09:02
回答 10查看 45.2K关注 0票数 66

我试着用brew install Valgrind安装瓦兰,结果得到了:

代码语言:javascript
运行
复制
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

相反,在成功安装依赖项autoconfautomakelibtool之后,当它试图安装val差制时,我会得到一个配置错误:

代码语言:javascript
运行
复制
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?

EN

回答 10

Stack Overflow用户

回答已采纳

发布于 2019-02-22 01:51:46

基于这个补丁这个职位这个答案的源代码解决方案(相当痛苦)安装。

代码语言:javascript
运行
复制
$ 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

搜索:

代码语言:javascript
运行
复制
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

在对下面的文件夹进行双重检查后,在每行前面加上:

代码语言:javascript
运行
复制
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk

最终结果应是:

代码语言:javascript
运行
复制
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,应该可以找到包含的内容。但这并不一定意味着它会编译。我得到了以下错误:

代码语言:javascript
运行
复制
vg_preloaded.c:136:19: error: expected ';' before 'const'
 __private_extern__ const char *__crashreporter_info__ = "Instrumented by Valgrind " VERSION;

解决这一问题的方法是添加以下行:

代码语言:javascript
运行
复制
#define __private_extern__ extern

提交给下列文件:

  • coregrind/m_syscall.c
  • coregrind/m_syswrap/syswrap-darwin.c
  • coregrind/vg_preloaded.c

最后,您需要祈祷不要出现其他错误:

代码语言:javascript
运行
复制
$ make
$ make install
票数 35
EN

Stack Overflow用户

发布于 2019-07-01 07:14:50

您可以在以下位置使用macOS 10.14.5 Mojave的实验版Val差尔:

https://github.com/sowson/valgrind

要使用它的命令是:

代码语言:javascript
运行
复制
brew install --HEAD https://raw.githubusercontent.com/sowson/valgrind/master/valgrind.rb

它仍然是试验性的,还需要一些工作,但是对于简单的项目来说,已经.享受吧!

票数 31
EN

Stack Overflow用户

发布于 2019-07-29 21:44:15

另外:我发现这个在我的OSX 10.14上对我有用。

代码语言:javascript
运行
复制
brew install --HEAD https://raw.githubusercontent.com/LouisBrunner/valgrind-macos/master/valgrind.rb

一种正在努力使OSX正确的分支。一些东西帮我们渡过难关,直到我们得到一个真正的精力充沛的版本。

票数 14
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52732036

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档