1.下載Intel® Math Kernel Library for Linux安裝包
2.采用tar -xvzf命令解壓安裝包,進入解壓后的安裝包,運行./install.sh腳本執行安裝過程。
3.MKL的默認安裝路徑是/opt/intel。在目錄/opt/intel/composer_xe_2013_sp1.0.080/mkl/bin/intel64下找到mklvars.sh,對於64位操作系統,執行compilervars.sh intel64
4.配置環境變量:
a.獲得root權限, $ su
b.$ gedit /etc/profile
c. 在末尾處加入代碼:
export PATH=/opt/intel/bin:$PATH
export LD_LIBRARY_PATH=/opt/intel/lib/intel64:/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH
d: $ source /etc/profile 如果沒有報錯,則path生效
5.編寫一個test.cpp並編譯
g++ test.cpp -o test -I/opt/intel/mkl/include -L/opt/intel/mkl/lib/intel64 -lm
-dl -lpthread -liomp5 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core