1 从github上下载源码https://github.com/gperftools/gperftools
git clone https://github.com/gperftools/gperftools
2 进入源码目录,执行
[root@localhost gperftools-master]# sh autogen.sh
autogen.sh: line 3: autoreconf: command not found
出错,需要安装个autoconf
yum install autoconf automake libtool
[root@localhost gperftools-master]# sh autogen.sh
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:150: installing './compile'
configure.ac:20: installing './config.guess'
configure.ac:20: installing './config.sub'
configure.ac:21: installing './install-sh'
configure.ac:21: installing './missing'
Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
执行配置
./configure
编译
make
3 64位系统要安装libunwind
yum install libunwind
4 单独安装tcmalloc
./ configure --disable-cpu-profiler --disable-heap-profiler --disable-heap-checker --disable-debugalloc --enable-minimal