Bug #46309 | MySQL 5.1.36 fails to compile using ICC 11.1 | ||
---|---|---|---|
Submitted: | 20 Jul 2009 15:05 | Modified: | 29 Jul 2010 15:16 |
Reporter: | Paolo Rodriguez | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S2 (Serious) |
Version: | 5.1.36, 5.1 bzr | OS: | Linux (RHEL 5.2) |
Assigned to: | Kent Boortz | CPU Architecture: | Any |
Tags: | compile, icc |
[20 Jul 2009 15:05]
Paolo Rodriguez
[22 Jul 2009 6:54]
Sveta Smirnova
Thank you for the report. Please test if you have same error without specifying CFLAGS="-O3 -unroll2 -ip -mp -no-gcc -restrict" CXXFLAGS="-O3 -unroll2 -ip -mp -no-gcc -restrict" flags.
[22 Jul 2009 7:53]
Paolo Rodriguez
Hello; Issue still present: # make clean [snip] # source /opt/intel/Compiler/11.1/046/bin/iccvars.sh ia32 # 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 --with-embedded-server --with-plugins=innobase [snip] # make [snip] icc -DDEFAULT_BASEDIR=\"/usr/local/mysql\" -DDATADIR="\"/usr/local/mysql/data\"" -DDEFAULT_CHARSET_HOME="\"/usr/local/mysql\"" -DSHAREDIR="\"/usr/local/mysql/share/mysql\"" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DDEFAULT_SYSCONFDIR="\"/usr/local/mysql/etc\"" -DHAVE_CONFIG_H -I. -I../include -I../include -I../include -I. -O3 -DUNIV_LINUX -MT my_vle.o -MD -MP -MF .deps/my_vle.Tpo -c -o my_vle.o my_vle.c mv -f .deps/my_vle.Tpo .deps/my_vle.Po icc -DDEFAULT_BASEDIR=\"/usr/local/mysql\" -DDATADIR="\"/usr/local/mysql/data\"" -DDEFAULT_CHARSET_HOME="\"/usr/local/mysql\"" -DSHAREDIR="\"/usr/local/mysql/share/mysql\"" -DDEFAULT_HOME_ENV=MYSQL_HOME -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX -DDEFAULT_SYSCONFDIR="\"/usr/local/mysql/etc\"" -DHAVE_CONFIG_H -I. -I../include -I../include -I../include -I. -O3 -DUNIV_LINUX -MT my_atomic.o -MD -MP -MF .deps/my_atomic.Tpo -c -o my_atomic.o my_atomic.c ../include/my_atomic.h(99): error: first argument must be a pointer to integer or enumeration type make_atomic_cas(ptr) ^ ../include/my_atomic.h(99): error: a value of type "void" cannot be assigned to an entity of type "void *" make_atomic_cas(ptr) ^ ../include/my_atomic.h(108): error: first argument must be a pointer to integer or enumeration type make_atomic_load(ptr) ^ ../include/my_atomic.h(108): error: a value of type "void" cannot be assigned to an entity of type "void *" make_atomic_load(ptr) ^ ../include/my_atomic.h(113): error: first argument must be a pointer to integer or enumeration type make_atomic_store(ptr) ^ ../include/my_atomic.h(118): error: first argument must be a pointer to integer or enumeration type make_atomic_swap(ptr) ^ ../include/my_atomic.h(118): error: a value of type "void" cannot be assigned to an entity of type "void *" make_atomic_swap(ptr) ^ compilation aborted for my_atomic.c (code 2) make[1]: *** [my_atomic.o] Error 2 make[1]: Leaving directory `/root/downloads/mysql-5.1.36/mysys' make: *** [all-recursive] Error 1
[28 Jul 2009 10:07]
Sveta Smirnova
Thank you for the feedback. Verified as described. Problem is only repeatable with ICC 11.1 With ICC 10 everything works fine.
[26 Aug 2009 7:47]
Meng Wang
MySQL 5.4.1-Beta with icc 11.1. icc: command line warning #10156: ignoring option '-s'; no argument required ../include/my_atomic.h(107): error: first argument must be a pointer to integer or enumeration type make_atomic_cas(ptr) ^ ../include/my_atomic.h(107): error: a value of type "void" cannot be assigned to an entity of type "void *" make_atomic_cas(ptr) ^ ../include/my_atomic.h(116): error: first argument must be a pointer to integer or enumeration type make_atomic_load(ptr) ^ ../include/my_atomic.h(116): error: a value of type "void" cannot be assigned to an entity of type "void *" make_atomic_load(ptr) ^ ../include/my_atomic.h(121): error: first argument must be a pointer to integer or enumeration type make_atomic_store(ptr) ^ ../include/my_atomic.h(126): error: first argument must be a pointer to integer or enumeration type make_atomic_swap(ptr) ^ ../include/my_atomic.h(126): error: a value of type "void" cannot be assigned to an entity of type "void *" make_atomic_swap(ptr) ^ compilation aborted for my_atomic.c (code 2) make[1]: *** [my_atomic.o] Error 2 make[1]: Leaving directory `/root/working/mysql-5.4.1-beta/mysys' make: *** [all-recursive] Error 1 root@ubuntu:~/working/mysql-5.4.1-beta#
[26 Aug 2009 14:48]
Meng Wang
MySQL 5.1.37 and icc 11.1 fails too. icc: command line warning #10156: ignoring option '-s'; no argument required ../include/my_atomic.h(99): error: first argument must be a pointer to integer or enumeration type make_atomic_cas(ptr) ^ ../include/my_atomic.h(99): error: a value of type "void" cannot be assigned to an entity of type "void *" make_atomic_cas(ptr) ^ ../include/my_atomic.h(108): error: first argument must be a pointer to integer or enumeration type make_atomic_load(ptr) ^ ../include/my_atomic.h(108): error: a value of type "void" cannot be assigned to an entity of type "void *" make_atomic_load(ptr) ^ ../include/my_atomic.h(113): error: first argument must be a pointer to integer or enumeration type make_atomic_store(ptr) ^ ../include/my_atomic.h(118): error: first argument must be a pointer to integer or enumeration type make_atomic_swap(ptr) ^ ../include/my_atomic.h(118): error: a value of type "void" cannot be assigned to an entity of type "void *" make_atomic_swap(ptr) ^ compilation aborted for my_atomic.c (code 2) make[1]: *** [my_atomic.o] Error 2 make[1]: Leaving directory `/root/working/mysql-5.1.37/mysys' make: *** [all-recursive] Error 1 root@ubuntu:~/working/mysql-5.1.37#
[31 Aug 2009 9:13]
Heinz Bast
You should not use option -no-gcc. The Intel compiler is supposed to be compatible to the GNU GCC compiler - in particular regarding the MySQL source code. Thus please give a try again omitting switch -no-gcc. There is no way to get the MySQL code compiled using ICC and option -no-gcc. additional notes: - you should not use option -mp anymore. This is a depreciated option for the 11.1 Intel compiler. A replacement would be "-fp-model strict'. However these kind of options for the floating point optimization have been recommended to prevent a few test cases ( less than 3 - depending on the architecture) of the MySQL test suite "mysql-test" to fail in which e.g. FP values are compared by '==' which is something you should not do. It is not related to the Intel compiler doing something wrong - but e.g. the FP code generated by the Intel compiler uses SSE registers (64 bit) while GCC uses x87 (80 bits). Thus in case you want to get full FP optimizations too ( e.g. for FP data conversions) , don't use any of these options. - the option '-ip' is redundant in this case. Since release 9.0, the Intel compiler adds file-local interprocedural optimization ( this is what -ip is doing ) implicitly when optimization level is -O2 or higher.
[1 Sep 2009 21:01]
Neil Armstrong
I've just tried to compile mysql 5.1.37 using ICC 11.1.046 with just the next options: CC=icc CXX=icpc ./configure -prefix=/usr/local/mysql - got the same errors as described
[3 Sep 2009 8:56]
Heinz Bast
Vars, Meng, Paolo: Yes - you are right and - sorry about that - I haven't tested it by my own before adding my comment. The issue is not fixed by only omitting -no-gcc (but all I added above remains valid). I analyzed the problem it detail. Below some notes on what is going wrong. Until we (Intel) will fix this in the compiler, please use one of these potential workarounds to avoid the problem - use the 11.0 compiler, not 11.1 - change your shell environment to set mysql_cv_gcc_atomic_builtins=no before you run 'configure' ( e.g export mysql_cv_gcc_atomic_builtins=no ) - remove the line containing HAVE_GCC_ATOMIC_BUILTINS=1 from include/config.h after 'configure' but before running 'make' What is going wrong ? The recent 11.1 Intel C/C++ compilers introduced support for 'builtin' support of the synchronization primitives like __sync_val_compare_and_swap( ) as described in http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html . However unlike GCC, the Intel compiler currently only supports these generic intrinsics for integral data types but not for pointers. Now, the 'configure' scripts of MySQL detects the atomic sync builtin support to be available but here the test is done with an integer data type. But later in the code (mysys/my_atomic.c) a pointer data type is used too causing the failure. I have filed the problem to Intel compiler engineering and will update this bug entry with any relevant news.
[6 Nov 2009 10:23]
Heinz Bast
The issue has been fixed in the latest update of the Intel Compiler 11.1-059 ( Release 11.1 Update 3). The compiler is available for download from http://registrationcenter.intel.com The atomic builin functions like __sync_val_compare_and_swap( ) are now supported for pointer type too. MySQL 5.1.38 compiles fine without any of workarounds listed above. I tested this for 32 bit x86-architecture, 64 bit x86 architecture and Itanium. This case can be considered 'closed' then.
[6 Nov 2009 11:26]
Neil Armstrong
Great news! Thank you!