http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-ubuntu/
For users of Ubuntu 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(R) Fortran for Linux or Intel(R) 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
At this point, you should have a root shell. Test this with command
- 'whoami' which should return "root"
- gcc --version
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
- apt-get install build-essential
- g++ --version
- apt-get install g++
- 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. We recommend the Sun JRE:
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 ./
- 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
- Download free/uncommencial Intel Fortran softerware from intel website: http://www.intel.com/software/products/global/eval.htm. Also, you should register with e-mail address, then you can get a license file, which intel send to your email.
- Some steps before install Intel Fortran Complier
Download libstdc++5 for AMD 64 Architechure (libstdc++5_3.3.6-17ubuntu1_amd64.deb)
- Save this file to the filesystem fold, such as (/tmp)
- Double click the file (libstdc++5_3.3.6-17ubuntu1_amd64.deb), the library will be installed automatically into the fold (/usr/lib) ;
- or you can install it yourself usingt command: ar p libstdc++5_3.3.6-17ubuntu1_amd64.deb data.tar.gz | tar xvzf -
3. Install Intel Fortran Complier
- tar -xzf l_cprof_p_11.1.069.tgz
- cd l_cprof_p_11.1.069
- ./install.sh
4. After install, set Environment Parameters in file (./bashrc)
- Add to it the end of the file (./bashrc):
source /opt/intel/Compiler/11.1/069/bin/intel64/ifortvars_ia32.sh
source /opt/intel/Compiler/11.1/069/bin/ia32/ifortvars_ia32.sh
5. Check if installed correctly
Create a file with name of first.f90,input the following code in the file:
program first
print *, "Hello World!"
print *, sin(123.4)
end program first
Then compile the file:
- #ifort first.f90 -o first
or
- #./first
Displaying the results:
Hello World!
-0.7693915
For more information about “ifort”, you can use “ifort -help”。Or read the file in: /opt/intel/doc。
No comments:
Post a Comment