Using Intel Compilers for Linux with Ubuntu

Navigation:

Linux and Mac OS X Compilers Installation Help Center: /en-us/articles/intel-compilers-linux-installation-help

First, determine your needs and get the right installation tarball.  Most linux users are on 64bit systems with x86_64 versions of linux installed.  Do you need to create older 32bit applications?  If not, download the Intel 64 ONLY tarball, the *_intel64.tgz package.  Not only does this save download time, this will eliminate your need to install 32bit libraries on the development system.


rev history:

November 2012:  Ubuntu 12.xx  and Intel 13.0.0.079 (Composer XE 2013 initial release)  URGENT, Installation will fail without a manual change

Ubu 12.0x changed the link for /bin/sh from /bin/bash to /bin/dash.  Intel installation scripts for 13.0.0.079 reference /bin/sh BUT assume/require this is bourne or bash (sh or bash) but are NOT compatible with dash.  To get around this problem, do the following before trying to install the Intel compiler:

As root user:

mv /bin/sh /bin/sh.orig
ln -s /bin/bash /bin/sh

Read the following information to continue to configure your system BEFORE you attempt an installation.
Following installation you are free to revert back to linking /bin/sh to /bin/dash if you so desire.

COMPATIBLE Linux Versions: Beta and recently released versions of Ubuntu may NOT be officially supported by Intel Compilers.  Please see your ReleaseNotes document with your compiler to find the supported Linux distributions and versions.  These instructions are merely to help install the compiler, keep in mind that versions of this linux distribution NOT in the ReleaseNotes document for your compiler version are NOT tested nor supported.

COMPATIBLE Intel Compiler Versions: In order to use Intel® Compilers (C++  or  Fortran) under the lastest release of Ubuntu, you will need newer versions of the Intel compiler(s).   Do NOT try to install older Intel Compilers such as 12.0, 11.x, 10.x, 9.x or 8.x under Ubuntu 12.xx or newer: they will not install easily and probably will not work - and they are NOT supported.  If you need an older Intel Compiler version, please read their ReleaseNotes and obtain an older, supported distribution (read this): http://software.intel.com/en-us/articles/older-version-product


Ubuntu 11.04 through Ubuntu 12.10  :
Composer XE  (aka version compiler versions 12.x and 13.x) prerequisites for Ubuntu Desktop, assuming that gcc and g++ are installed already:
apt-get install build-essential
apt-get install gcc-multilib
apt-get install rpm
apt-get install ia32-libs  (only needed if you install the 32bit compiler)
apt-get install openjdk-6-jre-headless

UMASK before you install:  If you will install as root or use sudo for the installation, check the umask setting for your root user:
#   umask
or
sudo bash ; umask

the value should be 0022.  If not, set it to 0022 so that the files you install are readable by non-root users:
umask 0022

INSTALLATION
untar the package tarball in a scratch directory such as /tmp.  tar -zxvf l_fcompxe_2013.x.yyy[_intel64 | _ia32].tgz
cd into the extracted directory
./install.sh and follow the instructions.


during the install, you can ignore any warnings about the missing Java prerequisite - it may not recognize openjdk-6-jre-headless.

And like below, IF you are installing OLDER compilers versions 11.1 or older, you will need to install libstdc++.so.5 libs (see below).


08 February 2011:  Ubuntu 10.10 and Compiler 12.x aka "Composer XE" notes:
The Intel compiler 12.0 aka Intel Fortran Composer XE 2011 no longer requires libstdc++-5.  It now uses libstdc++-6 which is present in newer Ubuntu distributions.  Please ignore the notes below for the step to install libstdc++5 UNLESS you have an earlier 11.1 or older compiler.

Read all the instructions below to install gcc, g++, build-essential, rpm etc.
IF you have to install Intel Fortran 11.1 or older, on Ubu 10.10
sudo apt-get install libstdc++5
ELSE
skip libstdc++5, your 12.x compiler uses libstdc++6
END IF


rev history:

29 April 2010:  This guide also applies to Ubuntu 10.04.

rev history: 
2009 November 3:  added notes for Ubuntu 9.10

