diff --git a/.ci/azp-linux-extra.yml b/.ci/azp-linux-extra.yml index 256da8df3c..e7bd6c24a0 100644 --- a/.ci/azp-linux-extra.yml +++ b/.ci/azp-linux-extra.yml @@ -18,3 +18,4 @@ steps: - { bash: "./.ci/b2_example.sh example/hello", displayName: "example/hello" } - { bash: "./.ci/b2_example.sh example/libraries", displayName: "example/libraries" } - { bash: "./.ci/b2_example.sh example/make", displayName: "example/make" } + - { bash: "./.ci/b2_example.sh example/icx", displayName: "example/icx" } diff --git a/.ci/azp-linux-prep-container.yml b/.ci/azp-linux-prep-container.yml index 40733cc79e..f0b002dfde 100644 --- a/.ci/azp-linux-prep-container.yml +++ b/.ci/azp-linux-prep-container.yml @@ -4,6 +4,7 @@ steps: target: host inputs: script: | + /usr/bin/docker pull intel/oneapi /usr/bin/docker exec -t -u root container mv /etc/sudoers /etc/sudoers.bak /usr/bin/docker exec -t -u root container apt-get -qq update /usr/bin/docker exec -t -u root container apt-get -qq install sudo diff --git a/example/icx/hello.cpp b/example/icx/hello.cpp new file mode 100644 index 0000000000..029afc1bbc --- /dev/null +++ b/example/icx/hello.cpp @@ -0,0 +1,15 @@ +// Copyright (c) 2003 Vladimir Prus +// Copyright (c) 2026 Amlal El Mahrouss +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE.txt or copy at +// https://www.bfgroup.xyz/b2/LICENSE.txt) + +// tag::source[] +#include + +int main() +{ + std::cout << "Hello ICX!\n"; +} +// end::source[] diff --git a/example/icx/jamroot.jam b/example/icx/jamroot.jam new file mode 100644 index 0000000000..0edcfc31c3 --- /dev/null +++ b/example/icx/jamroot.jam @@ -0,0 +1,6 @@ +using intel-linux : : icx ; + +project : default-build intel-linux ; + +exe hello : hello.cpp : + -ipo -ipo ; diff --git a/example/icx/readme.adoc b/example/icx/readme.adoc new file mode 100644 index 0000000000..096f16e6c4 --- /dev/null +++ b/example/icx/readme.adoc @@ -0,0 +1,51 @@ +//// +Copyright 2008 Jurko Gospodnetic +Copyright 2017 Rene Rivera +Copyright 2026 Amlal El Mahrouss +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt) +//// + += Note + +This is a specific example for the Intel C++ Compiler (icx) for testing purposes. + += Hello + +This example shows a very basic Boost Build project set up so it compiles a +single executable from a single source file: + +.`hello.cpp` +[source,cpp] +---- +include::../../example/hello/hello.cpp[tag=source] +---- + +Our `jamroot.jam` is minimal and only specifies one `exe` target for the +program: + +.`jamroot.jam` +[source,jam] +---- +include::jamroot.jam[] +---- + +Building the example yields: + +[source,bash] +---- +> cd /example/hello +> b2 +...found 8 targets... +...updating 4 targets... +common.mkdir bin/clang-darwin-4.2.1 +common.mkdir bin/clang-darwin-4.2.1/debug +clang-darwin.compile.c++ bin/clang-darwin-4.2.1/debug/hello.o +clang-darwin.link bin/clang-darwin-4.2.1/debug/hello +...updated 4 targets... +> bin/clang-darwin-4.2.1/debug/hello +Hello! +---- + +NOTE: The actual paths in the `bin` sub-directory will depend on your +toolset. diff --git a/src/tools/intel-linux.jam b/src/tools/intel-linux.jam index 32cf6a525d..c79e7e2e6d 100644 --- a/src/tools/intel-linux.jam +++ b/src/tools/intel-linux.jam @@ -195,7 +195,7 @@ rule init ( version ? : command * : options * ) 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" ; + flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ipo" ; } else if [ numbers.less $(tool_version[1]) 11 ] { @@ -203,7 +203,7 @@ rule init ( version ? : command * : options * ) 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" ; + flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ipo" ; } else # newer version of intel do have -Os (at least 11+, don't know about 10) { @@ -211,7 +211,7 @@ rule init ( version ? : command * : options * ) 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" ; + flags intel-linux.compile OPTIONS $(condition)/speed : "-O3 -ipo" ; } if [ numbers.less $(tool_version[1]) 2020 ] {