After Several attempts, i finally got it working. The steps i followed:
wget http://valgrind.org/downloads/valgrind-3.9.0.tar.bz2 //download valgrind
tar xvjf valgrind-3.9.0.tar.bz2 //now extract
cd valgrind-3.9.0 //move to the corresponding dir
./configure //prepare everything
make
make install //now install
Now I can Execute my target executable under valgrind!
To execute under valgrind use:
valgrind --tool=memcheck --leak-check=yes COMMAND_TO_RUN_MY_TARGET_EXECUTABLE
To Add origin information use:
--track-origins=yes
To save all the reports in a log file use:
--log-file="Valgrind_Report.txt"