Bug 681

Summary: wrong compilation options for icpc (Intel C/C++ Compiler)
Product: ns-3 Reporter: Andrey Mazo <ahippo>
Component: build systemAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: ahippo, gjcarneiro
Priority: P3    
Version: ns-3-dev   
Hardware: PC   
OS: Linux   
Attachments: ./waf configure -d optimized --enable-static --check-cxx-compiler=icpc > waf_configure.log 2>&1
./waf build -j1 -vv > waf_build.log 2>&1
Pass gcc options to icc. Enable static build with icc on linux.
Pass gcc options to icc. Enable static build with icc on linux. Updated patch.

Description Andrey Mazo 2009-09-19 06:21:16 UTC
== In short == 
The build system tries to run icpc under Linux with g++ options for Darwin.

[352/876] cxx: src/core/callback-test.cc -> build/optimized/src/core/callback-test_1.o
13:50:20 runner system command -> ['/opt/intel/cc/10.1.018/bin/icpc', '-O3', '-g', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-pthread', '-Ioptimized', '-I..', '-DRUN_SELF_TESTS', '-DENABLE_GSL', '-DNS3_MODULE_COMPILATION', '../src/core/callback-test.cc', '-c', '-o', 'optimized/src/core/callback-test_1.o']
icpc: command line warning #10156: ignoring option '-c'; no argument required
icpc: command line warning #10156: ignoring option '-c'; no argument required
icpc: error #10104: unable to open '1'


== In detail ==
1) ns-3-dev revision 4c56aca26ad3
2) Gentoo Linux:
   Linux hippo_iitp 2.6.25-gentoo-r7-hippo-20080823_noqos_raid #13 Fri Jan 30 04:39:43 MSK 2009 i686 AMD Athlon(tm) Processor AuthenticAMD GNU/Linux
3) icpc (ICC) 10.1 20080801
4) Python 2.6.2
5) Full configure and build logs are in attachments.

Grepping through .waf-1.5.8-* gives that options "-compatibility_version" and "-current_version" come from function gxx_modifier_darwin() from file Tools/gxx.py.
Quick overview gives, that wscript and src/wscript gets correct env['CXX_NAME'] and env['COMPILER_CXX'].
Not yet found where they are screwed up.
Comment 1 Andrey Mazo 2009-09-19 06:26:56 UTC
Created attachment 591 [details]
./waf configure -d optimized --enable-static --check-cxx-compiler=icpc > waf_configure.log 2>&1
Comment 2 Andrey Mazo 2009-09-19 06:27:24 UTC
Created attachment 592 [details]
./waf build -j1 -vv > waf_build.log 2>&1
Comment 3 Andrey Mazo 2009-09-22 04:27:41 UTC
(In reply to comment #0)
> Grepping through .waf-1.5.8-* gives that options "-compatibility_version" and
> "-current_version" come from function gxx_modifier_darwin() from file
> Tools/gxx.py.
> Quick overview gives, that wscript and src/wscript gets correct env['CXX_NAME']
> and env['COMPILER_CXX'].
> Not yet found where they are screwed up.

It seems, it's a waf bug.
``detect'' string from Tools/icpc.py looks as following:
detect='''
find_icpc
find_ar
gxx_common_flags
gxx_modifier_darwin
cxx_load_tools
cxx_add_flags
'''

Note the gxx_modifier_darwin in this ``detect'' string.
Quick onetime fix is to replace gxx_modifier_darwin with gxx_modifier_platform in this ``detect'' string.
More sound solution is to upgrade to waf-1.5.9.

So I propose to close this bug as WONTFIX and open new bug with request to upgrade to waf-1.5.9.
Comment 4 Andrey Mazo 2009-09-22 06:32:52 UTC
(In reply to comment #3)
> (In reply to comment #0)
> Note the gxx_modifier_darwin in this ``detect'' string.
> Quick onetime fix is to replace gxx_modifier_darwin with gxx_modifier_platform
> in this ``detect'' string.
Oops, there is no gxx_modifier_platform in waf-1.5.8, so the quick fix is to remove gxx_modifier_darwin.
Comment 5 Andrey Mazo 2009-09-22 07:30:44 UTC
Created attachment 599 [details]
Pass gcc options to icc. Enable static build with icc on linux.
Comment 6 Gustavo J. A. M. Carneiro 2009-09-23 09:39:10 UTC
Comment on attachment 599 [details]
Pass gcc options to icc. Enable static build with icc on linux.

Instead of (module.env['CXX_NAME'] == 'gcc') or (module.env['CXX_NAME'] == 'icc')

Please use:

module.env['CXX_NAME'] in ['gcc', 'icc']
Comment 7 Andrey Mazo 2009-09-23 10:07:01 UTC
Created attachment 601 [details]
Pass gcc options to icc. Enable static build with icc on linux. Updated patch.
Comment 8 Gustavo J. A. M. Carneiro 2009-09-25 07:29:07 UTC
changeset:   5252:481053e0cd10
tag:         tip
user:        Andrey Mazo  <mazo@iitp.ru>
date:        Fri Sep 25 12:28:32 2009 +0100
summary:     Bug 681: wrong compilation options for icpc (Intel C/C++ Compiler)