How can I compile Valgrind on Snow Leopard?
Assuming you've got XCode tools installed and an SVN client, here it goes.
Go to some directory you keep stuff in. Checkout valgrind sources
svn co svn://svn.valgrind.org/valgrind/tags/VALGRIND_3_5_0 valgrind
Download Greg Parker's 10.6 patch
curl http://bugsfiles.kde.org/attachment.cgi?id=36999 > 10.6.patch
mv 10.6.patch ./valgrind
Apply the patch
cd valgrind
patch -p0 < 10.6.patch
Compile valgrind
./autogen.sh
./configure
make
Install it
sudo make install
Run it
valgrind --leak-check=full --show-reachable=yes /tmp/a.out
FYI, Valgrind 3.6 (released October 21, 2010) officially supports Snow Leopard out-of-the-box.
http://valgrind.org/docs/manual/dist.news.html
In addition to the (almost) perfect answer of diciu. For compiling a 64 bit version of valgrind (required for 64 bit executables, aka. the standard in OS 10.6). You will need to run configure like this: ./configure --enable-only64bit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With