Welcome! Log In Create A New Profile

Advanced

Re: Using nginx 1.1 with the intel compiler

Maxim Dounin
February 24, 2012 09:08PM
Hello!

On Sat, Feb 25, 2012 at 02:22:36PM +1300, Ryan Brown wrote:

> Though it actually compiles to a point then errors... (ignoring the
> -Wunused-value warnings)
>
> [root@bob:~/trunk]# export | grep cc
> CC='icc -I/usr/include/i386-linux-gnu/'
> LD_LIBRARY_PATH=/opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/ipp/../compiler/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/ipp/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/mkl/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/tbb/lib/ia32//cc4.1.0_libc2.4_kernel2.6.16.21:/opt/intel/composer_xe_2011_sp1.9.293/debugger/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/mpirt/lib/ia32
> LIBRARY_PATH=/opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/ipp/../compiler/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/ipp/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/mkl/lib/ia32:/opt/intel/composer_xe_2011_sp1.9.293/tbb/lib/ia32//cc4.1.0_libc2.4_kernel2.6.16.21
> cc=icc
> [root@bob:~/trunk]# icc --version
> icc (ICC) 12.1.3 20120212
> Copyright (C) 1985-2012 Intel Corporation. All rights reserved.

Could you please show "icc -v" and "icc -V" output?

[...]

> -I src/event/modules -I src/os/unix -I objs \
> -o objs/src/core/ngx_string.o \
> src/core/ngx_string.c
> icc: command line warning #10006: ignoring unknown option '-Wunused-value'
> src/core/ngx_string.c(1519): error: identifier "bool" is undefined
> (bool) state = 0;
> ^
>
> src/core/ngx_string.c(1519): error: expected a ";"
> (bool) state = 0;
> ^

Note: this is *not* original nginx code. There is no "(bool)"
cast in nginx here, just plain assignment.

With original code you'll get "error #188: enumerated type mixed
with another type" as in your previous message, and this warning
is expected to be disabled with icc, see auto/cc/icc:

...
# enumerated type mixed with another type
CFLAGS="$CFLAGS -wd188"
...

> from a ./configure
>
> [root@bob:~/trunk]# ./configure
> checking for OS
> + Linux 3.2.5-ck1 i686
> checking for C compiler ... found
> + using GNU C compiler
> + gcc version: 4.6.0 compatibility)

It looks like newer icc pretend to be compatible with gcc
somewhere in "icc -v" output, and nginx incorrectly mishandles it
as gcc as a result.

Something like this should help:

diff --git a/auto/cc/name b/auto/cc/name
--- a/auto/cc/name
+++ b/auto/cc/name
@@ -64,16 +64,16 @@ if [ "$CC" = bcc32 ]; then
echo " + using Borland C++ compiler"

else
+if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
+ NGX_CC_NAME=icc
+ echo " + using Intel C++ compiler"
+
+else
if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
NGX_CC_NAME=gcc
echo " + using GNU C compiler"

else
-if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
- NGX_CC_NAME=icc
- echo " + using Intel C++ compiler"
-
-else
if `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
NGX_CC_NAME=sunc
echo " + using Sun C compiler"


Alternatively, you may set CFLAGS in the environment yourself,
this will prevent nginx from setting them by it's own. Something
like

CFLAGS="-W -g" ./configure

should work.

> But when it comes to compiling it uses icc (as above), the machine
> does have gcc-4.6 installed also
>
> I didn't see any error messages in auto/cc/icc, I did noticed it
> reference icc up to 11.x but not 12?

We don't generally use icc, though occasionally check compilation
if found one available. There were no tests with 12.x yet, though
it's likely will be ok once correctly detected.

Maxim Dounin

>
>
> 2012/2/25 Maxim Dounin <mdounin@mdounin.ru>:
> > Hello!
> >
> > On Sat, Feb 25, 2012 at 12:48:34PM +1300, Ryan Brown wrote:
> >
> >> Any clues on this?
> >
> > It looks like you somehow persuaded nginx that your compiler is
> > gcc, and it uses command line arguments appropiate for gcc instead
> > of ones for icc.  See auto/cc/icc for a long list of warnings which
> > should be ignored with icc.
> >
> > Maxim Dounin
> >
> >>
> >> On Thu, Feb 23, 2012 at 10:36 AM, Ryan Brown <mp3geek@gmail.com> wrote:
> >> > Okay, manage to get it to compile,
> >> >
> >> > make[1]: Entering directory `/root/trunk'
> >> > /opt/intel/bin/icc -c -pipe  -O -W -Wall -Wpointer-arith
> >> > -Wno-unused-parameter -Wunused-function -Wunused-variable
> >> > -Wunused-value -Werror -g  -I src/core -I src/event -I
> >> > src/event/modules -I src/os/unix -I objs \
> >> >                -o objs/src/core/ngx_string.o \
> >> >                src/core/ngx_string.c
> >> > icc: command line warning #10006: ignoring unknown option '-Wunused-value'
> >> > src/core/ngx_string.c(1519): error #188: enumerated type mixed with another type
> >> >      state = 0;
> >> >            ^
> >> >
> >> > compilation aborted for src/core/ngx_string.c (code 2)
> >> > make[1]: *** [objs/src/core/ngx_string.o] Error 2
> >>
> >> _______________________________________________
> >> nginx mailing list
> >> nginx@nginx.org
> >> http://mailman.nginx.org/mailman/listinfo/nginx
> >
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Using nginx 1.1 with the intel compiler

fanboy February 22, 2012 08:32AM

Re: Using nginx 1.1 with the intel compiler

Maxim Dounin February 22, 2012 08:48AM

Re: Using nginx 1.1 with the intel compiler

fanboy February 22, 2012 09:04AM

Re: Using nginx 1.1 with the intel compiler

fanboy February 22, 2012 04:38PM

Re: Using nginx 1.1 with the intel compiler

fanboy February 24, 2012 06:50PM

Re: Using nginx 1.1 with the intel compiler

Maxim Dounin February 24, 2012 08:10PM

Re: Using nginx 1.1 with the intel compiler

fanboy February 24, 2012 08:24PM

Re: Using nginx 1.1 with the intel compiler

Maxim Dounin February 24, 2012 09:08PM

Re: Using nginx 1.1 with the intel compiler

fanboy February 24, 2012 10:18PM

Re: Using nginx 1.1 with the intel compiler

fanboy February 24, 2012 11:30PM

icc access (was Re: Using nginx 1.1 with the intel compiler)

Maxim Konovalov February 25, 2012 08:02AM

Re: icc access (was Re: Using nginx 1.1 with the intel compiler)

fanboy February 25, 2012 08:58AM

Re: icc access (was Re: Using nginx 1.1 with the intel compiler)

DenisTRUFFAUT February 28, 2012 05:39PM

Re: icc access (was Re: Using nginx 1.1 with the intel compiler)

Maxim Dounin February 29, 2012 09:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready