看板 R_Language 關於我們 聯絡資訊
[關鍵字]: 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
gsuper: 版主更新到14囉   我孩死抓著13不放手 10/14 19:38
gsuper: 重灌沒很難 重新compile一堆library真的超煩 10/14 19:39
Wush978: 這是新買的電腦,哈哈 10/14 20:44
yanchenglin: Revolution R Open(免費)有MKL功能,可以直接裝來用 10/17 00:14
yanchenglin: 核心是R 3.1.1平台WIN/OS X/UBUNTU/CENTOS/openSUSE 10/17 00:17
我沒有什麼Revolution R的使用經驗,目前也不太打算去碰觸那部份。 很歡迎版友分享相關經驗 ※ 編輯: Wush978 (118.161.31.44), 10/19/2014 18:08:16
ljta: 這個流程我跑過一遍,確實可用。感謝版主。 10/19 19:10