CentOS 6.2 x84_64 下安装intel 的icc / ifort 编译器全过程记录

第一步:先安装intel需要的软件包,特别是libstdc++5

在root身份下运行命令: yum install libstdc++.so.5

第二步:下载intel编译器安装包
http://www.intel.com/cd/software/products/apac/zho/343156.htm,选择英特尔® Fortran 编译器 Linux* 专业版 ,然后注册,Intel会给用户发一封电子邮件,其中包含一个协议附件。剩下的工作是收取邮件,然后根据邮件中提供的地址下载软件
l_ccompxe_intel64_2011.10.319.tgz    l_fcompxe_intel64_2011.10.319.tgz

第三步:license设置。

  创建 /opt/intel/licenses 目录

mkdir -p /opt/intel/licenses

  把邮件附件中的.lic文件拷贝到/opt/intel/licenses目录下

    cp NCOM_L_CMP__N49V-3GP6M9F2.lic /opt/intel/licenses
  


  第四步:cd 到 l_ccompxe_intel64_2011.10.319.tgz 文件所在的目录,然后解压。

!注:终端下可用命令:

tar -zxvf l_ccompxe_intel64_2011.10.319.tgz  解压。

       进入解压后的文件夹,运行:

      ./install.sh

注:运行./install时,CentOS下可能会出现系统为强制模式,需更改为宽容模式,或将SELinux关闭。下面为不重启电脑的情况下的解决办法:

root用户身份输入如下命令:

[root@localhost l_ccompxe_intel64_2011.10.319]# setenforce 0
[root@localhost l_ccompxe_intel64_2011.10.319]# getenforce
Permissive

此时,显示为Permissive后,再次运行./install,然后继续以下安装步骤。


第五步:选择1,typical安装


一路enter下去,有yes or no就输入yes,有accept or rejecet就输入accept


选择默认的安装路径即可,一路enter下去


若安装正常,应会提示安装成功;

 

第六步: 按照安装成功后的提示路径,将如下语句加入~/.bashrc后保存退出。

将语句
  source /opt/intel/composer_xe_2011_sp1.10.319/bin/compilervars.sh intel64

加入到 ~/.bashrc(其他Linux是~/.bash_profile文件) 文件末尾,保存退出。

!注:终端下可执行  gedit ~/.bashrc
           保存退出后,执行 source ~/.bashrc


  测试,which icc,会显示安装路径。


ifort 和icc的安装过程完全相同,依次执行以上几个步骤,便可安装成功。


下面为安装全过程:

[root@localhost l_ccompxe_intel64_2011.10.319]# ./install.sh
Your system is protected with Security-enhanced Linux* (SELinux).

Initial product installation and licensing requires that SELinux be disabled
or set to "Permissive" mode.  You can temporarily disable SELinux, install the
product, and then re-enable SELinux.  SELinux needs to be disabled only during
initial product installation and licensing setup.  SELinux does not affect
run-time operation of the product.

You may disable SELinux by either:
    - changing your /etc/sysconfig/selinux file.  Change the line containing
      "SELINUX=enforcing" to "SELINUX=disabled" or to "SELINUX=permissive".
    - OR changing your lilo.conf or grub.conf file. Add the "selinux=0"
      kernel argument.

You will need to reboot your system for these changes to take effect.  You can also ask your system administrator to make SELinux mode changes.
 
Remember to enable SELinux again and reboot after successful product installation, if SELinux is required.  Please consult your product Release Notes document for more information on how to install in an SELinux-enabled environment.

More information about SELinux can be found at http://www.nsa.gov/research/selinux/index.shtml

Quitting! Press "Enter" to terminate install.

[root@localhost l_ccompxe_intel64_2011.10.319]# setenforce 0
[root@localhost l_ccompxe_intel64_2011.10.319]# getenforce
Permissive

1. Install as a root for system wide access for all users [default]
2. Install to root for system wide access for all users using sudo
   privileges and password
3. Install as current user to limit access to user level

h. Help
q. Quit
 
Please type a selection [1]: 1
Attempting to log in as root...
密码:

--------------------------------------------------------------------------------
Initializing, please wait...
--------------------------------------------------------------------------------