diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index 06e11fe03..24ec55800 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -1,4 +1,5 @@ # Copyright (c) 2003 Michael Stevens +# Copyright (c) 2011 Bryce Lelbach # # Use, modification and distribution is subject to the Boost Software # License Version 1.0. (See accompanying file LICENSE_1_0.txt or @@ -44,15 +45,55 @@ if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] # Initializes the intel-linux toolset # version in mandatory -# name (default icc) is used to invoke the specified intellinux complier +# name (default icpc) is used to invoke the specified intel-linux complier # compile and link options allow you to specify addition command line options for each version rule init ( version ? : command * : options * ) { local condition = [ common.check-init-parameters intel-linux : version $(version) ] ; + if $(.debug-configuration) + { + ECHO "notice: intel-linux version is" $(version) ; + } + + local default_path ; + + # Intel C++ Composer XE 2011 for Linux, aka Intel C++ Compiler XE 12.0, + # aka intel-linux-12.0. In this version, Intel thankfully decides to install + # to a sane 'intel' folder in /opt. + if [ MATCH "(12[.]0|12)" : $(version) ] + { default_path = /opt/intel/bin ; } + # Intel C++ Compiler 11.1. + else if [ MATCH "(11[.]1)" : $(version) ] + { default_path = /opt/intel_cce_11.1.064.x86_64/bin ; } + # Intel C++ Compiler 11.0. + else if [ MATCH "(11[.]0|11)" : $(version) ] + { default_path = /opt/intel_cce_11.0.074.x86_64/bin ; } + # Intel C++ Compiler 10.1. + else if [ MATCH "(10[.]1)" : $(version) ] + { default_path = /opt/intel_cce_10.1.013_x64/bin ; } + # Intel C++ Compiler 9.1. + else if [ MATCH "(9[.]1)" : $(version) ] + { default_path = /opt/intel_cc_91/bin ; } + # Intel C++ Compiler 9.0. + else if [ MATCH "(9[.]0|9)" : $(version) ] + { default_path = /opt/intel_cc_90/bin ; } + # Intel C++ Compiler 8.1. + else if [ MATCH "(8[.]1)" : $(version) ] + { default_path = /opt/intel_cc_81/bin ; } + # Intel C++ Compiler 8.0 - this used to be the default, so now it's the + # fallback. + else + { default_path = /opt/intel_cc_80/bin ; } + + if $(.debug-configuration) + { + ECHO "notice: default search path for intel-linux is" $(default_path) ; + } + command = [ common.get-invocation-command intel-linux : icpc - : $(command) : /opt/intel_cc_80/bin ] ; + : $(command) : $(default_path) ] ; common.handle-options intel-linux : $(condition) : $(command) : $(options) ; @@ -77,12 +118,24 @@ rule init ( version ? : command * : options * ) flags intel-linux.compile OPTIONS $(condition)/off : "-Ob0" ; flags intel-linux.compile OPTIONS $(condition)/on : "-Ob1" ; flags intel-linux.compile OPTIONS $(condition)/full : "-Ob2" ; + flags intel-linux.compile OPTIONS $(condition)/space : "-O1" ; + flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; } - else + else if $(major) && [ numbers.less $(major) 11 ] + { + flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; + flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; + flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; + flags intel-linux.compile OPTIONS $(condition)/space : "-O1" ; + flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; + } + else # newer version of intel do have -Os (at least 11+, don't know about 10) { flags intel-linux.compile OPTIONS $(condition)/off : "-inline-level=0" ; flags intel-linux.compile OPTIONS $(condition)/on : "-inline-level=1" ; flags intel-linux.compile OPTIONS $(condition)/full : "-inline-level=2" ; + flags intel-linux.compile OPTIONS $(condition)/space : "-Os" ; + flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ip" ; } if $(root) @@ -103,9 +156,6 @@ rule init ( version ? : command * : options * ) SPACE = " " ; -flags intel-linux.compile OPTIONS space : "-O1" ; # no specific space optimization flag in icc -flags intel-linux.compile OPTIONS speed : "-O3 -ip" ; # no specific space optimization flag in icc - flags intel-linux.compile OPTIONS off : -w0 ; flags intel-linux.compile OPTIONS on : -w1 ; flags intel-linux.compile OPTIONS all : -w2 ;