Compiler Integration with Yocto Project* 1.1 Application Development Toolkit
This article describes how to use the Intel® C++ Compiler 12.1 from the Intel® Embedded Software Development Tool Suite for Intel® Atom™ Processor
Yocto Project* Application Development Toolkit (ADT) Installer
Please refer to the Yocto Project* Application Development Toolkit User’s Guide at http://www.yoctoproject.org/docs/current/adt-manual/adt-manual.html for details on the Application Development Toolkit Usage.
To be able to use the Application Development Toolkit with the Intel® C++ Compiler it has to be installed using the Application Development Toolkit tarball and installer script available at http://downloads.yoctoproject.org/releases/yocto/yocto-1.1/adt_installer/. More detailed information on this can be found at http://www.yoctoproject.org/docs/current/adt-manual/adt-manual.html#using-the-adt-installer. Other installation methods are not supported.
After unpacking the installer tarball you will find a file adt_installer.conf. This file needs to be modified to support Intel® architecture before the Application Development Toolkit can be used with the Intel® C++ Compiler.
Modifying the Application Development Toolkit Installer Configuration
In the file adt_installer.conf the following modifications are necessary:
1. Comment out lines 44, 46, and 48
#YOCTOADT_ROOTFS_arm="minimal sato-sdk"
#Specify which root filesystem file to use to extract as target sysroot. Please ensure the #entry is in the list of downloaded root filesystem files that specified above in #YOCTOADT_ROOTFS_$arch
#YOCTOADT_TARGET_SYSROOT_IMAGE_arm="minimal"
#The location where the target sysroot will be setup
#YOCTOADT_TARGET_SYSROOT_LOC_arm="$HOME/test-yocto/arm"
2. Uncomment lines 51, 52, and 53
YOCTOADT_ROOTFS_x86="minimal-dev"
YOCTOADT_TARGET_SYSROOT_IMAGE_x86="minimal-dev"
YOCTOADT_TARGET_SYSROOT_LOC_x86="$HOME/test-yocto/x86"
The important changes are that the three entries
YOCTOADT_ROOTFS_x86
YOCTOADT_TARGET_SYSROOT_IMAGE_x86
YOCTOADT_TARGET_SYSROOT_LOC_x86
need to be defined.
These entries are used to configure the Application Development Toolkit environment and need to be present for the Intel® Embedded Software Development Tool Suite for Intel® Atom™ processor to integrate into this environment.
Run the Application Development Toolkit Installer
Now the Application Development Toolkit can be installed. Simply execute
$ adt_installer &
from the unpacked installer tarfile and follow the instructions.
Sudo or Root Access Right Requirement
Integration of the Intel® C++ Compiler into the Yocto Project* Application Development Toolkit requires the launch of the tool suite installation script install.sh as root or sudo user.
Automatic Integration during Tool Suite Installation
The tool suite installation script install.sh will automatically check against the presence of the Yocto Project* 1.1 Application Development Toolkit framework. It will look for the Poky Linux* install in /opt/poky/1.1/ and in addition it will look for a build target configuration at a directory specified by the environment-setup-i586-poky-linux file in/opt/poky/1.1/.
The installation then creates a backup copy of the existing environment-setup-i586-poky-linux file and replaces it with a file customized for the use of the Intel® C++ Compiler. Thus the integration can be reversed simply by copying the original environment-setup-i586-poky-linux back into its place.
Additionally the installation script copies a file yocto.env that defines the target platform settings for the Intel® C++ Compiler into the /opt/intel/composer_xe_2011_sp1.6.233/bin/ia32/ directory.
If no Yocto Project* 1.1 Application Development Toolkit is found the following warning will be issued during installation:
The Yocto Project* Application Development Toolkit has not been detected on your system. This toolkit is required if you want to use the Intel® Composer XE for building Yocto Project* targeted applications. For automatic Intel® Composer XE integration with the Application Development Toolkit during installation, please install Toolkit first and re-check the prerequisites. For manual integration after installation, please consult the product Release Notes.
To use the Intel® C++ Compiler for a Yocto Project* target simply call the icc or icpc Intel® C++ Compiler drivers with the option –platform=yocto from your application build environment that you already set up for usage with the Yocto Project* 1.1 Application Development Toolkit.
Setup of Compiler Build Environment
To setup the environment for the Intel® C++ Compiler and integrate it correctly with the build environment on your Linux host, execute the following command:
> source <install-dir>/composerxe/bin/compilervars.sh ia32
To setup the environment for the Yocto Project* Application Development Toolkit execute the following command:
> source /opt/poky/1.1/environment-setup-i586-poky-linux
Manual Compiler Integration with the Application Development Toolkit
1. Replace the existing file /opt/poky/1.1/environment-setup-i586-poky-linux with one the resembles the following entries:
export PATH=/opt/poky/1.1/sysroots/i686-pokysdk-linux/usr/bin:/opt/poky/1.1/sysroots/i686-pokysdk-linux/usr/bin/i586-poky-linux:$PATH
export PKG_CONFIG_SYSROOT_DIR=<CURRENT_USER>/test-yocto/x86
export PKG_CONFIG_PATH=<CURRENT_USER>/test-yocto/x86/usr/lib/pkgconfig
export CONFIG_SITE=/opt/poky/1.1/site-config-i586-poky-linux
export CC=icc
export CXX=icpc
export GDB=i586-poky-linux-gdb
export TARGET_PREFIX=i586-poky-linux-
export CONFIGURE_FLAGS="--target=i586-poky-linux --host=i586-poky-linux --build=i686-linux --with-libtool-sysroot=<CURRENT_USER>/test-yocto/x86"
export CFLAGS=" -march=i586 -platform=yocto"
export CXXFLAGS=" -march=i586 -platform=yocto"
export LDFLAGS=" --sysroot=<CURRENT_USER>/test-yocto/x86"
export CPPFLAGS=" -platform=yocto"
export OECORE_NATIVE_SYSROOT="/opt/poky/1.1/sysroots/i686-pokysdk-linux"
export OECORE_TARGET_SYSROOT="<CURRENT_USER>/test-yocto/x86"
export OECORE_ACLOCAL_OPTS="-I /opt/poky/1.1/sysroots/i686-pokysdk-linux/usr/share/aclocal"
export OECORE_DISTRO_VERSION="1.1"
export OECORE_SDK_VERSION="1.1"
export YOCTO_TOOLCHAIN=/opt/poky/1.1/sysroots/i686-pokysdk-linux/usr/bin
export YOCTO_SYSROOT=<CURRENT_USER>/test-yocto/x86
The –sysroot compile flags from the original environment-setup-i586-poky-linux can be removed because their function is covered by the yocto.env file.
2. Create a yocto.env file in /opt/intel.composerxe/bin/ with the following contents:
*platform:
yocto
*yocto_sdk_toolchain:
%$(YOCTO_TOOLCHAIN)
*sysroot:
%$(YOCTO_SYSROOT)
*target_root:
%(sysroot)
*gcc_install:
%(sysroot)/usr/lib/gcc/i586-poky-linux/4.6.1
*intel_include:
%(intel_root)/../compiler/include
*intel_lib:
%(intel_root)/../compiler/lib/ia32
*exec_path:
%(yocto_sdk_toolchain)/i586-poky-linux
*exec_prefix:
i586-poky-linux-
*gxx_include:
%(sysroot)/usr/include/c++
*link_lib_path:
%(intel_lib)%(path_separator)%(gcc_install)%(path_separator)%(sysroot)/lib%(path_separator)%(sysroot)/usr/lib%(path_separator)%(sysroot)/usr/lib/i586-poky-linux/4.6.1
*link_start_files:
%{static?%{p?%(sysroot)/usr/lib/gcrt1.o;%(sysroot)/usr/lib/crt1.o};%{!shared?%(sysroot)/usr/lib/crt1.o}} %(sysroot)/usr/lib/crti.o %{static?%(sysroot)/usr/lib/i586-poky-linux/4.6.1/crtbeginT.o;%{shared?%(sysroot)/usr/lib/i586-poky-linux/4.6.1/crtbeginS.o;%(sysroot)/usr/lib/i586-poky-linux/4.6.1/crtbegin.o}}
*link_end_files:
%{!static?%{shared?%(sysroot)/usr/lib/i586-poky-linux/4.6.1/crtendS.o;%(sysroot)/usr/lib/i586-poky-linux/4.6.1/crtend.o};%(sysroot)/usr/lib/i586-poky-linux/4.6.1/crtend.o} %(sysroot)/usr/lib/crtn.o
*link_default_libs:
%{!static?%{i-dynamic|shared?-Bdynamic;-Bstatic}} -lsvml -limf \
%{!static?-Bdynamic} -lm \
%{!static?%{i-dynamic|shared?-Bdynamic;-Bstatic}} -lipgo -ldecimal \
%{i_cxxlink? \
%{cxxlib-gcc? \
%{!static?%{i-static|static-libcxa?-Bstatic;-Bdynamic}} -lcxaguard}} \
%{openmp-stubs?%{!static?%{i-static?-Bstatic;-Bdynamic}} -lompstub} \
%{!static?%{i-dynamic|shared?-Bdynamic;-Bstatic}} %{pic-libirc?-lirc_pic;-lirc} \
%{!static?-Bdynamic} -lc \
%{cxxlib-gcc? \
%{!cxxlib-nostd?%{!static?-Bdynamic} -lstdc++;%{!static?-Bdynamic} -lsupc++} \
%{static|static-libgcc? \
%{!static?-Bstatic} -lgcc -lgcc_eh; \
%{!shared?%{!static?%{static-libgcc?-Bstatic;-Bdynamic}} -lgcc -lgcc_s}} \
%{!static?-Bdynamic} -ldl -lc}
Setup of Compiler Build Environment:
To setup the environment for the Intel® C++ Compiler and integrate it correctly with the build environment on your Linux host, execute the following command:
> source <install-dir>/composerxe/bin/compilervars.sh ia32
To setup the environment for the Yocto Project* Application Development Toolkit execute the following command:
> source /opt/poky/1.1/environment-setup-i586-poky-linux
Now you are ready to use the Intel® C++ Compiler for any Yocto Project* targeted application that uses the Poky* Linux* based Application Development Toolkit* (ADT) framework.
