Compile PHP5.2.1 with ICC9

由于PHP4的FastCGI的bug,迫使我将wordpress的php升级到php5.PHP4的configure在x86_64上一直有bug,以前是自己修改了4.4.4的mc,现在4.4.6实在是没有精力再去改了.PHP5在64bit上的编译虽说是好点,但也不怎么样.折腾了半天,尤其是我用的ICC来编译的,好像没有什么人做.-fast导致xml无法测试.最后还是使用和以前类似的flags.我的编译脚本如下:


flags="-cxxlib-icc -i-static -unroll2 -no-prec-div -O2 -xP"
CC=icc \
CXX=icpc \
CFLAGS="$flags" \
CXXFLAGS="$flags" \
./configure \
--prefix=/usr/local \
--with-libdir=lib64 \
--enable-force-cgi-redirect \
--enable-fastcgi \
--enable-ftp \
--enable-calendar \
--enable-mbstring \
--enable-mbstr-enc-trans \
--enable-mbregex \
--enable-shmod \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvshm \
--enable-inline-optimization \
--disable-ipv6 \
--disable-debug \
--with-config-file-path=/usr/local/etc \
--with-config-file-scan-dir=/usr/local/etc/php.d \
--with-zlib=/usr \
--with-curl=/usr \
--with-dom=/usr \
--with-dom-xslt \
--with-gd=/usr \
--enable-json \
--enable-gd-native-ttf \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-gettext \
--with-mysql=/usr \
--with-mysqli \
--with-freetype-dir=/usr \
--with-iconv  \
--with-libxml-dir=/usr \
--enable-xml \
--with-kerberos \
--with-pcre-regex \
--with-snmp=/usr  \
--with-mime-magic=/usr/share/file/magic.mime

我把openssl已经去掉,如果加上shared,则无法正确link.
其实-O3好像也可以,但我最开始的时候导致icc的段违例,根据下面的测试,-O2似乎速度也很快.

这里有一个哥们测试了PHP4/5在ICC,GCC下面的效率,他似乎使用了-fast,但是实际上如果编译一些extension,-fast是无法通过的.

- [http://blog.robinz.info/archives/2006/05/13/compile-amp-with-icc-php/](http://blog.robinz.info/archives/2006/05/13/compile-amp-with-icc-php/)

下面这是在windows上64bit编译php的,我是没机会测试了,马上要把t41换成mac book pro了,呵呵

- [http://www.fusionxlan.com/PHPx64/how-to-compile.html](http://www.fusionxlan.com/PHPx64/how-to-compile.html)

Comments

Leave a Reply