Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building valgrind on OS X

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 --version

Configured 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 --version

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

I don't know how to check if icc>=13.0

What is wrong here?

like image 281
Ankit Shubham Avatar asked Sep 05 '17 08:09

Ankit Shubham


People also ask

Does valgrind work on macOS?

x and later), ARM64/Android, X86/Android (4.0 and later), MIPS32/Android, X86/FreeBSD, AMD64/FreeBSD, X86/Darwin and AMD64/Darwin (Mac OS X 10.12). Valgrind is Open Source / Free Software, and is freely available under the GNU General Public License, version 2.


1 Answers

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.

To clone code from the current repository (anonymous, read-only git access), do this:

git clone git://sourceware.org/git/valgrind.git To build the cloned code, follow the instructions in the README file that the clone should give you. Alternatively, the following should work:

  cd valgrind
  ./autogen.sh
  ./configure --prefix=...
  make
  make install

The above steps work fine as of the date on this post running MacOS 10.12.6 with the following version of clang installed.

    clang --version
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: ...
like image 72
Shane Avatar answered Oct 09 '22 17:10

Shane