In embedded area, the most famous IDE should be Eclipse*. GCC* is well supported in Eclipse* now, while using Intel® C/C++ compiler (ICC), you can also easily use it in Eclipse*. This article will introduce Intel® C/C++ compiler (component of Intel® System Studio for Linux* OS) integration in Eclipse*.How to integrate Intel® compiler into Eclipse*
The integration is based on CDT (Eclipse* C/C++ Development Tools) plugins, and CDT is needed before installing the ICC integration plugins. The prerequisites for successful Eclipse* integration are:
(1) Eclipse* 3.7 (Indigo)
(2) Eclipse* CDT 8.0
(3) Java Runtime Environment (JRE) version 6.0 (also called 1.6) update 11 or later.
To do the integration, you have two options: first is to install from the menu item "Help->Install New Software" and install from local directory which contains the plugins (/opt/intel/system_studio_<version>/eclipse_support/cdt8.0/eclipse), just like installing any other Eclipse* plugins, second option is to use the automated Eclipse* integration script, which is much more easier, especially for those who are not familiar with Eclipse* plugin installation. To have the Eclipse* Integration done as part of the Intel® System Studio installation:
(1) Navigate to: /opt/intel/system_studio_<version>/eclipse_support/
(2) Execute the automated Eclipse* integration script.
It will ask to point out the installation directory of your Eclipse* installation during the script execution.
The suggested way is to use the automatic script to integrate Intel® Compiler into Eclipse*.Create a project with Intel® compiler in Eclipse*
You can easily create a project and use Intel® tool chain to build. You only need to select corresponding Intel® Toolchain while creating the project (File->New->Project), see below for example:
Using Intel® compile options in Eclipse*
ICC is a compiler help to improve performance and it provides lots of optimization options. You may need to set the compilation options in Eclipse. You can do this from "Project->Properties" menu items. See below example about setting the optimization level (O1/2/3):
All these settings of ICC options are grouped. You can easily find the options you want. If you cannot find specific option from these groups, you can also add it using the "Command Line" group, which contains an edit box to enter the additional options you need, see below:
Using Intel® compiler in Eclipse* for cross compilation and environment file editing
By default, the ICC integrated in Eclipse* will build binaries for the host. For embedded users, you may need to do cross compilation for your target platform.
(1) Set the environment variables
To build for specific platform, you may need to set some environment variables to work. You may refer to the article "Using Intel® C++ Compiler for Embedded System" to understand how to use Intel® Compiler to build for specific target first, and you will know what environment varialbes are needed for each target.
Take Yocto Project* as an example, you need to set below environment variables:
You can set them in your system configuration (such as in "/etc/profile" or use "export" command in the terminal if you start Eclipse* from terminal. You can also set them in Eclipse* directly:
(2) Select the platform (set -platform option)
The option of ICC command line to build for a target platform is to use the option “-platform” to specific an environment file. You can easily select or create and edit an environment file in Eclipse* for a project, all the functionalities comes from the menu item "Intel Tools-> Intel(R) System Studio Tools Environment File":
Take Yocto Project* as an example, if you want to build your project for Yocto Project*, you may select a File for your project with “/opt/intel/system_studio_2013.0.013/bin/ia32/yl12.env”. Usually, you do not need to edit the environment file if you are working on the supported target platforms of Intel® System Studio, such as Yocto Project* (32bit), WindRiver* Linux* OS, CE Linux*. But if you are working on a customer Linux* OS, you may need to edit the variables in the environment file accordingly.
You can also select an environment file from the Properties menu item:
(3) Clean your project if needed
If you have been trying to build without -platform settings, you may need a "clean" of your projects to make it work with -platform option, to avoid possible link errors.
Using GAP in Eclipse*
Another important feature integrated into Eclipse* is GAP (Guided Auto Parallelism). Please refer to the article "Using guided auto parallelization for embedded development" for more details.