Installing Intel FORTRAN in Ubuntu Karmic 64 bit
Ever wondered how to compile programs such as Athena Lattice Vortex or DigitalDatcom under Ubuntu? Well, to do so some sort of compiler is needed. There are a variety of compilers available free of charge for Ubuntu and Debian operating systems. Some of the more popular compilers include gfortran, gcc, and Intel Fortran.
Installing gfortran and gcc compilers is definitely a lot easier then the Intel Fortran compiler, however the actual compilation process of FORTRAN programs hence forth is a lot easier. Intel FORTRAN for Linux is actually completely free of charge as long as the compiler is used for personal instead of commercial use. Compared to the other compilers Intel FORTRAN is also commercial grade.
After installing the compiler, you should be able to run the "ifort" command from the terminal allowing you to compile FORTRAN source code.
It should be noted that this tutorial could not have been possible without an article written by Ronald W. Green of Intel Corporation. Ronald's article goes even deeper into the procedures needed to get the Intel compiler working on a 64 bit system. Many of the commands have listed in his article have just been adapted and outlined for easier use in this article.
Preparing for the Installation
Before continuing on with the actual compiler installation, make sure that the build essential libraries are installed on your computer. The build essential libraries can be obtained simply by entering the following command in the terminal:
$ sudo apt-get install build-essential
Also make sure that the following packages are installed on your computer using this command through the terminal:
$ sudo apt-get install rpm gcc g++ ia-32libs
Having installed all the proper libraries which can be grabbed through the repositories, it's time to do some manual labor to install the rest of the required libraries.
First of on the list is the libsdc++5 library (64 bit) which has been removed from karmic repositories for the new version 6. The library can be downloaded from openAE or the official Jaunty repositories. After downloading the package, simply double click on it or run $ sudo dpkg -i package-name from the terminal to install it.
Second, you need to grab the 32 bit version of the same package. This time DO NOT run dpkg or install it through the package manager. This library needs to be manually extracted and copied into the proper location. You can download it from openAE or the official Jaunty repositories as well.
Because the i386 libraries will want to install in the same folder as the 64 bit package we have just installed, the following commands need to be issued to safely move it into the proper 32 libs location and create a symbolic link to the 64 bit libraries.
$ dpkg --extract libstdc++5_3.3.6-17ubuntu1_i386.deb ./
Obtaining Intel FORTRAN
Intel FORTRAN can be downloaded from the Intel software website.
After clicking on "Intel FORTRAN Compiler Professional for Linux" you will be prompted with a simple screen asking for your email. The reason for this is that the Linux Professional edition requires a serial key number during installation. After entering your email you will be emailed your personal serial key which you will use during installation.
Upon registration, a screen showing the available distributions of the compiler will be displayed. Select the appropriate binary based on the computer the compiler will be installed.
Installing the Intel FORTRAN Compiler
Having downloaded the compiler package, you need to enter the following commands to unzip the archive and start the installation.
$ tar -xzvf name-of-file
$ cd name-of-unarchived-folder
$ sudo ./install.sh
After issuing the last command, the installation shall be initialized. First the installation shall prompt your agreement to Intel's license. Having agreed to the license, the next step will be to enter the activation code which was automatically generated in an email for you.
Once the activation has been completed you will be asked what kind of installation (Typical, or Advanced) you desire. I STRONGLY recommend that the Typical installation is chosen by anyone but the expert users.
After all the pre-requisites had been checked, the you will be presented with a list of "Missing optional pre-requisites". You can just simply ignore the warning and continue with the installation.
Thats it! You just successfully installed the Professional Intel FORTRAN library for Linux 64 bit. You can compile FORTRAN code such as DATCOM and AVL without much problem, however, I strongly recommend you follow the next section to configure your bash allowing you to simply run the ifort command from the terminal without any path dependency.
Configuring the Bash
In it's present configuration, the ifort command requires a bath dependency to operate. To get rid of it, you simply have to edit the hidden bashrc file located in your home directory. An easy way to do this is to simply open up Nautilus (file manager), navigate to your home directory and press Ctr+h, and all the hidden files will now become visible. Find the .bashrc file, double click to open it, and insert the following lines to the very bottom of the file. Save, and restart your computer.
# Intel Fortran configuration
PATH="/opt/intel/Compiler/11.1/064/bin/intel64:$PATH"
export PATH
LD_LIBRARY_PATH="/opt/intel/Compiler/11.1/064/lib/intel64:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
Or you can do it through the terminal with the following commands:
$ gedit /home/usr-name/.bashrc
Insert the five lines listed above, save and restart the computer.
You should now be able to give the ifort command from the terminal at any relative path.
Last Updated (Monday, 15 February 2010 18:33)



