19

Is there a way to install Valgrind on Catalina and have it run properly? If so, I would very much appreciate a step-by-step process.

I tried installing Valgrind with https://github.com/sowson/valgrind but when I tested out helloWorld.cpp on the terminal, the console returned errors I should not have gotten.

I'm not sure if I committed an error on my part in the installation process of this version of Valgrind or if Valgrind itself is simply incompatible with Catalina OS.

I have also tried installing Valgrind via Homebrew, but I've had issues with that as well (github.com/Homebrew/homebrew-core/issues/36683).

John Park
  • 335
  • 5
  • 23
  • Have you tried downloading through a package manager like [brew](https://brew.sh/)? – avlec Oct 13 '19 at 01:54
  • Yes. And many have had issues with doing that as well. https://github.com/Homebrew/homebrew-core/issues/36683 – John Park Oct 13 '19 at 01:55
  • 1
    It may or may not be useful, but you could always fall back to Docker. May require more than one image, as I believe you'd have to get a build environment for sending stuff to valgrind. I don't know if it was you, but there was an issue raised for Catalina support. All you can really do is wait for the dev or some intrepid community member to add the needed fixes. – sweenish Oct 21 '19 at 16:43
  • 1
    @sweenish I followed your advice and made a dockerized solution to this problem. Thanks for your direction! – John Park Feb 15 '20 at 21:49

4 Answers4

5

Currently, no. The repo you link has an issue raised about Catalina compatibility. As you also show, the brew package has its own problems as well. Official valgrind only supports 10.12.

You'll just have to wait, or containerize it. Although if you containerize valgrind, you would likely need a compatible build container as well.

sweenish
  • 4,793
  • 3
  • 12
  • 23
4

Ok. I've found a way to use Valgrind on Catalina. Here's a link to my guide for how https://github.com/john-yohan-park/Valgrind_Catalina

John Park
  • 335
  • 5
  • 23
1

Works amazingly!! see https://github.com/LouisBrunner/valgrind-macos/issues/5.

Not Homebrew, you need to compile it from source, but it's not so difficult.

1. git clone https://github.com/LouisBrunner/valgrind-macos.git
2. cd valgrind
3. sudo ./autogen.sh
4. sudo ./configure --prefix=/where/you/want/it/installed --enable-only64bit
5. copy the [contents][1] to ./coregrind/m_mach/mach_basics.c
6. sudo make 
7. sudo make install

enjoy!

linfeng chen
  • 522
  • 6
  • 5
  • Today's version from github seems to have some improvements. I built it from the directions here, with a few changes: 1. No need for step 5. 2. No need for sudo at steps 3, 4, and 6. So far, it seems to be working fine on Catalina 10.15.4. – Bob Murphy Apr 27 '20 at 23:36
1

This is how I just did it on Catalina 10.15.5:

brew remove valgrind # remove previous attempts at installing it (if any)
brew tap LouisBrunner/valgrind
brew install --HEAD LouisBrunner/valgrind/valgrind

Source: https://github.com/LouisBrunner/valgrind-macos

Stéphane
  • 19,459
  • 24
  • 95
  • 136