make fails while installing Valgrind

匿名 (未验证) 提交于 2019-12-03 01:04:01

问题:

I'm trying to install Valgrind on a Mac with Snow Leopard but am getting an error. This is what I'm typing into Terminal.

$ curl -O http://valgrind.org/downloads/valgrind-3.8.1.tar.bz2 $ md5sum valgrind-3.8.1.tar.bz2 $ tar -xjvf valgrind-3.8.1.tar.bz2 $ cd valgrind-3.8.1 $ ./configure $ make 

This is the error I get.

Making all in coregrind make[2]: *** No rule to make target `/usr/include/mach/mach_vm.defs', needed by `m_mach/mach_vmUser.c'.  Stop. make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 

How can I correct this error?

回答1:

Apparently, to compile on a Macintosh, valgrind needs the file /usr/include/mach/mach_vm.defs to be present. While I haven't been able to find specific references to mach_vm.defs being part of XCode specifically, it seems that most of the usual contents of /usr/include/mach are installed when XCode is.

If for some reason you can't install XCode on your machine, you can get most of the source files for that particular directory from this part of apple's open source website.



回答2:

Make sure to install the command line tools.

xcode-select --install 


回答3:

The best way to get valgrind compiled properly is to use the 'xcode-select --install' command as mentioned in the above answer. However, as sub-optimal hack, you can get it compiled by downloading the following files from OSX /mach source into /usr/include/mach (create this directory):

mach_vm.defs     task.defs thread_act.defs vm_map.defs 

It's a slightly dirty hack, but it should get you going if you really don't want to download/install the large Xcode original files.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!