1 Introduction
The Yocto* Project is an open source collaboration project that provides templates, tools, and methods to help you create custom Linux-based systems for embedded products. The Yocto* Project uses a build system based on the Poky project to construct complete Linux images. Intel® System Studio 2015 provides the integration layer support for the Yocto* Project Build system. Using the integration layer support, you can use the Intel® C++ compiler as a secondary tool chain for your project and application build. You can select and build the components for the target system which include the Intel C++ Compiler runtime libraries, the Intel VTune™ Amplifier for System target package, the Intel® Integrated Performance Primitives and Intel® Math Kernel Libraries.
This document describes how to install and use the Intel System Studio 2015 integration layer with Yocto* Project. For the version prior to the Intel System Studio 2015, please refer to the "Reference" session of this document. Before you start using Intel System Studio with Yocto* Project build, please follow the instructions in "Yocto Project Quick Start" to setup the Yocto Project build environment. The above document will guide you to build an image and run it in the QEMU emulator. For example, to build a Yocto Project version 1.5 QEMU image with poky-dora-10.0.0,
$ wget
http://downloads.yoctoproject.org/releases/yocto/yocto-1.5/poky-dora-10.0.0.tar.bz2
$ tar xjf poky-dora-10.0.0.tar.bz2
$ cd poky-dora-10.0.0
$ source oe-init-build-env
$ bitbake -k core-image-sato
$ runqemu qemux86
Please follow the "Yocto Project Quick Start" manual and the "Document for Yocto* Project" to get start with Yocto* Project build.
In the following session, we will use <YOCTO_HOME> as the root location of your Yocto* Project build system. For example, if you are using poky-dora-10.0.0, the <YOCTO_HOME> will be /path/to/poky-dora-10.0.0/.
2 Installation of the Intel® System Studio Integration Layer
Once you installed the Intel System Studio, you will find the integration layer in the folder of Intel System Studio installation. Please, follow below steps to integrate the Intel System Studio with Yocto* Project development environment.
- Copy the integration layer from the Intel System Studio installation folder to the Yocto* Project development folder as shown below:
Run the following command:
$cp -r <ISS_BASE_DIR>/wr-iss-2015 <YOCTO_HOME>/
Where <ISS_BASE_DIR> is the root folder of the Intel System Studio installation. By default, it is /opt/intel/system_studio_2015.x.y/. <YOCTO_HOME> is the root folder of the Yocto* Project build system, e.g. /path/to/poky-dora-10.0.0/.
- Register the lay by running the post installation script.
In the shell console, go to the <YOCTO_HOME> folder:
$wr-iss-2015/yp-setup/postinst_yp_iss.sh <ISS_BASE_DIR>
If you want to uninstall the integration of Intel System Studio, take the following steps.
- In the shell console, go to <YOCTO_HOME> folder and run the uninst_yp_iss.sh script: $wr-iss-2015/yp-setup/uninst_yp_iss.sh
- Remove the wr-iss-2015 layer.
3 Intel System Studio Recipes
In the Intel System Studio integration layer, the following recipes are provided: recipe-icc
You can use this recipe to add the Intel C++ Compiler runtime libraries into the target system. The package name is "intel-iss-icc-target". The libraries will be installed in the target system library folder. recipe-vtune
This recipe contains the VTune™ Amplifier target package and Sampling Enabling Product (SEP) target package. Use package name "intel-iss-vtune-target’ or "intel-iss-vtune-sep-target" to build the packages for the target system. recipe-ipp
IPP libraries are divided into small pieces based on different domain. Each recipe can be added into target image separately. recipe-mkl You can use this recipe to add the MKL libraries to the target image. Please follow below steps to build the Intel System Studio recipe for your project.
- Add the path to the wr-iss-2015 to the layer conf file.
$ vi <YOCTO_HOME>/build/conf/bblayers.conf
BBLAYERS = " \
...
<YOCTO_HOME>/wr-iss-2015 \
...
"
Please replace <YOCTO_HOME>
with the full path of your Yocto* project installation folder.
- Add the desired System Studio recipes to "conf/local.conf". For example,
$ vi "conf/local.conf"
IMAGE_INSTALL_append = " intel-iss-icc-target"
IMAGE_INSTALL_append = " intel-iss-vtune-target"
IMAGE_INSTALL_append = " ippCORE"
Please note that you cannot add both "intel-iss-vtune-target" and "intel-iss-vtune-sep-target" at the same time.
- Build the target system. For example,
$ bitbake core-image-sato
4 Using the Intel® C++ Compiler as a Secondary Tool Chain for Yocto* Project Build
With the integration layer support, Intel® C++ Compiler can be used as a secondary tool chain to build the packages. To enable the ICC build for a specific package, add the following line in the package recipe .bb file.
TOOLCHAIN_pn-${PN} = "icc"
Intel C++ Compiler will be invoked automatically to build this package.
5 Using the Intel® C++ Compiler from the Yocto* Project SDK
An application developer may develop applications using the Yocto* Project SDK. With the Intel® System Studio integration layer installed, when you export the SDK from a project build, the Intel® C++ Compiler working environment scripts will be generated automatically in the same folder where the default gcc compiler environment scripts are located. The ICC environment setting file has the same name as the file for gcc compiler but with a "-icc" extension. For example, when you using the following command to export a SDK package, $ bitbake meta-toolchain
Or $bitbake core-image-sato -c populate_sdk the Intel® C++ Compiler environment file will be generated automatically and will be part of the SDK package. For example, after the build, you will find the icc environment file /path/to/poky-dora-10.0.0/build/tmp/work/i586-poky-linux/meta-toolchain-gmae/ 1.0-r7/sdk/image/opt/poky/1.5/environment-setup-i586-poky-linux-icc
The SDK package is located in the folder of the bitbake build, e.g. /path/to/poky-dora-10.0.0/build/tmp/deploy/sdk.
After you installed SDK, you can source the ICC environment scripts file to setup the compilation environment variables such as CC, CXX, AR, LD, etc. Please note that the path in the ICC environment setup file is configured as the Intel System Studio installation path on the machine when you export the SDK package. If you changed the Intel System Studio installation path, you need to update the ICC environment setup file with the right ICC path.
- Setup the GCC development environment and build a ‘hello world’ application.
$ source /opt/poky/1.5.1/environment-setup-i586-wrs-linux
$ $CC helloworld.c
- Setup the ICC development environment and build a ‘hello world’ application.
$ source /opt/poky/1.5.1/environment-setup-i586-wrs-linux-icc
$ $CC helloworld.c
You can check the content in the environment-setup-<xxx>-icc file, update the flags if necessary for your compilation. Please, note that you need the Intel System Studio product installed on your Linux host before you can use ICC compiler from the Yocto* Project SDK. You can also refer to the following article to manually add an Intel C++ compiler working environment script file if you already have a Yocto* project SDK installed.
http://software.intel.com/en-us/articles/building-yocto-applications-using-intel-c-compiler
6 Using SEP for Performance Analysis
Sampling Collector (SEP) is a command-line tool for doing hardware-based sampling using event-based sampling (EBS). Usingthe integration layer, the SEP drivers can be built and integrated into target system automatically.
- Add the SEP target package in the target system. As mentioned in the previous session, edit your Yocto* Project conf/local.conf file, add:
IMAGE_INSTALL_append = " intel-iss-vtune-sep-target"
- Build the target system. For example,
- $bitbake core-image-sato
- You will find the SEP drivers and SEP binary installed in target system folder "/opt/intel/"
- Boot the target system on real hardware and use SEP to collect the performance data.
- Insert the SEP driver if the driver is not loaded in target system.
$ cd <VTUNE_TARGET_DIR>/sepdk/src
$ ./insmod-sep3
Here <VTUNE_TARGET_DIR>
is the folder where VTune Amplifier for Systems target files are located. By default, it is in "/opt/intel/vtune_amplifier_2015_for_systems.0.0.xyz". You can add the option "-re" in a restricted environment. Please use command "./insmod-sep3 -h" to get more details.
You will need the root access on the target system to load the VTune Amplifier drivers.
- Add the SEP directory into PATH, for example:
$ export PATH=$PATH:<VTUNE_TARGET_DIR>/bin32[64]
- Run SEP to collect the performance data on the target system. For example:
$sep -start -app a.out
The performance data will be collected in the .tb6 file. Please refer to the SEP User’s Guide for detailed instructions on how to use SEP for performance analysis.
- Copy the performance data file (.tb6) to host system, import the file into VTune™ Amplifier GUI and investigate the performance issue. Please refer to Intel VTune Amplifier Help Document > User’s Guide >Managing Result Files for details on importing the performance data file.
7 Using VTune™ Amplifier Remote Performance Analysis
You can follow below steps to use VTune Amplifier for performance remote analysis with remote data collection.
- Add VTune Amplifier target package in the target system.
As mentioned in previous session, edit your Yocto* Project conf/local.conf file, add:
IMAGE_INSTALL_append = " intel-iss-vtune-target"
8 Reference
Disclaimer and Legal Information
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS.
Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information. The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request.
Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order.
Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or by visiting Intel's Web Site.
This document contains information on products in the design phase of development. Intel processor numbers are not a measure of performance. Processor numbers differentiate features within each processor family, not across different processor families. See http://www.intel.com/products/processor_number/ for details.
Centrino, Cilk, Intel, Intel Atom, Intel Core, Intel NetBurst, Itanium, MMX, Pentium, Xeon, Intel Xeon Phi are trademarks of Intel Corporation in the U.S. and/or other countries.
* Other names and brands may be claimed as the property of others. Copyright © 2014, Intel Corporation. All rights reserved. 12
Optimization Notice
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