Jiggling & Wiggling

2006/04/17

how to install intel fortran compiler under ubuntu linux

Filed under: Software, Ubuntu — roylez @ 8:50 下午

The solutions on the ubuntuforum.org seem not working for my box correctly, here is my solution.

1. download the intel fortran compiler from intel’s ftp. If you do not know where to go, search for it on google. The complete package has a size of 128MB, and after unzipping, you will find some rpm files.
select the proper rpm for you computer, For Pentium 32bit processors, you can choose intel-ifort9-9.0-031.i386.rpm. Convert it to deb package with alien. I used -k to reserve the version number.

    sudo alien -k intel-ifort9-9.0-031.i386.rpm

    2. install the deb package.

      sudo dpkg -i intel-ifort9*.deb

      3. go to the default installtion directory, which is, normally, /opt/intel. Change the permission of the directory and its subs with chmod so that every user can access it.

        sudo chmod 755 -R intel/

        4. add the following code to your .bashrc.

          # add Intel Compiler environment variables
          #INSTALLDIR is /opt/intel/fc/9.0/
          if [ -z "${PATH}" ]
          then
          PATH="/opt/intel/fc/9.0/bin"; export PATH
          else
          PATH="/opt/intel/fc/9.0/bin:$PATH"; export PATH
          fi
          if [ -z "${LD_LIBRARY_PATH}" ]
          then
          LD_LIBRARY_PATH="/opt/intel/fc/9.0/lib"; export LD_LIBRARY_PATH
          else
          LD_LIBRARY_PATH="/opt/intel/fc/9.0/lib:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH
          fi
          if [ -z "${MANPATH}" ]
          then
          MANPATH="/opt/intel/fc/9.0/man":$(manpath); export MANPATH
          else
          MANPATH="/opt/intel/fc/9.0/man:${MANPATH}"; export MANPATH
          fi
          if [ -z "${INTEL_LICENSE_FILE}" ]
          then
          INTEL_LICENSE_FILE="/opt/intel/fc/9.0/licenses:/opt/intel/licenses:${HOME}/intel/licenses"; export INTEL_LICENSE_FILE
          else
          INTEL_LICENSE_FILE="${INTEL_LICENSE_FILE}:/opt/intel/fc/9.0/licenses:/opt/intel/licenses: ${HOME}/intel/licenses"; export INTEL_LICENSE_FILE
          fi

          5. reboot your computer and use ifort to compile your source code. Intel fortran compiler can compile much faster fortran programs on Pentium computers than g95 and gfortran. Enjoy!

            Advertisements

            6条评论 »

            1. Hi, 为什么你的页面上中文有许多乱码?不是全部的,是大部分。

              条评论 由 livepine — 2006/05/13 @ 12:22 上午

            2. 我也没有办法啊,以前都好好的,好像wordpress更新了系统,然后就乱码一堆。我想从writely重新publish一下,结果老是不成功。

              条评论 由 Roy — 2006/05/13 @ 9:09 上午

            3. This is nice but it does not show how to install the fortran debugger (intel). So I guess the explanation here is better:

              http://www.ubuntuforums.org/showthread.php?t=179589

              条评论 由 Bruno — 2006/06/04 @ 7:20 下午

            4. For Dapper it is different instalation procedure (Intel Fortran):

              first i suppose that you have the *.lic files.
              i have created /opt/intel/licenses and I have copied the *.lic files there.

              then

              Code:

              tar xvf l_cc_c_9.0.031.tar.gz

              went to
              Code:

              cd l_cc_c_9.0.031

              then
              Code:

              sudo alien -k intel-iidb9-9.0-036.i386.rpm
              sudo alien -k intel-FORTRAN-COMPILER.rpm

              now the debugger
              Code:

              cd /opt/intel/idb/9.0/bin

              I changed idbvars.sh to look like
              Code:

              #! /bin/sh

              if [ -z “${PATH}” ]
              then
              PATH=”/opt/intel/idb/9.0/bin”; export PATH
              else
              PATH=”/opt/intel/idb/9.0/bin:$PATH”; export PATH
              fi

              if [ -z “${MANPATH}” ]
              then
              MANPATH=”/opt/intel/idb/9.0/man”:$(manpath); export MANPATH
              else
              MANPATH=”/opt/intel/idb/9.0/man:${MANPATH}”; export MANPATH
              fi

              the idb should look like
              Code:

              #!/bin/bash
              #
              # Script to run the correct installed idb executable, depending on the
              # platform. This allows the user to simply type “idb” at command line
              # regardless of platform.
              #

              MACHINE=`uname -m`
              DIR=`dirname ${0}`

              # If the machine is not Itanium(R), then it must be a variation on the 32 bit
              # machine.
              #
              if [[ ${MACHINE} == “ia64” ]]; then
              IDB=${DIR}/eidb
              else
              if [[ ${MACHINE} == “x86_64” && -e ${DIR}/idb-e ]]; then
              IDB=${DIR}/idb-e
              else
              if [[ ${MACHINE} == “i686” ]]; then
              export IDB_SAVE_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
              export IDB_SAVE_DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}
              export IDB_SAVE_DYLD_FRAMEWORK_PATH=${DYLD_FRAMEWORK_PATH}
              export IDB_SAVE_DYLD_ROOT_PATH=${DYLD_ROOT_PATH}
              export IDB_SAVE_DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH}
              export IDB_SAVE_DYLD_FALLBACK_FRAMEWORK_PATH=${DYLD_FALLBACK_FRAMEWORK_PATH}
              export IDB_SAVE_DYLD_PATHS_ROOT=${DYLD_PATHS_ROOT}
              export IDB_SAVE_DYLD_IMAGE_SUFFIX=${DYLD_IMAGE_SUFFIX}
              export IDB_SAVE_DYLD_INSERT_LIBARIES=${DYLD_INSERT_LIBARIES}
              fi
              IDB=${DIR}/iidb
              fi
              fi

              if [[ -e ${IDB} ]]; then
              exec ${IDB} “$@”
              else
              echo “Unable to find idb (${IDB})”
              fi

              probably the most important bit is

              Code:

              sudo ln -s /usr/lib/libXft.so.2 /usr/lib/libXft.so.1

              for fortran compiler
              the idea is more or less the same
              Code:

              tar xvf l_fc_c_9.0.032.tar.gz
              cd l_fc_c_9.0.032
              sudo alien -k intel-ifort9-9.0-032.i386.rpm
              sudo dpkg -i intel-*.deb

              now you should have the fortran installed in /opt/intel/fc/9.0

              i have changed ifortvars.sh like that
              the INTEL_LICENSE_FILE part to look like

              Code:

              if [ -z “$INTEL_LICENSE_FILE” ]
              then
              INTEL_LICENSE_FILE=”/opt/intel/licenses”;
              else
              INTEL_LICENSE_FILE=”$INTEL_LICENSE_FILE:/opt/intel/licenses”;
              fi
              export INTEL_LICENSE_FILE;

              last bit

              in my home directory I added this lines to .bashrc
              Code:

              #intel stuff
              source /opt/intel/fc/9.0/bin/ifortvars.sh
              source /opt/intel/idb/9.0/bin/idbvars.sh

              条评论 由 Bruno — 2006/06/04 @ 7:33 下午

            5. Bruno,

              I am still a newbie to linux and ubuntu, and if i tell you that i have never used any debugger programmes like gdb or idb, pls forgive me. 🙂 My ubuntu is dapper, but i have no idea why your situation is different from mine. Anyway, both your and my solution works on our boxes respectively, right?
              Thank you Bruno! You are very kind!

              Roy

              条评论 由 Roy — 2006/06/05 @ 5:17 上午

            6. Now I know there is a much easier way to do all those things on the fly for deb based distros!

              Go to data/ subdirectory after unpacking,and edit “install_fc.sh”. Change the line
              RPM_NOT_FOUND=$?
              to
              RPM_NOT_FOUND=1.
              and you will find you can use install.sh to complete the installation without any error. You can even use checkinstall to make deb packages of the installation. This method also works for intel c++ compiler.

              条评论 由 roylez — 2007/05/08 @ 10:31 上午


            RSS feed for comments on this post. TrackBack URI

            发表评论

            Fill in your details below or click an icon to log in:

            WordPress.com Logo

            You are commenting using your WordPress.com account. Log Out / 更改 )

            Twitter picture

            You are commenting using your Twitter account. Log Out / 更改 )

            Facebook photo

            You are commenting using your Facebook account. Log Out / 更改 )

            Google+ photo

            You are commenting using your Google+ account. Log Out / 更改 )

            Connecting to %s

            通过访问 WordPress.com 创建免费网站或博客.

            %d 博主赞过: