I'm installing valgrind now, until the ‘make install’ command it goes good. The next command- ‘make regtest’ outputs the next error:
../../depcomp: line 689: exec: g++: not found
make[5]: *** [leak_cpp_interior.o] Error 127
make[5]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck/tests'
make[4]: *** [check-am] Error 2
make[4]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck/tests'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck/tests'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/kbubuntu/valgrind-3.9.0/memcheck'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/kbubuntu/valgrind-3.9.0'
make: *** [check] Error 2
How can I solve it?
Thanks.
Valgrind installation steps. 1 Pull Valgrind source archive file to get the source. 2 Unpack the archive to extract the files onto your system. 3 Run “ ./configure” command to prepare build configurations. 4 Use the make command to start the build, just like you use to do. 5 Run <sudo make install> to install it onto your system. More ...
What is Valgrind? It is an open source framework, popular code profiling, and leak checker tool. You can instantly use it to detect dynamic memory and threading bugs, and profile application in detail. Alternatively, you can utilize it to develop new tools.
Code Profiling Using Valgrind. Code profiling is an essential facet of programming. Some of you may already know about code profiling yet few of us could wonder what it is. Code profiling is the process to determine which part of the program is depleting resources.
So Valgrind brings the concept of suppression to hide such errors which are outside of your purview, or you do not want to see. Steps for suppression. 1. Run your program using the following command.
Short answer: Make from source.
How?
valgrind
version with root rights (eg. sudo
):apt-get --purge valgrind
or
dpkg --remove valgrind
or
yum remove valgrind
Obtain sources from here.
Identify the latest version (for example 3.17.0)
Download sources : wget https://sourceware.org/pub/valgrind/valgrind-3.17.0.tar.bz2
Decompress archive tar xvf valgrind-3.17.0.tar.bz2
Go to uncompressed archive cd valgrind-3.17.0
Configure ./configure
Compile make
Install make install
(with root rights, eg. sudo
)
Note: very useful for Raspberry Pi 4 users - Default valgrind installation generate a lot of internal errors. See Valgrind reports hundreds of errors in Hello World program on RaspberryPi 4B
All major linux distributions will include valgrind in their repositories. You can find this on debian derived, apt
based systems with:
apt search valgrind
But first just try:
apt install valgrind
It should work, and pull in any dependencies. Remember, if you are not the superuser, you'll need to preface those with sudo
.
It's a great tool, have fun.
i think its due to dependency not met. install g++ by
sudo apt-get install g++
then try again. error is due to exec is unable to find any package named g++
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With