Note: Newer versions of this linux distribution may NOT be officially supported by Intel Compiler Professional Editions 11.1.  Please see your ReleaseNotes document with your compiler to find the support Linux distributions and versions.  These instructions are merely to help install the compiler, keep in mind that versions of this distribution NOT in the ReleaseNotes document are NOT tested nor supported.  You are on your own here.

Introduction :


Using Intel® Compilers version 12.0 and 11.1 under Ubuntu (10.10, 10.04, 9.10, 9.04, 8.04 and 8.10) Desktop and Debian Desktop

For older Ubuntu and Debian versions, see THIS ARTICLE.  Make sure to use the latest Intel Compilers version.  Older compilers will not be compatible with the latest Ubuntu distributions.  For compatibility and supported versions always read the ReleaseNotes document for your compiler.

These notes apply to Ubuntu Desktop.  Ubuntu Server was not tested but should be similar.

2 November 2009:  Ubuntu 10.10, 10.04, and 9.10

For users of Ubuntu 10 and 9.10, follow the instructions here.  If you have 9.04 or older, skip ahead to the section titled "Ubuntu 9.04 and Older"

BEFORE YOU INSTALL Intel® Fortran for Linux or Intel® C++ for Linux on your fresh Ubuntu Desktop installation, you will first need to install several packages to prepare the system to serve as a development platform.  First, open a Terminal window and become root:
sudo bash
(type your user password)

At this point, you should have a root shell.  Test this with command 'whoami' which should return "root"

Check that gcc is installed. By default. Check this with:

gcc --version

It should return "gcc (Ubuntu 4.4.1-4ubuntu8) 4.4.1 (or some newer version - as long as it returns a version  you have gcc installed)

If, for some reason, you do not have gcc installed, use Synaptic Package Manager (under 'System' -> 'Administration' menus) OR use apt-get to install gcc:


apt-get install gcc


Next, install the 'build-essential' package and package g++. This is not installed by default. Again, use Synaptic Package Manager or apt-get :

apt-get install build-essential
apt-get install gcc-multilib

this should also install g++, but in test this with:
g++ --version

if g++ is not found, install it:

apt-get install g++

A few other packages are required:
apt-get install rpm
apt-get install ia32-libs    (this is only required on 64bit Ubuntu/Debian systems)

To use the Intel IDB graphical debugger, you will also need the Java JRE 5 or 6 installed.  One way to get this is through Synaptic package manager.  Open Synaptic and for sources enable Ubuntu's partner repository.  Once that is done, use Synaptic to fetch the package sun-java6-jre.

We also recommend fetching the Sun JRE directly from Sun: get the latest JRE from:

http://java.com/en/download/manual.jsp

OR you can use the OpenJDK from the distribution:

apt-get install openjdk-6-jre-headless

Next, Ubuntu 9.10 Desktop does not provide libstdc++5, which is required for the Intel Compilers.  You will have to get the package for libstdc++5 from an older Debian or Ubuntu distribution ( 9.04 for example ).  A repository is here:

http://packages.debian.org/stable/base/libstdc++5

On this page, you will see the title "The GNU Standard C++ Library V3".  Scrolling down, find the table for "Download libstdc++5".

9.10:  For 32bit Ubuntu i386 libstdc++5 Installation:
For 32bit  Ubuntu systems you will need to install the 32bit version of libstdc++5, that is, the "i386" package.
Select the download for the libstdc++5 package for "i386".  Pick a mirror site to begin the download.  If you are using Firefox, you will be prompted if you want to "Open with GDebi Package Installer" - select OK to continue.  Otherwise, save the deb package and use your favorite package manager to install.  Install the i386 libstdc++ deb package.  SKIP the Intel 64 Libstdc++5 (AMD64) directions below and find the section on installing the compiler after prerequisites are installed.


9.10: For Intel 64 / AMD64 (64bit Linux installation) Libstdc++5:
follow these instructions IF AND ONLY IF you have a 64bit Ubuntu installation. 

Intel 64 installation:  Select the download for the libstdc++5 package for "amd64".  If you are using Firefox, you will be prompted if you want to "Open with GDebi Package Installer" - select OK to continue.  Otherwise, save the deb package and use your favorite package manager to install.  Install the amd64 libstdc++ deb package.

by default, the 64bit libstdc++.so.5 library will install in /usr/lib which is linked to /usr/lib64. 

