How to install ifort compiler in you personal directory on University cluster/workstation


In the current day superfast computer era, simulations of computationally supper expensive codes have become a reality. We all (computational scientists) use different computer languages to write our codes and many of us still use Fortran to get to do the scientific calculations. Currently, there are two compilers for Frotran codes: (1) GNU's gfortran  and, (2) Intel's ifort. While a person can use any of those but ifort has some advantages over gfortran. Here, I list a few of them as below:

(1) gfortran is slower then ifort since ifort are specially written for intel prossesors

(2) In gfortran, there is a limit of name of subroutine of 80 characters but in ifort there is no such limitation

(3) ifort is slightly better than gfortran. In performance: for
the Polyhedron benchmark, ifort is about 1.6% faster (geometric mean) on a Core2

(4) ifort is can do a much better auto-vectorization for loops that uses a
large number of arrays. e.g. SIMD. 

Therefore, it is useful to use Intel's ifort compilers over gnu's gfortran. 

Following are the steps to install ifort on your local directory on a cluster. 

(a) Download the source package for the Link. Download it to any directory. 

(e.g. say mypackage)

It will download a shell script file with the size ~ 500 MB. 

(b) Now cd to the path of the downloaded file

cd path/to/mypackage

(c) Execute the following command to install it to a user directory:

sh ./l_fortran-compiler_p_2021.3.0.3168_offline.sh

It will extract the package and check for the system requirements. 

 

 

 

 

 


If you are lucky, which I think you are since you are using a University/company cluster which will meet all the system requirements, then it will lead you the installation process. Hit the continue button.


(d) If all went well, it will show you the installation page poped-up on the screen.

It will tell you the installation path for the ifort files. Which will be always a intel directory in the home directory. Something like the following:

/home/username/intel/oneapi.

Where, username is your username. 


 

Now agree the terms and conditions and hit continue.

(e) It will ask you for the Eclipse IDE integration. You can skip this as I did. And hit the right arrow button at the bottom of the page.



(f) In the next window, it asks for the consent to collect your information. I chose to not to let them gather my information. So, I chose the second option: I do NOT consent to the collection of my information. But you can choose any of that. 



Hit the install button at the bottom of the page. 

 

(g) If all goes well, the installation process will begin and the window would look like something like this:



Hit the finish button. To read the instructions from the Intel's website select the Open Get Started Guide. But I did not checked this box. 




(h) Voila! you have installed the iofrt compiler in the your home directory the location: . /home/username/intel/oneapi.

Where, username is your username.

[Now if you want to move it to another location, just cut and past it there.]

 

(i) Now export the path of the directory containing the binary files, e.g. ifort by writing the following in the .bashrc file. 

 #For intel fortran
source /home/hcharan/intel/oneapi/compiler/2021.3.0/env/vars.sh intel64

save the file and close it. Now go to the terminal and type the following command to execute the changes you mad in the .bashrc file.

source .bashrc.

If no error is displayed, that means everything is done.Check the path of ifor by following command: 

which ifort

 

Now you can compile your code by following command:

 

ifort filename.f90

 and it will give and executable a.out file execute it and get your desired results. 

If it show the path that means you have successfully installed ifrt and ready to do your Nobel prize winning work!

Note: The latest Intel fortran (year 2021 onward, may befor this year) has also introduced ifx compiler: a faster alternative to ifort. You can use ifx instead of ifort to compile programs, although there are some changes. Read for more on this webpage Link

 

 




Comments

Popular posts from this blog

How to Embed mp4 movie in beamer latex presentation

How Install XGRAFIX in Ubuntu-12.04