歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CentOS 6.2 x84_64 下安裝intel 的icc / ifort 編譯器全過程記錄

CentOS 6.2 x84_64 下安裝intel 的icc / ifort 編譯器全過程記錄

日期:2017/2/28 15:46:04   编辑:Linux教程

第一步:先安裝intel需要的軟件包,特別是libstdc++5

可以參照我的另外一篇文章Ubuntu 10.04 下安裝Intel Fortran/C++ 編譯器(ifort 和 icc) 中介紹的(見 http://www.linuxidc.com/Linux/2012-07/65070.htm ),安裝intel編譯器前需要其他軟件包。需要注意的ubuntu下使用的是apt-get 工具安裝,CentOS下並沒有自帶apt-get這個工具,但是centos下自帶的有yum工具(稍後的一篇博文將寫到yum 和apt-get的具體區別),我們可以根據yum進行命令安裝。例如:
libstdc++5的安裝:在centos下必須找到與其對應的軟件包的名稱,才能用yum進行安裝libstdc++.so.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的安裝過程完全相同,依次執行以上幾個步驟,便可安裝成功。

  
下面為安裝全過程:

[www.linuxidc.com@localhost ~]$ su root
密碼:
[root@localhost www.linuxidc.com]# mkdir -p /opt/intel/licenses
[root@localhost www.linuxidc.com]# cp NCOM_L_CMP__N49V-3GP6M9F2.lic /opt/intel/licenses


[www.linuxidc.com@localhost ~]$ tar -zxvf l_ccompxe_intel64_2011.10.319.tgz
l_ccompxe_intel64_2011.10.319/
l_ccompxe_intel64_2011.10.319/rpms/
l_ccompxe_intel64_2011.10.319/rpms/EULA.txt
l_ccompxe_intel64_2011.10.319/rpms/intel-compilerpro-common-319-12.1-10.noarch.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-compilerpro-devel-319-12.1-10.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-compilerpro-vars-319-12.1-10.noarch.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-compilerproc-319-12.1-10.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-compilerproc-common-319-12.1-10.noarch.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-compilerproc-devel-319-12.1-10.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-idb-319-12.1-10.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-idb-common-319-12.1-10.noarch.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-idbcdt-319-12.1-10.noarch.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-ipp-sp1-319-7.0-7.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-ipp-sp1-common-319-7.0-7.noarch.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-ipp-sp1-devel-319-7.0-7.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-mkl-sp1-319-10.3-10.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-mkl-sp1-common-319-10.3-10.noarch.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-mkl-sp1-devel-319-10.3-10.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-openmp-319-12.1-10.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-openmp-devel-319-12.1-10.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-sourcechecker-common-319-12.1-10.noarch.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-sourcechecker-devel-319-12.1-10.x86_64.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-tbb-sp1-319-4.0-4.noarch.rpm
l_ccompxe_intel64_2011.10.319/rpms/intel-tbb-sp1-devel-319-4.0-4.noarch.rpm
l_ccompxe_intel64_2011.10.319/pset/
l_ccompxe_intel64_2011.10.319/pset/chklic/
l_ccompxe_intel64_2011.10.319/pset/chklic/32/
l_ccompxe_intel64_2011.10.319/pset/chklic/32/chklic
l_ccompxe_intel64_2011.10.319/pset/chklic/32/chklic_libFNP.so
l_ccompxe_intel64_2011.10.319/pset/chklic/32e/
l_ccompxe_intel64_2011.10.319/pset/chklic/32e/chklic
l_ccompxe_intel64_2011.10.319/pset/chklic/32e/chklic_libFNP.so
l_ccompxe_intel64_2011.10.319/pset/chklic/rpm_extract.32
l_ccompxe_intel64_2011.10.319/pset/chklic/rpm_extract.32e
l_ccompxe_intel64_2011.10.319/pset/tools/
l_ccompxe_intel64_2011.10.319/pset/tools/ipcheck_x32
l_ccompxe_intel64_2011.10.319/pset/tools/ipcheck_x64
l_ccompxe_intel64_2011.10.319/pset/activation/
l_ccompxe_intel64_2011.10.319/pset/activation/FNPLicensingService/
l_ccompxe_intel64_2011.10.319/pset/activation/FNPLicensingService/32/
l_ccompxe_intel64_2011.10.319/pset/activation/FNPLicensingService/32/FNPLicensingService
l_ccompxe_intel64_2011.10.319/pset/activation/FNPLicensingService/32e/
l_ccompxe_intel64_2011.10.319/pset/activation/FNPLicensingService/32e/FNPLicensingService
l_ccompxe_intel64_2011.10.319/pset/activation/FNPLicensingService/64/
l_ccompxe_intel64_2011.10.319/pset/activation/FNPLicensingService/64/FNPLicensingService
l_ccompxe_intel64_2011.10.319/pset/activation/README.txt
l_ccompxe_intel64_2011.10.319/pset/activation/install_fnp.sh
l_ccompxe_intel64_2011.10.319/pset/32/
l_ccompxe_intel64_2011.10.319/pset/32/gcc-3.2/
l_ccompxe_intel64_2011.10.319/pset/32/gcc-3.2/libstdc++.so.5
l_ccompxe_intel64_2011.10.319/pset/32/activation.so
l_ccompxe_intel64_2011.10.319/pset/32/activation_libFNP.so
l_ccompxe_intel64_2011.10.319/pset/32/install.32
l_ccompxe_intel64_2011.10.319/pset/32/libMinAxis.so
l_ccompxe_intel64_2011.10.319/pset/32/libares.so
l_ccompxe_intel64_2011.10.319/pset/32/libcrypto.so
l_ccompxe_intel64_2011.10.319/pset/32/libcrypto.so.0.9.7
l_ccompxe_intel64_2011.10.319/pset/32/libcrypto.so.1.0.0
l_ccompxe_intel64_2011.10.319/pset/32/libexpat.so.0
l_ccompxe_intel64_2011.10.319/pset/32/libssl.so
l_ccompxe_intel64_2011.10.319/pset/32/libssl.so.0.9.7
l_ccompxe_intel64_2011.10.319/pset/32/libssl.so.1.0.0
l_ccompxe_intel64_2011.10.319/pset/32/libxml2.so.2
l_ccompxe_intel64_2011.10.319/pset/licenses/
l_ccompxe_intel64_2011.10.319/pset/licenses/BigInteger/
l_ccompxe_intel64_2011.10.319/pset/licenses/BigInteger/LICENSE
l_ccompxe_intel64_2011.10.319/pset/licenses/BigInteger/Readme
l_ccompxe_intel64_2011.10.319/pset/licenses/expat/
l_ccompxe_intel64_2011.10.319/pset/licenses/expat/COPYING
l_ccompxe_intel64_2011.10.319/pset/licenses/expat/README
l_ccompxe_intel64_2011.10.319/pset/licenses/openssl/
l_ccompxe_intel64_2011.10.319/pset/licenses/openssl/license.txt
l_ccompxe_intel64_2011.10.319/pset/licenses/openssl/readme.txt
l_ccompxe_intel64_2011.10.319/pset/licenses/axis/
l_ccompxe_intel64_2011.10.319/pset/licenses/axis/Copyright.txt
l_ccompxe_intel64_2011.10.319/pset/licenses/axis/LICENSE
l_ccompxe_intel64_2011.10.319/pset/licenses/libxml/
l_ccompxe_intel64_2011.10.319/pset/licenses/libxml/Copyright
l_ccompxe_intel64_2011.10.319/pset/licenses/libxml/README
l_ccompxe_intel64_2011.10.319/pset/licenses/ares/
l_ccompxe_intel64_2011.10.319/pset/licenses/ares/README
l_ccompxe_intel64_2011.10.319/pset/licenses/ares/license
l_ccompxe_intel64_2011.10.319/pset/licenses/libstdc++/
l_ccompxe_intel64_2011.10.319/pset/licenses/libstdc++/readme-libstdc++.txt
l_ccompxe_intel64_2011.10.319/pset/32e/
l_ccompxe_intel64_2011.10.319/pset/32e/gcc-3.2/
l_ccompxe_intel64_2011.10.319/pset/32e/gcc-3.2/libstdc++.so.5
l_ccompxe_intel64_2011.10.319/pset/32e/activation.so
l_ccompxe_intel64_2011.10.319/pset/32e/activation_libFNP.so
l_ccompxe_intel64_2011.10.319/pset/32e/install.32e
l_ccompxe_intel64_2011.10.319/pset/32e/libMinAxis.so
l_ccompxe_intel64_2011.10.319/pset/32e/libares.so
l_ccompxe_intel64_2011.10.319/pset/32e/libcrypto.so
l_ccompxe_intel64_2011.10.319/pset/32e/libcrypto.so.0.9.7
l_ccompxe_intel64_2011.10.319/pset/32e/libcrypto.so.1.0.0
l_ccompxe_intel64_2011.10.319/pset/32e/libexpat.so.0
l_ccompxe_intel64_2011.10.319/pset/32e/libssl.so
l_ccompxe_intel64_2011.10.319/pset/32e/libssl.so.0.9.7
l_ccompxe_intel64_2011.10.319/pset/32e/libssl.so.1.0.0
l_ccompxe_intel64_2011.10.319/pset/32e/libxml2.so.2
l_ccompxe_intel64_2011.10.319/pset/iat/
l_ccompxe_intel64_2011.10.319/pset/iat/iat_install.sh
l_ccompxe_intel64_2011.10.319/pset/iat/intel-iat-2.0.013-1.i686.rpm
l_ccompxe_intel64_2011.10.319/pset/iat/intel-iat-2.0.013-1.ia64.rpm
l_ccompxe_intel64_2011.10.319/pset/iat/intel-iat-2.0.013-1.x86_64.rpm
l_ccompxe_intel64_2011.10.319/pset/iat/rpm_extract.32
l_ccompxe_intel64_2011.10.319/pset/iat/rpm_extract.32e
l_ccompxe_intel64_2011.10.319/pset/iat/rpm_extract.64
l_ccompxe_intel64_2011.10.319/pset/check.awk
l_ccompxe_intel64_2011.10.319/pset/cpu_check
l_ccompxe_intel64_2011.10.319/pset/install.sh
l_ccompxe_intel64_2011.10.319/pset/l_cpp_composer_xe.asr
l_ccompxe_intel64_2011.10.319/pset/link_install.sh
l_ccompxe_intel64_2011.10.319/pset/mediaconfig.xml
l_ccompxe_intel64_2011.10.319/pset/searc.dat
l_ccompxe_intel64_2011.10.319/cd_eject.sh
l_ccompxe_intel64_2011.10.319/install.sh
l_ccompxe_intel64_2011.10.319/license
l_ccompxe_intel64_2011.10.319/license_jp
l_ccompxe_intel64_2011.10.319/support.txt
[www.linuxidc.com@localhost ~]$ cd l_ccompxe_intel64_2011.10.319


[www.linuxidc.com@localhost l_ccompxe_intel64_2011.10.319]$ su root
密碼:******

[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

[www.linuxidc.com@localhost l_ccompxe_intel64_2011.10.319]$ sh install.sh
Please make your selection by entering an option.
Root access is recommended for evaluation.

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...
--------------------------------------------------------------------------------

Copyright © Linux教程網 All Rights Reserved