Now, you also will need the 32bit libstdc++.so.5 installed in /usr/lib32.  Unfortunately, the "i386" version of the libstdc++5 package wants to install in /usr/lib which is your 64bit library directory and where you just installed the "amd64" libraries - so you DON'T want to download and install the "i386" package into the default location. 
We'll need to download the "i386" package to a temporary directory, use dpkg to extract the contents to the temp directory, then manually copy the library to /usr/lib32 and create the symbolic link:

First, download libstc++5 package for "i386" - save to disk and do NOT launch a package manger to install it.  Save it in your 'Downloads' folder or /tmp (or any other scratch directory).
Using your root terminal window, cd to the directory where you have downloaded the .deb package, it should have a name similar to 'libstdc++5_3.3.6-18_i386.deb'.  The exact version is not important, but make sure it is a "i386" deb package.
Extract to the local directory:

dpkg --extract libstdc++5_3.3.6-18_i386.deb  ./

Notice that a 'usr/' folder was created and the package contents extracted here.  Now we'll copy the library to /usr/lib32

cd usr/lib
cp libstdc++.so.5.0.7 /usr/lib32
cd /usr/lib32
ln -s libstdc++.so.5.0.7 libstdc++.so.5


9.10: Installing the Compiler Now That Prerequisities are Installed (32 and 64bit):

Once you've completed the above, extract your compiler .tgz kit, cd to the compiler installation directory, and run ./install.sh

During the installation, you WILL get a warning message "Detected operating system Debian* (generic) is not supported", followed by
----------------------------------------------------------------- ---------------
Missing optional pre-requisite
-- operating system type is not supported.
-- system glibc or kernel version not supported or not detectable
-- binutils version not supported or not detectable
----------------------------------------------------------------- ---------------
"Would you like to perform an unsupported install of this product [yes/no] (no)?"

enter "yes"

This will complete the installation.  Keep in mind, you will get this warning from the compiler installer until such time as this particular OS and version are supported. Once installed, you can read the ReadMe notes in ...installdir.../Documentation directory which has a list of the supported Linux distributions and versions.


Debugger Notes:

Known Intel® IDB Debugger issues under Ubuntu:
1)     Ubuntu 9.x versions, IA32 and Intel64 platforms:

-         When loading an executable, a startup dialog may appear that should not. If this dialog,  "Unable to locate source file “…/start.S – Do you like to search for it manually?” appears, click ‘No’ and continue normal debugging.

-         Avoid using debug commands such as ‘next’, ‘step’ on the Console Window of the Debugger GUI since this may lead to unexpected behavior of the debugger; use the corresponding options ‘Continue’, Step Into’ etc. from the Run menu instead.

2)     Ubuntu 9.10, IA32 and Intel64 platforms:

-         You need to set the environment variable GDK_NATIVE_WINDOWS=1 to avoid a known bug in Eclipse delivered with Ubuntu 9.10. Add export GDK_NATIVE_WINDOWS=1
to your ~/.bashrc file or execute this command on command line:
export GDK_NATIVE_WINDOWS=1



Ubuntu 9.04 and Older:

In order to use Intel® Compilers ( Fortran or C++ ) under Ubuntu 9.04, 8.04 or 8.10 you will need the latest 11.0 or 10.1 version of the Intel compiler(s). Older 10.0 and 9.1 versions of the compilers may not work properly under Ubuntu 9.04, 8.04 or 8.10.  Keep in mind that new versions of Ubuntu/Debian may not be OFFICIALLY supported by the Intel Compilers.  Please see your ReleaseNotes document with your compiler version for a list of officially supported distributions and versions.

If you have active support for your compiler, you can download the latest Intel compiler version from
https://registrationcenter.intel.com

BEFORE YOU INSTALL Intel® Fortran for Linux or Intel® C++ for Linux on your fresh Ubuntu Desktop installation, you will first need to install several packages to prepare the system to serve as a development platform:

Check that gcc is installed. By default. Check this with:

gcc --version

By default, Ubuntu 8.04 Desktop installs gcc 4.2.3-2ubuntu7.  8.10 should have gcc 4.3.2, 9.04 gcc 4.3.3

If, for some reason, you do not have gcc installed, use Synaptic Package Manager (under 'System' -> 'Administration' menus) OR use apt-get to install gcc:


