|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-05-26 09:25:05
Folks,
intel toolset for V2 is now almost ready, supporting both Linux (thanks to
Michael Stevens) and Windows.
Here's a brief description.
There are two real toolset modules: intel-linux and intel-win. Both make use
of <toolset>intel, but have different value of 'platform' subfeature. So, one
can do
bjam intel
bjam intel-win
The toolsets are initialized by
using intel-win : ..... ;
using intel-linux : .... ;
To help the users which have only one platform, there's simpler syntax:
using intel : .... ;
which will forward to appropriate toolset module depending on the current
platform.
I've decided that in the end, "intel" is better that "icc", in particular
because the compiler is called "icl" on windows.
The toolset is attached. It passes all tests on both linux and windows. The
only thing left to do is support "base-toolset" on windows, and add some
flags on the same platform.
Any comments?
- Volodya
--Boundary-00=_BjKtAQJqhMDY8X3 Content-Type: text/plain;
charset="us-ascii";
name="intel-win.jam"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="intel-win.jam"
# Copyright Vladimir Prus 2004.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
import toolset ;
import feature ;
import toolset : flags ;
import os ;
# This is needed because the rule we import here depend on 'common'
# That's nasty.
import common ;
import intel ;
feature.extend-subfeature toolset intel : platform : win ;
import msvc ;
toolset.inherit-generators intel-win <toolset>intel <toolset-intel:platform>win : msvc ;
toolset.inherit-flags intel-win : msvc ;
toolset.inherit-rules intel-win : msvc ;
# Initializes the intel toolset for windows
rule init ( version : # version is mandatory
setup # patch to the iclvars.bat script
)
{
feature.extend-subfeature toolset intel : version : $(version) ;
check-setup $(version) : $(setup) ;
setup = "call \""$(setup)"\" > nul " ;
if [ os.name ] = NT
{
setup = $(setup)"
" ;
}
else
{
setup = "cmd /S /C "$(setup)" \"&&\" " ;
}
local condition = <toolset>intel-win-$(version) ;
flags intel-win.compile .CC $(condition) : $(setup)icl ;
flags intel-win.link .LD $(condition) : $(setup)xilink ;
flags intel-win.archive .LD $(condition) : $(setup)xilink ;
}
rule check-setup ( version : setup )
{
if ! [ GLOB $(setup:D) : $(setup:D=) ]
{
ECHO warning: toolset intel-win $(version) initialization: ;
ECHO warning: couldn't find compiler ;
}
}
flags intel-win.link LIBRARY_OPTION <toolset>intel : "" ;
--Boundary-00=_BjKtAQJqhMDY8X3 Content-Type: text/plain;
charset="us-ascii";
name="intel-linux.jam"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="intel-linux.jam"
# Copyright (c) 2003 Michael Stevens
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)
import toolset ;
import feature ;
import toolset : flags ;
import intel ;
feature.extend-subfeature toolset intel : platform : linux ;
toolset.inherit-generators intel-linux <toolset>intel <toolset-intel:platform>linux : gcc ;
toolset.inherit-flags intel-linux : gcc
: <inlining>off <inlining>on <inlining>full <optimization>space ;
toolset.inherit-rules intel-linux : gcc ;
# Initializes the intel-linux toolset
# version in mandatory
# name (default icc) is used to invoke the specified intellinux complier
# compile and link options allow you to specify addition command line options for each version
rule init ( version : name ? : compile_options * : link_options * )
{
name ?= "icc" ;
feature.extend-subfeature toolset intel : version : $(version) ;
flags intel-linux CONFIG_NAME <toolset>intel-linux-$(version) : $(name) ;
flags intel-linux CONFIG_COMPILE <toolset>intel-linux-$(version) : $(compile_options) ;
flags intel-linux CONFIG_LINK <toolset>intel-linux-$(version) : $(link_options) ;
}
flags intel-linux.compile OPTIONS <inlining>off : "-Ob0" ;
flags intel-linux.compile OPTIONS <inlining>on : "-Ob1" ;
flags intel-linux.compile OPTIONS <inlining>full : "-Ob2" ;
flags intel-linux.compile OPTIONS <optimization>space : "-O1" ; # no specific space optimization flag in icc
actions compile.c++
{
$(CONFIG_NAME) -c -xc++ $(CONFIG_COMPILE) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
actions compile.c
{
$(CONFIG_NAME) -c -xc $(CONFIG_COMPILE) $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
actions link bind LIBRARIES
{
$(CONFIG_NAME) $(CONFIG_LINK) $(OPTIONS) -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME)
}
# Differ from 'link' above only by -shared.
actions link.dll bind LIBRARIES
{
$(CONFIG_NAME) $(CONFIG_LINK) $(OPTIONS) -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-h$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) "$(LIBRARIES)" -Wl,-Bdynamic -l$(FINDLIBS-SA) -Wl,-Bstatic -l$(FINDLIBS-ST) -Wl,-B$(LINK-RUNTIME)
}
--Boundary-00=_BjKtAQJqhMDY8X3 Content-Type: text/plain;
charset="us-ascii";
name="intel.jam"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="intel.jam"
# Copyright Vladimir Prus 2004.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
# This is a generic 'intel' toolset. Depending on the current
# system, it forwards either to 'intel-linux' or 'intel-win'
# modules.
import feature ;
import os ;
import toolset ;
feature.extend toolset : intel ;
feature.subfeature toolset intel : platform : : propagated link-incompatible ;
feature.subfeature toolset intel : version : : propagated link-incompatible ;
rule init ( * : * )
{
if [ os.name ] = LINUX
{
toolset.using intel-linux :
$(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
}
else
{
toolset.using intel-win :
$(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
}
}
--Boundary-00=_BjKtAQJqhMDY8X3--
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk