I was trying to install valgrind on macOS Sierra (version 10.12.6). While running ./configure.sh, this error showed up:
checking for a supported version of gcc... Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 no (applellvm-8.1.0) configure: error: please use gcc >= 3.0 or clang >= 2.9 or icc >= 13.0
So, I checked my gcc and clang version. The responses are as follows:
Ankits-MacBook-Air:valgrind ankitshubham$
gcc --versionConfigured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Ankits-MacBook-Air:valgrind ankitshubham$
clang --versionApple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
I don't know how to check if icc>=13.0
What is wrong here?
Follow these steps:
The issue you are running into has been solved in the current development repo.
If you do want to build valgrind instead of just using a package manager clone the development repo (instructions are below). I am assuming that you are not looking for a specific version of valgrind, the instructions below will build version 3.14 as of the date of this post.
I am making the assumption that you just downloaded the release tarball. If you instead clone the git repository listed on the repository page it will build just fine on Mac 10.12.6
From the valgrind repository page.
The above steps work fine as of the date on this post running MacOS 10.12.6 with the following version of clang installed.
With any popular cross-platform package like this it's usually easier to just install with a package manager such as Homebrew. Then you just
brew install valgrind
and you're done.Note also that clang and the Apple developer tools already have similar useful debugging tools, particularly clang's address sanitizer and the malloc debug stuff - this is easily accessible from within Xcode's project settings:
but you can also use it from the command line if needed.