Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build and install Valgrind on Mac?

Tags:

build

valgrind

I am on Mac OS X using codeblocks 10.05

I downloaded Valgrind, and extracted a folder. I am completely lost from there, and have no idea how to build it.

I do not know ANY terminal/console commands and am generally new to programming, so I have no idea how to "build" or "compile" it. I just have a folder called Valgrind with a bunch of random files in it.

Could someone please tell me how to proceed? I already checked the website/documentation but it didn't really give me installation instructions, just usage instructions.

Thanks

PS: I know I already posted this question, but the previous question was shut down, for being too vague. I reposted this one with more info.

PSS: All that I am basically asking is what do I do to install Valgrind right after I download it from the website and extract the files?

like image 254
user1017485 Avatar asked Nov 12 '11 02:11

user1017485


People also ask

Can I get valgrind on Mac?

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.


2 Answers

Recommended:

Use brew: brew install valgrind

Manual Install:

Here's what worked on my Mac (10.6). Double-check you have the latest version, then change into the uncompressed directory

cd /users/(insert username here)/downloads/valgrind-3.17.0 

I suggest you do as another posted and read the readme.

nano README 

Commence the build; /usr/local is the place on the filesystem that the program will be installed to. There are many arguments like prefix that are available to customize the installation to your particular system if it doesn't work by default. Normally just using ./configure works perfectly well though.

./configure --prefix=/usr/local  make  sudo make install 

Or you could probably get it from fink or macports or homebrew.

like image 51
joshua.thomas.bird Avatar answered Sep 30 '22 11:09

joshua.thomas.bird


You can install it through brew for Mac:

brew install valgrind 

You might have to manually link the entry to /usr/local/bin as brew refused to do it in my case:

$ ln /usr/local/Cellar/valgrind/3.8.1/bin/vgdb /usr/local/bin/vgdb ln: /usr/local/bin/vgdb: Permission denied $ sudo ln /usr/local/Cellar/valgrind/3.8.1/bin/vgdb /usr/local/bin/vgdb 
like image 42
rgk Avatar answered Sep 30 '22 09:09

rgk