Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compile Valgrind on Snow Leopard?

How can I compile Valgrind on Snow Leopard?

like image 419
Ricardo Sanchez-Saez Avatar asked Feb 18 '10 02:02

Ricardo Sanchez-Saez


3 Answers

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
like image 54
diciu Avatar answered Nov 12 '22 17:11

diciu


FYI, Valgrind 3.6 (released October 21, 2010) officially supports Snow Leopard out-of-the-box.

http://valgrind.org/docs/manual/dist.news.html

like image 43
Paul Roub Avatar answered Nov 12 '22 17:11

Paul Roub


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

like image 5
FFox Avatar answered Nov 12 '22 17:11

FFox