apt-get install gcc


Next, install g++. This is not installed by default. Again, use Synaptic Package Manager or apt-get to install package "g++"

apt-get install build-essential
apt-get install g++


Next, you need to install the 32bit compatibility library libstdc++.so.5. To do this, use apt-get or Synaptic Package Manager to retrieve and install package "libstdc++5"

apt-get install libstdc++5

This package may require installing another package as a prerequisite,
"gcc-3.3-base"

If so, go ahead and install this older gcc package.

For x86-64 architecture, you will also need a number of other packages, including package 'ia32-libs' to install the 32bit versions of libstdc++.so.5 in /usr/lib32 as well as 32bit header files in libc6-dev-i386.   These notes apply to Ubuntu 9.04 but should also apply to 8.10 and 8.04

apt-get install ia32-libs
apt-get install lib32stdc++6
apt-get install libc6-dev-i386
apt-get install gcc-multilib
apt-get install g++-multilib


Finally, there is an optional package to consider: The 11.0 version of the Intel Compiler for Linux has a graphical
debugger, a new graphical interface for the IDB debugger. If you want to use this debugger, please make sure to install the Java JRE version 1.5 or greater. This can be done at anytime after the installation of the compiler. However, you will get a warning message about 'missing prerequisite' for the JRE - simply ignore that message and proceed with the installation.  OR to avoid that message and enable the graphical IDE, get the latest JRE from:

http://java.com/en/download/manual.jsp

Once installation of prerequisites is complete, you are ready to start the Intel compiler(s) installation. During the installation, you may get a message "Detected operating system Debian* (generic) is not supported", followed by
----------------------------------------------------------------- ---------------
Missing optional pre-requisite
-- operating system type is not supported.
-- system glibc or kernel version not supported or not detectable
-- binutils version not supported or not detectable
----------------------------------------------------------------- ---------------
"Would you like to perform an unsupported install of this product [yes/no] (no)?"

enter "yes"

This will complete the installation.  Keep in mind, you will get this warning from the compiler installer until such time as this particular OS and version are supported. Once installed, you can read the ReadMe notes in ...installdir.../Documentation directory which has a list of the supported Linux distributions and versions.


Using the Compiler:

The next step after installing the compiler is to set up the user environment to use the compiler and libraries.  First, locate your documentation:  it is installed in <installdir>/Documentation/en_US   (currently, US English is the language supported in the documentation).   Under this directory, read the <installdir>/Documentation/en_US/getting_started_f.pdf or getting_started_c.pdf document.  Read how to use iccvars.sh or ifortvars.sh (or the .csh equivalents) to set your environment to use the compiler(s).  You may wish to put the 'source ifortvars.....' command into your home startup scripts.

Next, use a browser to open <installdir>/Documentation/en_US/documentation_f.htm or documentation_c.htm which is an index to the rest of the online documents.  Browse the documents to familiarize yourself with their locations and contents.

Finishing up:  Usage

Once the compilers are installed, it is necessary to source the ifortvars.sh or ifortvars.csh file to properly set the user environment to use the Intel compilers.  This (these) commands can be placed in a user's ~/.bashrc or other system login file (fortran 11.1.046 example shown below, bash user):

64bit compiler selection:
source /opt/intel/Compiler/11.1/046/bin/ifortvars.sh intel64

32bit compiler selection:
source /opt/intel/Compiler/11.1/046/bin/ifortvars.sh  ia32

C/C++ users: substitute "iccvars" for "ifortvars" above.

Other versions: substitute your actual minor version for "046" above. 
Also, if you are a CSH or TCSH user, use ifortvars.csh or iccvars.csh as appropriate.

Need more help?  Join our User Forums:
Fortran: /en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/
C/C++: /en-us/forums/intel-c-compiler/
For more complete information about compiler optimizations, see our Optimization Notice.

Comments

's picture

