[心得] 在Ubuntu 14.04上用Intel Compiler編譯R

看板R_Language作者 (拒看低質媒體)時間9年前 (2014/10/13 14:39), 9年前編輯推噓1(105)
留言6則, 4人參與, 最新討論串1/1
[關鍵字]: R, Installation, MKL [重點摘要]: 在Ubuntu 14.04上利用Intel Compiler編譯R, 並設定後讓在Rstudio中使用。 1. 安裝Intel Compiler, MKL, ... 到 /opt/intel 2. 下載R Source並解壓縮到某個資料夾,以下代稱<R HOME> 3. 在bash下執行以下指令: ```sh # install tiff and cairo, or plot in rstudio will crash sudo apt-get install libcairo2-dev libtiff5-dev source /opt/intel/composerxe/bin/compilervars.sh intel6 export CC="icc" export CXX="icpc" export AR="xiar" export LD="xild" export CFLAGS="-O3 -ipo -openmp -xHost" export CXXFLAGS="-O3 -ipo -openmp -xHost" MKL="-lmkl_gf_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread" echo $MKL export MAIN_LDFLAGS='-openmp' ./configure --with-blas="$MKL" --with-lapack --enable-R-shlib --enable-BLAS-shlib --enable-memory-profiling make ``` 4. 在`~/.bashrc`中加入: source /opt/intel/composerxe/bin/compilervars.sh intel6 PATH=<R HOME>/bin:$PATH 5. 重新開啟在bash中執行rstudio即可打開編譯後的R。 6. 可能會有其他的side effect... 後續再補上。也歡迎補充更好的設定方法 實測一段原本要跑14秒的sapply函數,變成11秒。 參考資料: - http://0rz.tw/H7I0J https://software.intel.com/en-us/articles/ build-r-301-with-intel-c-compiler-and-intel-mkl-on-linux - http://stackoverflow.com/questions/25669214/ compiling-r-3-1-1-using-intel-mkl-enable-r-shlib-triggers-undefined-reference - -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.25.100 ※ 文章網址: http://www.ptt.cc/bbs/R_Language/M.1413182342.A.DBA.html ※ 編輯: Wush978 (140.112.25.100), 10/13/2014 14:39:18

10/14 19:38, , 1F
版主更新到14囉   我孩死抓著13不放手
10/14 19:38, 1F

10/14 19:39, , 2F
重灌沒很難 重新compile一堆library真的超煩
10/14 19:39, 2F

10/14 20:44, , 3F
這是新買的電腦,哈哈
10/14 20:44, 3F

10/17 00:14, , 4F
Revolution R Open(免費)有MKL功能,可以直接裝來用
10/17 00:14, 4F

10/17 00:17, , 5F
核心是R 3.1.1平台WIN/OS X/UBUNTU/CENTOS/openSUSE
10/17 00:17, 5F
我沒有什麼Revolution R的使用經驗,目前也不太打算去碰觸那部份。 很歡迎版友分享相關經驗 ※ 編輯: Wush978 (118.161.31.44), 10/19/2014 18:08:16

10/19 19:10, , 6F
這個流程我跑過一遍,確實可用。感謝版主。
10/19 19:10, 6F
文章代碼(AID): #1KEtE6sw (R_Language)