User Guide

  • XX.XX
  • 04/09/2020
  • Public Content

Building Wind River* Linux* Images and Applications from the Command Line

Before compiling applications for running on a target Wind River Linux OS, for a command line build you must install Wind River Linux 17 LTS, or Wind River Linux 9.0. Then build the
sysroot
for the target platform.
To find out more about Wind River Linux and how to install the required Wind River Linux tool-chain, go to http://www.windriver.com/products/linux/.
Intel® System Studio provides an integration layer and several recipes to integrate with the Wind River Linux project development environment. For more information, see https://software.intel.com/en-us/articles/using-intel-system-studio-with-wind-river-linux-build-environment.

Platform Development: Using ICC in the Wind River Image Build Environment as a Secondary Compiler

When you have used the integration layer to integrate Intel® System Studio, you can build a platform image using the GNU* Compiler Collection* (GCC*) as the primary compiler and use the Intel® C++ Compiler (ICC) as a secondary compiler. For example, when building the platform image with GCC, you can include an application, built using the Intel® C++ Compiler, as part of the image.
To enable the Intel® C++ Compiler to build a specific package, add the following line in the package recipe
.bb
file:
TOOLCHAIN_pn-${PN} = "icc"
The Intel® C++ Compiler is now invoked automatically when you use this recipe
.bb
file to build this package.

App Development: When the Wind River SDK is Built with ICC Environment Scripts

When you have used the integration layer to integrate Intel® System Studio when you build the SDK from a Wind River Linux platform project, the Intel® C++ Compiler build environment script file is automatically generated in the same folder in which the default GCC environment scripts are located.
To set up the build environment to use the Intel® C++ Compiler for building, source the ICC environment script. The ICC environment script has the same name as the file for the GCC but with the extension
-icc
. When you source the ICC environment script, it overwrites the environment variables CC, CXX, AR and LD. For example, on a Linux system:
source /
WRL_SDK_DIR
/environment-setup-i586-wrs-linux-icc
Where
WRL_SDK_DIR
is the root folder of the Wind River Linux SDK installation folder.
Check the content in the
WRL_SDK_DIR
/environment-setup-i586-wrs-icc
file and update the compiler options if necessary for your compilation.

App Development: When the Wind River SDK is Not Built with ICC Environment Scripts

Use the
--sysroot
option to specify the target root directory of headers and libraries. For example, if the headers and libraries are normally located in
/usr/include
and
/usr/lib
respectively,
--sysroot
=/mydir
causes the compiler to search in
/mydir/usr/include
and
/mydir/usr/lib
for the headers and libraries.
Use the
-gnu-prefix
option to specify a string that prepends the name of the GNU tools called from the Intel® C++ Compiler. The value depends on the GNU toolchain used for a particular operating system. For example, for the Wind River Linux platform, the prefix value, for a 64-bit target, is
x86_64-wrs-linux-
. Append a hyphen to the prefix only if the toolchain prefix ends with a hyphen.
To adapt the Intel® C++ Compiler to the Wind River build environment:
  1. Make a copy of the GCC environment setup file and rename it to
    environment-setup-i586-wrs-icc
    . For example:
    cp /opt/windriver/wrlinux-small/qemux86-64/environment-setup-core2-64-wrs-linux /opt/windriver/wrlinux-small/7.0-qemux86-64/environment-setup-core2-64-wrs-linux-icc
  2. Open the environment setup file,
    /opt/windriver/wrlinux-small/qemux86-64/environment-setup-core2-64-wrs-linux-icc
    , and locate the following build settings:
    export CC="x86_64-wrs-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=$SDKTARGETSYSROOT" export CXX="x86_64-wrs-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=$SDKTARGETSYSROOT" export LD="x86_64-wrs-linux-ld --sysroot=$SDKTARGETSYSROOT" export AR=x86_64-wrs-linux-ar
  3. Change them to:
    export CC="icc -gnu-prefix=x86_64-wrs-linux- -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=$SDKTARGETSYSROOT" export CXX="icpc -gnu-prefix=x86_64-wrs-linux- -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse --sysroot=$SDKTARGETSYSROOT" export LD="xild -qgnu-prefix=x86_64-wrs-linux- --sysroot=$SDKTARGETSYSROOT" export AR="xiar -qgnu-prefix=x86_64-wrs-linux-"
  4. Save the file.
Use
icc
from the command line with the
–gnu-prefix
and
--sysroot
compiler options, as follows:
icc my_source_file.c -gnu-prefix=$GNU_PREFIX --sysroot=$SYSROOT
Following successful compilation, an executable named
a.out
is created in the current directory. Copy
a.out
onto the target machine and verify that
a.out
runs on the target machine.
For information about the
gnu-prefix
and
sysroot
compiler options, see the Intel® C++ Compiler 19.1 Developer Guide and Reference.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804