How to Install Valgrind on macOS High Sierra
Valgrind is a programming tool for memory debugging, memory leak detection and profiling. Its installation for macOS High Sierra seems problematic and I wanted to write this post to tell the solution that worked for me. I use Homebrew to install it which is the recommended way and the solution also uses it.
So, when you try installing right away, you may get the following error:
$ brew install valgrind valgrind: This formula either does not compile or function as expected on macOS versions newer than Sierra due to an upstream incompatibility.
1. To correctly install it, first, type the following command at the Terminal (which opens Valgrind’s formulae) and change the URL in
2. Do an update for Homebrew:
$ brew update
3. Finally, use the following command to install Valgrind from the
$ brew install --HEAD valgrind