可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
Can you tell me how to install valgrind on yosemite? When I try to install it i get " checking for the kernel version... unsupported (14.0.0) configure: error: Valgrind works on Darwin 10.x, 11.x, 12.x and 13.x (Mac OS X 10.6/7/8/9) "
There is no official path or update, and I didn't found anything (except http://comments.gmane.org/gmane.comp.kde.devel.bugs/1553705 , but they didn't resolve that problem).
回答1:
As there's no stable release that supports Yosemite, you can install the latest development version with
brew install --HEAD valgrind
回答2:
Whilst it may have been the case in past OS X release cycles that Valgrind took a period of time before achieving reasonable feature support, basic OS X 10.10 support is already available in Valgrind trunk due to significant work on pre-release Yosemite.
From the mailing list:
There has been some effort recently to improve Valgrind's support for Yosemite. If you develop on Mac OS, you might like to try out the trunk (svn co svn://svn.valgrind.org/valgrind/trunk) and report any breakage you get. Support for Yosemite is good enough that at least one large graphical application (Firefox) runs OK. Support for the previous release, 10.9 (Mavericks), is also substantially improved.
Note that the work has targetted 64 bit processes only. 32 bit might work, and probably better on Mavericks, but I suspect it will be increasingly problematic on Yosemite due to Valgrind's 32 bit x86 instruction set support not having progressed passed SSSE3.
Julian Seward
http://sourceforge.net/p/valgrind/mailman/message/33047840/
Full disclosure: I'm one of the new Valgrind developers who contributed patches to support OS X 10.10
回答3:
Valerio's svn workflow will download every branch which is time and resource consuming. A better procedure is to download just the trunk:
svn co svn://svn.valgrind.org/valgrind/trunk valgrind cd valgrind ./autogen.sh ./configure make make install
回答4:
Here is my take on it. I more or less had a clean mac with xcode installed. Got it compiling and running with the following:
# build/install autoconf/automake/libtool so that 'autogen' works curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz tar -xzf autoconf-2.69.tar.gz cd autoconf-2.69 ./configure && make && sudo make install cd .. curl -OL http://ftpmirror.gnu.org/automake/automake-1.14.tar.gz tar -xzf automake-1.14.tar.gz cd automake-1.14 ./configure && make && sudo make install cd.. curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz tar -xzf libtool-2.4.2.tar.gz cd libtool-2.4.2 ./configure && make && sudo make install cd .. svn co svn://svn.valgrind.org/valgrind/trunk valgrind cd valgrind ./autogen.sh # important: configure-params, otherwise make ends in errors ./configure -disable-tls --enable-only64bit --build=amd64-darwin make # sudo, otherwise it fails due to permissions sudo make install
Note that callgrind_control (from valgrind-3.11.0 SVN) doesn't appear to work on OS X, looks like a perl-script and the commandline tool which it runs (vgdb -l) prints something 'unexpected' which that script doesn't correctly parse ( so it won't be able to find the other process running with valgrind ).
Alternatively, the perl script just calls vgdb, we can also directly do that ( just figure out your process-id manually):
vgdb --pid=2858 instrumentation on
回答5:
Worked for me on 10.10.1 :
svn co svn://svn.valgrind.org/valgrind cd valgrind ./autogen.sh ./configure make make install
回答6:
All of the solutions listed here failed for me. What finally ended up working was to use mac ports.
sudo port install valgrind-devel
回答7:
Here's how to install it using alternative sources besides the official svn (because it seems to be intermittently available).
https://crispyappstudiosblog.wordpress.com/2015/07/07/installing-valgrind-on-osx-yosemite/
1) Navigate to this git mirror of the svn and download the latest available version: http://repo.or.cz/w/valgrind.git
2) You need VEX as well, so grab the latest version here: http://repo.or.cz/w/vex.git
3) Extract both of them. Put the entire contents of the VEX
folder into a folder called VEX in the top level of the valgrind directory.
cd
to the valgrind directory, and execute the following:
Run ./autogen.sh Run ./configure Run make Run sudo make install
Test it out by running valgrind --version
You should be running at least 3.11.0 SVN for it work on Yosemite. 
回答8:
I installed it on my mac by installing homebrew
and then running this 3 commands in the terminal.
brew update
brew doctor
brew install --HEAD valgrind
PS: I have Os X El Capitan (10.11) but this should work with previous versions too.
回答9:
I finally got Valgrind to work on my OSX El Capitan 10.11.12.
User Kalmiya's answer worked for me first after I installed Xcode commandline tools.
Type this in the terminal:
xcode-select --install
Now follow Kalmiya's post, step by step. https://stackoverflow.com/a/30366798/3633475
回答10:
Here is another take on the svn install. The previous ones did not work for me, since I needed to have automake
and autoconf
installed, which I did not, even though I had the latest version of the Xcode command line tools installed.
I got the following from this site. I also had to link automake
and autoconf
after doing brew install automake
and brew install autoconf
by doing brew link automake
and brew link autoconf
for this to work.
# Check out their repo... $ svn co svn://svn.valgrind.org/valgrind/trunk valgrind-trunk # and hop into it. $ cd valgrind-trunk # You need to have autoconf and automake installed to build Valgrind # This example uses Homebrew to install these dependencies # (MacPorts should also work) # (Permission error? add sudo!) $ brew install automake $ brew install autoconf # run autogen.sh in valgrind-trunk $ ./autogen.sh # Tricky, there are some hard wired paths in the Valgrind sources. # You need to symlink the mach folder in your XCode SDK to /usr/include/mach # Be sure to use the proper Xcode SDK "MacOSX10.10.sdk" in the path! $ ln -sv /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/mach /usr/include/mach # Run configure + set install paths in valgrind-trunk $ ./configure --prefix=/usr/local # Run Make and make install (permission error? add sudo!) in valgrind-trunk $ make $ make install # Check it works $ valgrind --version valgrind-3.11.0.SVN
回答11:
I have used kalmiya's instructions to build valgrind as a conda package for OSX Yosemite. For those who work with anaconda/conda, just do
conda install -c https://conda.binstar.org/groakat valgrind
Side-note: I needed to install the command line tools as described below to get valgrind compiled.
https://stackoverflow.com/a/30471647/2156909
回答12:
I got valgrind on Yosemite compiled, but had to use a hack to do so. While I think you should be using xcode-select install
to get all command line tools (after which valgrind should make properly), but if you don't want to do this (eg. size of Xcode tools too big), you can also get the Darwin OSX code and copy the following files to /usr/include/mach
mach_vm.defs task.defs thread_act.defs vm_map.defs
This allowed a clean compile and install, although note it is a rather slack hack.