mysql静态编译_ICC静态编译Percona

本文内容遵从CC版权协议, 可以随意转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明网址: http://www.penglixun.com/tech/database/icc_static_compile_percona.html 经过我的测试ICC在浮点运算,线程库和数学函数上的优势非常明显,原生SSE2

本文内容遵从CC版权协议, 可以随意转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明网址: http://www.penglixun.com/tech/database/icc_static_compile_percona.html

经过我的测试ICC在浮点运算,线程库和数学函数上的优势非常明显,原生SSE2指令集支持、Intel自己编写的线程库和数学函数库,性能没得说。

我用同一份运算PI值的代码在ICC和GCC下编译,提升比例达20%,实际在数据库中比较同一条超级复杂的聚合SQL,ICC提升达34%。

第一步:编译安装libunwind

wget http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99.tar.gz

tar zxvf libunwind-0.99.tar.gz

CC=icc \

CXX=icpc \

LD=xild \

AR=xiar \

CFLAGS=”-O3 -no-prec-div -ip -xSSE2 -axSSE2″ \

CXXFLAGS=”${CFLAGS}” \

./configure && make && make install

第二布:编译安装tcmalloc

wget http://google-perftools.googlecode.com/files/google-perftools-1.6.tar.gz

tar zxvf google-perftools-1.6.tar.gz

CC=icc \

CXX=icpc \

LD=xild \

AR=xiar \

CFLAGS=”-O3 -no-prec-div -ip -xSSE2 -axSSE2″ \

CXXFLAGS=”${CFLAGS}” \

./configure –disable-debugalloc –enable-frame-pointers && make && make install

echo “/usr/local/lib” > /etc/ld.so.conf.d/usr_local_lib.conf

/sbin/ldconfig

第三部:编译安装Percona

CC=icc \

CXX=icpc \

LD=xild \

AR=xiar \

CFLAGS=”-O3 -unroll2 -ip -mp -restrict -fno-exceptions -fno-rtti -no-prec-div -fno-implicit-templates -static-intel -static-libgcc -xSSE2 -axSSE2″ \

CXXFLAGS=”${CFLAGS}” \

CPPFLAGS=” -I/usr/alibaba/icc/include ” \

LDFLAGS=” -L/usr/alibaba/icc/lib -lrt ” \

./configure –prefix=/usr/alibaba/install/percona-custom-5.1.53-12.4 \

–with-server-suffix=-alibaba-edition \

–with-mysqld-user=mysql \

–with-plugins=heap,innodb_plugin,myisam,partition \

–with-charset=utf8 \

–with-collation=utf8_general_ci \

–with-extra-charsets=gbk,utf8,ascii \

–with-big-tables \

–with-fast-mutexes \

–with-zlib-dir=bundled \

–with-readline \

–with-pthread \

–with-mysqld-ldflags=’-all-static -ltcmalloc’ \

–enable-assembler \

–enable-profiling \

–enable-local-infile \

–enable-thread-safe-client \

–without-embedded-server \

–with-client-ldflags=-all-static \

–with-mysqld-ldflags=-all-static \

–with-mysqld-ldflags=-ltcmalloc \

–without-query-cache \

–without-geometry \

–without-debug \

–without-ndb-binlog \

–without-ndb-debug

编译完成后make && make install

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值