cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Compiling with the Intel compiler

From: Tor Arntsen <tor_at_spacetec.no>
Date: Wed, 25 Feb 2004 12:38:37 +0100

On Feb 25, 10:22, Daniel Stenberg wrote:
>On Mon, 23 Feb 2004, Tor Arntsen wrote:
>
>> In fact icc 8.0 defines __GNUC__ which is what the configure script checks
>> for.
>>
>> It even defines __GNUC__=3 and __GNUC_MINOR__=2! Intel tries really hard to
>> make this compiler look like gcc, except in the name. But still, it
>> understands only -Wall, not the individual -W options. Oh well. We may have
>> to go for the version >= 5 hack for the ares module as well.
>
>I'm actually going to take one step further. Since icc defines the symbol
>__ICC (again thanks to http://predef.sf.net/) I'm gonna try running the cpp to
>detect ICC and then avoid setting some options.
>
>When doing this, I can detect icc pretty accurately. What options would make
>sense to set in this case? I mean when building --enable-debug with icc.

Yesterday I did a bunch of builds with different combinations of flags, here
are some suggestions. NB: This is for ICC 8.0 (6.0 and older doesn't have
the -Wall flag, although it does have -wd<n>. I don't know about icc 7.0 as
I never used that version because of its license).

"-Wall" makes it pretty chatty.
"-wd279" turns of that noisy remark triggered by e.g. 'while (1).'
Then there's "-Wcheck" which turns most of those remarks into warnings, this
is probably not particularly useful.
"-Wp64" is supposed to warn about 64bit portability problems, but I think it's
not particulary useful -- it only works on ia64, not i386, and it doesn't make
any difference on the ia64 anyway (it detects long/int problems just fine
already!)

 -Wall -wd279 for icc 8.0 seems useful, although it generates hundreds of
warnings/remarks.
Even compiling without -Wall makes icc generate a bunch of warnings.

I also found out about the -no-gcc flag, with this flag icc doesn't define
the __GNUC__ flags, and thus isn't detected by autoconf as gcc. Using this
flag I could do some builds testing the different options.
I uploaded two builds so you can see for yourself, one with -no-gcc
(which means that with the current autoconf no flags should be set), and
another with -no-gcc -Wall -wd279.
The latter generates remarks, the former only warnings.
The uploads should show up on the autobuild page any minute now..

>I've also moved out this logic into a separate "function" (AC_DEFUN) in
>acinclude.m4, so that it will become easier to just copy this function to the
>ares source tree.

That sounds good.

-Tor
Received on 2004-02-25