Bug #41807 Intel C++ Compiler 11.0 and BUILD Scripts
Submitted: 31 Dec 2008 12:55 Modified: 10 Jan 2009 10:51
Reporter: Meng Wang Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0.75 /5.1.30 OS:Linux (Fedora 10)
Assigned to: Paul DuBois CPU Architecture:Any
Tags: icc compiling linux build

[31 Dec 2008 12:55] Meng Wang
Description:
Hi, i tested in mysql 5.1.30 and mysql 5.0.75 in fedora10(2.6.27.9-159.fc10.i686) with (icc v11.0.74 and icc stm v3.0) using ./BUILD/compile-pentium-icc and ./BUILD/compile-pentium-icc-valgrind-max compile fails.

e.g use icc 11.074 and ./BUILD/compile-pentium-icc get:
 
icc -O3 -fno-omit-frame-pointer -unroll2 -restrict -no-ipo -rdynamic -o comp_err comp_err.o -static  ../mysys/libmysys.a ../dbug/libdbug.a ../strings/libmystrings.a -lz -lpthread -lcrypt -lnsl -lm -lpthread
ld: cannot find -lz
gmake[2]: *** [comp_err] error 1
gmake[2]: Leaving directory `/home/ruyi7952/lamp/mysql-5.1.30/extra'
gmake[1]: *** [../include/mysqld_error.h] error 2
gmake[1]: Leaving directory `/home/ruyi7952/lamp/mysql-5.1.30/extra'
gmake: *** [all-recursive] error 1

How to repeat:
install icc 11.0 and icc smt 3.0
use ./BUILD/compile-pentium-icc and ./BUILD/compile-pentium-icc-valgrind-max compile source.
[31 Dec 2008 16:28] Sveta Smirnova
Thank you for the report.

BUILD/* scripts are not supported. Please use configure located in the *.tar.gz package. Alternatively you can set environment variables so they point to correct (icc) compiler and use BUILD/compile-pentium-* which could work.
[1 Jan 2009 2:54] Meng Wang
Thanks you for your time.

Now, I have try use the ./configure to compile,with this from the v5.1 doc :

$CC=icc CXX=icpc CFLAGS="-O3 -unroll2 -ip -mp -no-gcc -restrict" CXXFLAGS="-O3 -unroll2 -ip -mp -no-gcc -restrict" ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --disable-shared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static

but get error too,

icc -O3 -unroll2 -ip -mp -no-gcc -restrict -o replace replace.o -static  ../mysys/libmysys.a ../dbug/libdbug.a ../strings/libmystrings.a -lz -lpthread -lcrypt -lnsl -lm -lpthread
icc: command line remark #10010: option '-mp' is deprecated and will be removedin a future release. See '-help deprecated'
ld: cannot find -lz
make[3]: *** [replace] 错误 1
make[3]: Leaving directory `/home/ruyi7952/lamp/mysql-5.1.30/extra'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/home/ruyi7952/lamp/mysql-5.1.30/extra'
make[1]: *** [all] 错误 2
make[1]: Leaving directory `/home/ruyi7952/lamp/mysql-5.1.30/extra'
make: *** [all-recursive] 错误 1

in v11.0 only this can working:
$CC=icc CXX=icpc ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --libexecdir=/usr/local/mysql/bin --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-assembler --disable-shared --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static

-_- 

i needed icc v9 or v8 to compile mysql???
[1 Jan 2009 12:56] Sveta Smirnova
Thank you for the feedback.

I believe you say about page at http://dev.mysql.com/doc/refman/5.1/en/mysql-binaries.html

Right, information there is not up to date, although you can download any *icc* *.tar.gz package and examine which options our build team uses now. Currently they use next flags:

COMP_CALL_INFO="CC='icc  -static-intel -static-libgcc'  CFLAGS='-g -O3 -unroll2 -ip -mp -restrict'  CXX='icpc -static-intel -static-libgcc'  CXXFLAGS='-g -O3 -unroll2 -ip -mp -restrict'  LDFLAGS=''  ASFLAGS=''"
COMP_RUN_INFO="CC='icc  -static-intel -static-libgcc'  CFLAGS=' -g -O3 -unroll2 -ip -mp -restrict   -DUNIV_LINUX'  CXX='icpc -static-intel -static-libgcc'  CXXFLAGS=' -g -O3 -unroll2 -ip -mp -restrict   -fno-implicit-templates -fno-exceptions -fno-rtti'  LDFLAGS=' -rdynamic '  ASFLAGS=''"
CONFIGURE_LINE="./configure  '--prefix=/usr/local/mysql' '--localstatedir=/usr/local/mysql/data' '--libexecdir=/usr/local/mysql/bin' '--with-comment=MySQL Community Server (GPL)' '--with-server-suffix=' '--enable-thread-safe-client' '--enable-local-infile' '--enable-assembler' '--with-pic' '--with-fast-mutexes' '--with-client-ldflags=-static' '--with-mysqld-ldflags=-static' '--with-zlib-dir=bundled' '--with-big-tables' '--with-readline' '--with-embedded-server' '--with-partition' '--with-innodb' '--without-ndbcluster' '--with-archive-storage-engine' '--with-blackhole-storage-engine' '--with-csv-storage-engine' '--without-example-storage-engine' '--with-federated-storage-engine' '--with-extra-charsets=complex' 'CC=icc  -static-intel -static-libgcc' 'CFLAGS=-g -O3 -unroll2 -ip -mp -restrict' 'CXX=icpc -static-intel -static-libgcc' 'CXXFLAGS=-g -O3 -unroll2 -ip -mp -restrict'"

Regarding your question "i needed icc v9 or v8 to compile mysql???" you said "in v11.0 only this can working: ...", so it proves v11.0 works :)

Anyway documentation should contain at least a note about build information can be out of date. Re-classified as documentation bug.
[2 Jan 2009 5:26] Meng Wang
thanks you! compiled and working with v11.0~!

I have using:

./configure  '--prefix=/usr/local/mysql' '--localstatedir=/usr/local/mysql/data' '--libexecdir=/usr/local/mysql/bin' '--with-comment=MySQL Community Server (GPL)' '--with-server-suffix=' '--enable-thread-safe-client' '--enable-local-infile' '--enable-assembler' '--with-pic' '--with-fast-mutexes' '--with-client-ldflags=-static' '--with-mysqld-ldflags=-static' '--with-zlib-dir=bundled' '--with-big-tables' '--with-readline' '--with-partition' '--with-innodb' '--without-ndbcluster' '--without-archive-storage-engine' '--without-blackhole-storage-engine' '--without-csv-storage-engine' '--without-example-storage-engine' '--without-federated-storage-engine' '--with-extra-charsets=complex''CC=icc -xSSE2,SSE3,SSE3_ATOM,SSE4.1,SSE4.2 -axSSE2,SSE3,SSE4.1,SSE4.2 -static-intel -static-libgcc' 'CFLAGS=-O3 -unroll2 -ip -fp-model source -restrict' 'CXX=icpc -xSSE2,SSE3,SSE3_ATOM,SSE4.1,SSE4.2 -axSSE2,SSE3,SSE4.1,SSE4.2  -static-intel -static-libgcc' 'CXXFLAGS=-O3 -unroll2 -ip -fp-model source  -restrict -fno-implicit-templates -fno-exceptions -fno-rtti'
[2 Jan 2009 5:38] Meng Wang
and with my old Dell Latitude D610 use (P-M 1.7 Support SSE2):

./configure  '--prefix=/usr/local/mysql' '--localstatedir=/usr/local/mysql/data'
'--libexecdir=/usr/local/mysql/bin' '--with-comment=MySQL Community Server (GPL)'
'--with-server-suffix=' '--enable-thread-safe-client' '--enable-local-infile'
'--enable-assembler' '--with-pic' '--with-fast-mutexes' '--with-client-ldflags=-static'
'--with-mysqld-ldflags=-static' '--with-zlib-dir=bundled' '--with-big-tables'
'--with-readline' '--with-partition' '--with-innodb' '--without-ndbcluster'
'--without-archive-storage-engine' '--without-blackhole-storage-engine'
'--without-csv-storage-engine' '--without-example-storage-engine'
'--without-federated-storage-engine' '--with-extra-charsets=complex''CC=icc
-xSSE2 -axSSE2 -static-intel
-static-libgcc' 'CFLAGS=-O3 -unroll2 -ip -fp-model source -restrict' 'CXX=icpc
-xSSE2 -axSSE2 -static-intel
-static-libgcc' 'CXXFLAGS=-O3 -unroll2 -ip -fp-model source  -restrict
-fno-implicit-templates -fno-exceptions -fno-rtti'
[2 Jan 2009 8:32] Meng Wang
in v10.1 compiled with:
[ruyi7952@D610 mysql-5.0.75]$ ./configure  '--prefix=/usr/local/mysql' '--localstatedir=/usr/local/mysql/data' '--libexecdir=/usr/local/mysql/bin' '--with-comment=MySQL Community Server (GPL)' '--with-server-suffix=' '--enable-thread-safe-client' '--enable-local-infile' '--enable-assembler' '--with-pic' '--with-fast-mutexes' '--with-client-ldflags=-static' '--with-mysqld-ldflags=-static' '--with-zlib-dir=bundled' '--with-big-tables' '--with-readline' '--with-partition' '--with-innodb' '--without-ndbcluster' '--without-archive-storage-engine' '--without-blackhole-storage-engine' '--without-csv-storage-engine' '--without-example-storage-engine' '--without-federated-storage-engine' '--with-extra-charsets=complex''CC=icc -xN -axN -static-intel -static-libgcc' 'CFLAGS=-O3 -unroll2 -ip -mp  -restrict' 'CXX=icpc -xN -axN -static-intel -static-libgcc' 'CXXFLAGS=-O3 -unroll2-ip -mp -restrict -fno-implicit-templates -fno-exceptions -fno-rtti'
[9 Jan 2009 19:47] Paul DuBois
This is not a bug.

The original problem is:

ld: cannot find -lz

So the configuration process must specify a location for zlib, the compression library. Later entries in this bug report use build scripts that provide the configure option of --with-zlib-dir=bundled, so the build succeeds.
[10 Jan 2009 10:51] Meng Wang
I hava installed zlib in my Fedora10 ,but the BUILD scripts  do not included "--with-zlib-dir=bundled" ,so get error ld: cannot find -lz. i know, i checked.

The part of docs 5.1 it's very old ,i get more error on linking and compileing, 'ld:zlib' it's one error ,it's not only error.