Sudo port install valgrind
You can use Valgrind to build new tools as well. There are Valgrind tools like Memcheck that can automatically detect many memory management and threading bugs, and profile your programs in detail. Assuming you have svn installed usually comes pre-installed with OS X , get the latest valgrind repo by executing the following command:.
Make sure you have Macports installed. If not, install from here. For OS X Mountain Lion, running the above command might sometimes throw an error saying that the Xcode you have is not the latest version even though you have the newer version.
It will look something like this:. Error: The installed version of Xcode 2. Version 4. This happens because it uses some default path. Use the following command to change it:. XcodeDP3 refers to Xcode 4. Execute the following command to do it:.
Now we are all set to install valgrind. Run the following commands to install it:. And you are done! We are all set to use valgrind now. Execute the following command to use valgrind on your code.
This will display minimal information on the command line. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 6 years, 9 months ago. Active 6 years, 2 months ago. Viewed 2k times. Noor Noor 97 1 1 silver badge 12 12 bronze badges. Add a comment. Active Oldest Votes. Download all attachments as:. In the future, please use WikiFormatting and Cc the port maintainers port info --maintainers valgrind-devel , if any. Are you also on OS X You should not pass any additional flags.
That is the flag that causes the build failure in the main. As you said you got the same error, I suppose your main. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to install valgrind properly? Ask Question. Asked 7 years, 5 months ago. Active 9 months ago. Viewed 46k times. Daniel Griscom 1, 2 2 gold badges 21 21 silver badges 41 41 bronze badges. Shtrudle Shtrudle 55 1 1 gold badge 2 2 silver badges 7 7 bronze badges.
Even if i work with gcc? Anyway, they both already install. Why don't you just use the disto valgrind apt-get valgrind or whatever?
0コメント