This article is taken from Intel C++ Compiler with the Eclipse IDE on Linux
Intel C++ Compilers for Linux can be used together with the Eclipse IDE to create C/C++ applications. Via an Intel C++ Eclipse extension the compiler is integrated using the well-known Eclipse C/C++ Development Tooling (CDT) plug-in. Hence all existing features of CDT, like different views, wizards, a powerful editor, and debugging, can be easily used with the Intel compiler as well. In the following a “How-to” guide is provided which explains configuration and usage.
- Eclipse 3.7, 3.8 or 4.2 ans above
- CDT 8.0 or later
- Java Runtime Environment (JRE) version 6.0 (also called 1.6) update 11 or later
- Intel® Composer XE 2013 and above (separate or any suite that provides it, like Intel® Parallel Studio XE 2013)
In case Eclipse has to be installed first, use the package Eclipse IDE for C/C++ Developers. It already comes with everything needed for C/C++ development. We will use it as reference in the following.
Installing the Integration
The following is a brief overview about how to install the Intel C++ Eclipse extension. More information see Learn More below.
- Open the Install dialog for plug-ins via menu Help->Install New Software…:
- Click on the Add… button and the Add Repository dialog opens:
- Click on the Local… button, specify the directory containing the Intel C++ Eclipse extension and confirm. The Intel C++ Eclipse extension can be found in the installation directory of Intel Composer XE, subdirectory eclipse_support/cdt8.0/eclipse.
- Back in the Install dialog select the item Intel(R) C++ Compiler XE 13.0 for Linux* OS and continue by pressing the button Next >.
Optionally you can also install compiler documentation (recommended) and Intel® Debugger support for native & Intel® MIC architecture (provided they are already installed with Intel Composer XE).
- In case there are no items listed, ensure that Group items by category is not selected.
- The next dialog summarizes all plug-ins to install. Continue via button Next >:
- Finally, the license files are displayed. Make sure to read them. Accept and start installation by clicking on button Finish:
- Eventually you will be faced with a warning about unsigned content. Confirm by clicking on button OK:
- After installation is complete, restart Eclipse
Using Intel C++ Eclipse Extension
- Once the Intel C++ Eclipse extension is installed it can be used for all C/C++ projects – new ones as well as existing ones.
- When using the extension, make sure to source the compiler scripts before starting Eclipse:
$ source <composer_xe_path>/bin/compilervars.[sh|csh] [ia32|intel64]
- This is crucial to locate the compiler installation. See the compiler documentation for more information about the compiler scripts.
- If you experience issues with the integration try to set the locale to en_US when starting Eclipse, e.g.:
$ LANG=en_US eclipse
Create New Project
- To create a new C/C++ project, use the Eclipse/CDT wizard via File->New->C Project or C++ Project;
- By default the flag Show project types and toolchains only if they are supported on the platform is selected. Thus, all toolchains are shown for which there is an existing compiler installation. Select the toolchains for your project – multiple can be selected at once. To use the latest compiler from Intel Composer XE 2013, select version v13.0.0. It is also possible to use older versions in addition as long as there are existing compiler installations.
When unchecking the flag Show project types and toolchains only if they are supported on the platform, all toolchains are shown, even if no appropriate compiler is installed on the local system. This can be used for environments with distributed build systems where not all nodes have all compilers installed, but only subsets each. Those toolchains can’t be used unless the proper compiler is installed but they will be present and can be configured.
Once a new project is created like this building, linking, executing and debugging is no different than used from CDT with the default toolchain.
For more information, do see Intel C++ Compiler with the Eclipse IDE on Linux