GreatSQL社区

搜索

reddey

关于jemalloc源码编译安装的一些心得体会

reddey 已有 47 次阅读2025-3-6 16:40 |系统分类:运维实战

   前几天在看强哥JiekeXu的墨天轮文章中讲到了jemalloc内存组件的安装(https://www.modb.pro/db/1892169237632921600),于是在自己的电脑环境也尝试一下。由于jemalloc内存组件在内存管理上出色物性,在mysql数据库服务器上得到大量应用。国产数据库greatsql在安装时,官方社区文档建议安装此控件。

  强哥用的是YUM安装方式,我的电脑操作系统是OEL8,在使用YUM安装找不到相应的YUM源,由于强哥的文章没讲到哪里下载YUM源。我只好采用到处下载,采用源码编译安装的方式。压缩文件名如下所示:

5.2.1.tar.gz。

对于这类的源码编译安装,将压缩包解压之后,通常有三步法安装:configure\make\make install。configure用于配置安装目录和安装选项,后面两步可以合二为一,用于安装压缩

组件。

但解压之后,我呆住了。解压文件目录没有configure命令,这样如何编译安装呢?解压目录下文件如下所示

[root@localhost jemalloc-5.2.1]# ll

total 224

-rwxrwxr-x. 1 root root   266 Aug  6  2019 autogen.sh

drwxrwxr-x. 2 root root    71 Aug  6  2019 bin

drwxrwxr-x. 2 root root    62 Aug  6  2019 build-aux

-rw-rw-r--. 1 root root 74379 Aug  6  2019 ChangeLog

-rw-rw-r--. 1 root root     0 Aug  6  2019 config.stamp.in

-rw-rw-r--. 1 root root 74413 Aug  6  2019 configure.ac

-rw-rw-r--. 1 root root  1709 Aug  6  2019 COPYING

drwxrwxr-x. 2 root root    93 Aug  6  2019 doc

drwxrwxr-x. 4 root root    41 Aug  6  2019 include

-rw-rw-r--. 1 root root 14796 Aug  6  2019 INSTALL.md

-rw-rw-r--. 1 root root   465 Aug  6  2019 jemalloc.pc.in

drwxrwxr-x. 2 root root    38 Aug  6  2019 m4

-rw-rw-r--. 1 root root 22662 Aug  6  2019 Makefile.in

drwxrwxr-x. 4 root root   114 Aug  6  2019 msvc

-rw-rw-r--. 1 root root  1047 Aug  6  2019 README

-rwxrwxr-x. 1 root root    48 Aug  6  2019 run_tests.sh

drwxrwxr-x. 2 root root    51 Aug  6  2019 scripts

drwxrwxr-x. 2 root root  4096 Aug  6  2019 src

drwxrwxr-x. 7 root root    95 Aug  6  2019 test

-rw-rw-r--. 1 root root  5920 Aug  6  2019 TUNING.md

[root@localhost jemalloc-5.2.1]# [root@localhost jemalloc-5.2.1]# ll

drwxrwxr-x. 2 root root    71 Aug  6  2019 bin

drwxrwxr-x. 2 root root    62 Aug  6  2019 build-aux

-rw-rw-r--. 1 root root 74379 Aug  6  2019 ChangeLog

-rw-rw-r--. 1 root root     0 Aug  6  2019 config.stamp.in

-rw-rw-r--. 1 root root 74413 Aug  6  2019 configure.ac

-rw-rw-r--. 1 root root  1709 Aug  6  2019 COPYING

drwxrwxr-x. 2 root root    93 Aug  6  2019 doc

drwxrwxr-x. 4 root root    41 Aug  6  2019 include

-rw-rw-r--. 1 root root 14796 Aug  6  2019 INSTALL.md

-rw-rw-r--. 1 root root   465 Aug  6  2019 jemalloc.pc.in

drwxrwxr-x. 2 root root    38 Aug  6  2019 m4

-rw-rw-r--. 1 root root 22662 Aug  6  2019 Makefile.in

drwxrwxr-x. 4 root root   114 Aug  6  2019 msvc

-rw-rw-r--. 1 root root  1047 Aug  6  2019 README

-rwxrwxr-x. 1 root root    48 Aug  6  2019 run_tests.sh

drwxrwxr-x. 2 root root    51 Aug  6  2019 scripts

drwxrwxr-x. 2 root root  4096 Aug  6  2019 src

drwxrwxr-x. 7 root root    95 Aug  6  2019 test

-rw-rw-r--. 1 root root  5920 Aug  6  2019 TUNING.md

看了autogen.sh脚本才知道脚本调用了autoconf。autogen.sh命令在使用执行后,会调用autoconf,从而会自动在解压目录下生成configure命令。autoconf是YUM组件,比较容易安装。有了configure命令,后面就可以按三步法安装了。

yum install autoconf -y 后,先执行sh autogen.sh命令,发现果然生成了configure命令。如下图所示:

[root@localhost jemalloc-5.2.1]# ll

total 796

-rwxrwxr-x. 1 root root    266 Aug  6  2019 autogen.sh

drwxrwxr-x. 2 root root    127 Mar  6 14:28 bin

drwxrwxr-x. 2 root root     62 Aug  6  2019 build-aux

-rw-rw-r--. 1 root root  74379 Aug  6  2019 ChangeLog

-rw-r--r--. 1 root root 117824 Mar  6 14:28 config.log

-rw-r--r--. 1 root root      0 Mar  6 14:28 config.stamp

-rw-rw-r--. 1 root root      0 Aug  6  2019 config.stamp.in

-rwxr-xr-x. 1 root root  42493 Mar  6 14:28 config.status

-rwxr-xr-x. 1 root root 379793 Mar  6 14:27 configure

-rw-rw-r--. 1 root root  74413 Aug  6  2019 configure.ac

-rw-rw-r--. 1 root root   1709 Aug  6  2019 COPYING

drwxrwxr-x. 2 root root    188 Mar  6 14:30 doc

drwxrwxr-x. 4 root root     41 Aug  6  2019 include

-rw-rw-r--. 1 root root  14796 Aug  6  2019 INSTALL.md

-rw-r--r--. 1 root root    371 Mar  6 14:28 jemalloc.pc

-rw-rw-r--. 1 root root    465 Aug  6  2019 jemalloc.pc.in

drwxr-xr-x. 2 root root     98 Mar  6 14:30 lib

drwxrwxr-x. 2 root root     38 Aug  6  2019 m4

-rw-r--r--. 1 root root  23927 Mar  6 14:28 Makefile

-rw-rw-r--. 1 root root  22662 Aug  6  2019 Makefile.in

drwxrwxr-x. 4 root root    114 Aug  6  2019 msvc

-rw-rw-r--. 1 root root   1047 Aug  6  2019 README

-rwxrwxr-x. 1 root root     48 Aug  6  2019 run_tests.sh

drwxrwxr-x. 2 root root     51 Aug  6  2019 scripts

drwxrwxr-x. 2 root root   8192 Mar  6 14:30 src

drwxrwxr-x. 7 root root    110 Mar  6 14:28 test

-rw-rw-r--. 1 root root   5920 Aug  6  2019 TUNING.md

-rw-r--r--. 1 root root     50 Mar  6 14:27 VERSION


评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2025-3-12 19:07 , Processed in 0.016305 second(s), 9 queries , Redis On.
返回顶部