1) 首先是安装吧.
靠,出师不利, 下载源码,解压, 自定义路径安装,
1、 到下载最新版valgrind-3.2.3.tar.bz2
2、 解压安装包:tar –jxvf valgrind-3.2.3.tar.bz2
3、 解压后生成目录valgrind-3.2.3
4、 cd valgrind-3.2.3
5、 ./configure --prefix=/data/home/nemo/tools/valgrind
6、 Make;make install
报错.
valgrind: failed to start tool 'memcheck' ...
google之, 未找到解决之道.
突然想起来, 我刚开始的时候 执行了一次 ./configure 没有带任何参数, 在make完以后, make install 之前, 又不想把valgrind 装到系统目录下骚扰到别人, 想自定义路径, 然后就 重新 ./configure --prefix=/data/home/nemo/tools/valgrind, make了一次, 然后才make install, 是否是因为我最初的 ./configure 导致的呢?
问题解决:
进入源码目录, make clean. 然后重新按照上面的 安装步骤执行一次, 搞定.
进入到 tools/valgrind/bin 目录下
执行 ./valgrind ls -l
如果显示:
==17343== Memcheck, a memory error detector
==17343== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==17343== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==17343== Command: ls -l
==17343==
total 220
-rwxr-xr-x 1 nemo users 40959 2010-08-31 15:11 callgrind_annotate
-rwxr-xr-x 1 nemo users 13662 2010-08-31 15:11 callgrind_control
-rwxr-xr-x 1 nemo users 32064 2010-08-31 15:11 cg_annotate
-rwxr-xr-x 1 nemo users 43514 2010-08-31 15:11 cg_merge
-rwxr-xr-x 1 nemo users 24211 2010-08-31 15:11 ms_print
-rwxr-xr-x 1 nemo users 8715 2010-08-31 15:11 no_op_client_for_valgrind
-rwxr-xr-x 1 nemo users 30703 2010-08-31 15:11 valgrind
-rwxr-xr-x 1 nemo users 19175 2010-08-31 15:11 valgrind-listener
==17343==
==17343== HEAP SUMMARY:
==17343== in use at exit: 12,539 bytes in 37 blocks
==17343== total heap usage: 320 allocs, 283 frees, 35,761 bytes allocated
==17343==
==17343== LEAK SUMMARY:
==17343== definitely lost: 72 bytes in 2 blocks
==17343== indirectly lost: 240 bytes in 20 blocks
==17343== possibly lost: 0 bytes in 0 blocks
==17343== still reachable: 12,227 bytes in 15 blocks
==17343== suppressed: 0 bytes in 0 blocks
==17343== Rerun with --leak-check=full to see details of leaked memory
==17343==
==17343== For counts of detected and suppressed errors, rerun with: -v
==17343== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 3 from 3)
表示安装ok了.
阅读(1426) | 评论(0) | 转发(0) |