I recently had to install Valgrind on OS X El Capitan for a class assignment. It wasn’t straightforward. Hope this helps someone on the interwebs! Enjoy those deciphering those memory leaks in C 🙂
This only works if you have Homebrew set up.
sudo chown -R `whoami` /usr/local # sets your user has the owner of /usr/local (might take a while) cd /usr/local git reset --hard origin/master # cleans up any uncommitted, untracked changes in Homebrew brew doctor # have brew fix and clean up packages brew update HOMEBREW_CC=gcc HOMEBREW_AR=gar brew install valgrind # will definitely take a while
If that doesn’t work, then you can install Valgrind straight from the source
# cd into the Valgrind directory, I would put it in /usr/bin ./configure --prefix=/usr/bin make sudo make install
Until next time 😛