QCachegrind ( KCachegrind ) on Mac OS X

Simple instructions on how to install QCachegrind ( a.k.a KCachegrind ) on Mac OS X.


Building KCachegrind on Mac OS X is a giant pain, most people I know using it will just fire up a Linux virtual machine instead.

Turns out there is another option. The KCachegrind repository includes QCachegrind, which is easy to build on Mac OS X once you have QT installed ( download 4.8.5 for Mac ).

8 thoughts on “QCachegrind ( KCachegrind ) on Mac OS X”

  1. Anupam — thanks for that! Love cachegrind, but hate building it — this is great.

    One thing — it looks like you still need to follow the instructions from https://gist.github.com/justfalter/1029580#file-how_to_install_qcachegrind_on_osx-txt about linking to dot if you want graphs:
    After installing dot (e.g.,
    brew install graphviz

    # By default, Graphviz installs dot to /usr/local/bin/dot, which qcachgrind.app
    # might not find since /usr/local/bin isn’t in PATH by default (I think). In order
    # to ensure that my graphs render, I created a symlink from /usr/bin/dot to /usr/local/bin/dot:
    sudo ln -s /usr/local/bin/dot /usr/bin/dot

  2. This does no longer work in OSX El Capitan due to System Integration Protection:
    sudo ln -s /usr/local/bin/dot /usr/bin/dot

    $ cd /Applications/qcachegrind.app/Contents/MacOS
    $ mv qcachegrind qcachegrind.bin
    $ echo ‘#!/bin/bash
    export PATH=”$PATH:/usr/local/bin”
    $(dirname $0)/qcachegrind.bin
    exit 0’ > qcachegrind
    $ chmod +x qcachegrind

    Then start qcachegrind as usual.

  3. Motin’s clever trick works (and I’m using macports, not homebrew), but keep in mind that you’ll have to convert the curly quotes that this blogging platform inserted back to standard quotes. This applies to both the single and double quotes. And of course you may have to proceed the “mv”, “echo” and “chmod” commands with “sudo “.


  4. Note: If you copy pasted the line “export PATH=”$PATH:/usr/local/bin”” you might need to replace the quote characters.

Leave a Reply

Your email address will not be published. Required fields are marked *