For Ubuntu 10.10 and beyond, there is a security feature (ptrace) that blocks vtune and inspector from working properly (see https://wiki.ubuntu.com/Security/Features). vtune does report the problem but sends you to the release notes for a permanent solution that I never found. To fix this issue, do what is said here http://www.bay12forums.com/smf/index.php?topic=65326.0. It then should work.

's picture

Lifesaver

's picture

I installed intel fortran compiler and also i added the line in ~/.bashrc 'source /opt/intel/composer_xe_2011_sp1.6.233/bin/ifortvars.sh ia32'
but till now i do not get ifort command in terminal. ifort:command not found....
can any one help me....

's picture

My Dear:
I installed Intel FORTRAN compiler 12.1 on Ubuntu 11.04 ,after installation i want to compile (run )for example: helloworld.f90 ,but idont have result where i get error message say : can not pars the command or c expression , and cannot load image . please where is the problem .

's picture

Tried all of the above and icc won't install. No error messages. Giving up on Intel and sticking with gcc, which works.

Marcio Pmz's picture

Hello, I have problems instaling Parallel Studio on Linux. There are some libraries missing, but I can't instal them, because there's always some matte: Libraries:
apt-get install ia32-libs
apt-get install lib32stdc++6
apt-get install libc6-dev-i386
apt-get install gcc-multilib
apt-get install g++-multilib

Could somebody help me, please?

Dalton Harvie's picture

I have three problems installing the latest (2013.0.079) ifort on a fresh install of ubuntu 12.04, 64bit.

1) Minor - but maybe something: install script starts with error message repeated
--------------------------------------------------------------------------------
Initializing, please wait...
--------------------------------------------------------------------------------
sh: 1: Syntax error: Bad fd number
sh: 1: Syntax error: Bad fd number
sh: 1: Syntax error: Bad fd number
sh: 1: Syntax error: Bad fd number
sh: 1: Syntax error: Bad fd number
sh: 1: Syntax error: Bad fd number
sh: 1: Syntax error: Bad fd number

2) Minor - even with ia32-libs package installed, using the l_fcompxe_2013.0.079 package I still get complaints about missing 32bit libraries. (It would be good to have an option within the script to choose either the 32 or 64 bit versions at install time, from the one package)

3) Major - using either the l_fcompxe_2013.0.079 or l_fcompxe_intel64_2013.0.079 versions the compilervars.sh and compilervars.csh scripts are empty (not links, but rather empty files). This explains some of the problems in messages that I see previously on this list and renders the current version practically unusable.

The previous version (l_fcompxe_intel64_2011.11.339) does not have problems 1 and 3. Haven't tested the ia32 issue (problem 2) with this previous.

p3tris's picture

I'm really sorry you guys rolled out this version. One of the best things about Intel Parallel Studio was that it simply worked... Installation, upgrading, backwards compatibility, everything simply worked. With this version (2013) I can't get anything to work.

-First I receive a call for the beta version. It installed ok but I couldn't compile any of my old projects! I solved the several issues and then things were crashing here and there. I tried to report some stuff to the premium support using the username/password provided as beta tester and it wouldn't allow me. I gave up and went back to 2011 update2.

-Now you roll out 2013 version (non beta). I try to install it on the same computer and I can't. Some of the errors I get is:
1) "sh: 1: Syntax error: Bad fd number"

2) Missing optional pre-requisites
-- Intel(R) VTune(TM) Amplifier XE 2013: unsupported OS
-- Intel(R) Inspector XE 2013: unsupported OS
-- Intel(R) Advisor XE 2013: unsupported OS
-- Intel(R) Composer XE 2013 for Linux*: unsupported OS

Even though I use Debian 6 stable (which is supposed to be supported)

3) "error: db5 error(-30969) from dbenv->open: DB_VERSION_MISMATCH: Database environment version mismatch
error: cannot open Packages index using db5 - (-30969)"

4) and finally all parts fail to install, except the new update manager :p

So, going back to 2011 again...

Ronald W Green (Intel)'s picture

Having problems that this article doesn't cover?

Don't post a comment here with your problem, it might not get read in a timely manner.

Issues should be discussed in our User Forum: http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x

Ron

Marshall M.'s picture

Hi All,

I have tried to install and have followed all the instructions. Upon opening terminal after source line to bash this is what comes out:
bash: /home/mmdoka/intel/composer_xe_2013.2.146/bin/intel64/idbvars.sh: No such file or directory

One of the things after installation I noticed is that it created intel under /home/mmdoka/ and in /opt/intel/ it was empty except for the licenses.

Please advise.

Marshall

Pages