shanbin的个人博客分享 http://blog.sciencenet.cn/u/shanbin

博文

Install Intel Fortran on Ubuntu system

已有 5741 次阅读 2013-7-10 14:55 |个人分类:Linux学习|系统分类:科研笔记| Fortran, Intel

Step 1. Google the 'non-commerical intel fortran compiler' tofind the install package of Intel fortran. The download link on thewebsit (http://software.intel.com/en-us/non-commercial-software-development).

 

Step 2. Fillyour information to obtain anemail which includes the serial number and filedownload link. Download the files.

 

Step 3. unpack the install filewith the command tar-xzvf ....tar.gz

 

Step 4.  installseveral probably necessary sources for intalling fortran.(During my install process, g++ isasked.)

            sudo apt-get install build-essential

            sudo apt-get install libstdc++5

            apt-get install gcc
            apt-get install g++

            if you want install 32-bit compiler on 64-bit PC, ohter sources maybe needed.

               Atfirst:

                   apt-get install ia32-libs

               Then you can install others sources:

                    apt-get install libstdc++5

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

     Moreover,the new version of ubuntu may not include the libstdc++5. We canuse the source of debian.

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

   Download package of deb in the version of i386 andamd64. Come to the directory which include the package of deb.Install package of amd64.
                     dpkg -i libstdc++5_xxxxx_amd64.deb

   Itis more complex for the package of i386, because it may recover thelibrary of 64-bit. So you sould better extract the packagemanually.
                     dpkg –extract libstdc++_xxxxx_i386.deb ./

  Then copy thefile 'libstdc++.so.5.xxx' in the directory of lib to the 32-bitlibrary, and link it with libstdc++.so.5.

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

 

Step 5. run the file install.sh to install intelfortran. In this process, you must input the serial numer. Look theinformation carefully during this process.

                   sudo ./install.sh

         

Step 6. Source the variables with bash command which will be listedon the screen. Until here,the install process is finished.You can check the install directory with command 'which ifort',check the verison of intel fortran with 'ifort-v'.

                for64-bit

                     source /opt/intel/Compiler/11.x/xxx/bin/ifortvars.shintel64
                     ifort –help

              for 32-bit
                    source /opt/intel/Compiler/11.x/xxx/bin/ifortvars.shia32
                     ifort –help

                    (/opt/intel/ may be changed to your installdirectory)

 

Step 7. If you do not want to set the enviroment variableseverytime when you open a new terminal, you should better modifythe file .bashrc in your home directory. You need to open the.bashrc file, and all the below command in the last line.

            source /install-directory/intel/Compiler/11.x/xxx/bin/ifortvars.shintel64 (the command in step 6).

            Actually, during my install process, I open the .bashrc file athome directory, and add a path below the lastline PATH="$HOME/intel/bin:$PATH"

 

After that you can compile your fortran programwith the most simple command:

           ifort -o execute-file language.f


Sometimes, there will be an unpredicted error (e.g. segmentation fault...)

Since my desktop is a 64 bit PC, I don't install the 32 bit library.

But actually, I sould better also intall package listed below

apt-get install ia32-libs  (only needed if you install the 32bit compiler)
apt-get install openjdk-6-jre-headless



https://blog.sciencenet.cn/blog-1000382-706951.html


下一篇:Install Flash player on Linux
收藏 IP: 137.111.13.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (2 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-7-28 06:34

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部