์ „์— Ubuntu 16.04 ppc64le์—์„œ CRAN-R์„ ์„ค์น˜ํ•˜๋Š” ๊ณผ์ •์„ ์˜ฌ๋ฆฐ ๋ฐ” ์žˆ์Šต๋‹ˆ๋‹ค๋งŒ, ์ด๋ฒˆ์—๋Š” Redhat์˜ ๊ฒฝ์šฐ์ž…๋‹ˆ๋‹ค. ๋Œ€๋ถ€๋ถ„์˜ ๊ณผ์ •์€ ๋น„์Šทํ•ฉ๋‹ˆ๋‹ค.

๋จผ์ €, Redhat EPEL์— ํฌํ•จ๋œ R์€ 3.5 ๋ฒ„์ „์ž…๋‹ˆ๋‹ค. ์ด๊ฑธ ์“ฐ์…”๋„ ๋œ๋‹ค๋ฉด ๊ทธ๋ƒฅ ์ด๊ฑธ ์„ค์น˜ํ•˜์‹œ๋Š” ๊ฒƒ์ด ํŽธํ•ฉ๋‹ˆ๋‹ค.

[root@ING ~]# yum list | grep R-core
R-core.ppc64le 3.5.0-1.el7 epel
R-core-devel.ppc64le 3.5.0-1.el7 epel

๊ทธ๋Ÿฌ๋‚˜ ํŠน์ • ๋ฒ„์ „, ๊ฐ€๋ น 3.4.1์„ ์„ค์น˜ํ•˜์‹œ๋ ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด CRAN์—์„œ source๋ฅผ ๋ฐ›์•„๋‹ค ์„ค์น˜ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๋จผ์ € ๊ธฐ์กด์— ์„ค์น˜๋œ R 3.5 ๋ฒ„์ „์„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

[root@ING ~]# yum erase R R-core R-core-devel R-devel R-java R-java-devel

์ด์–ด์„œ ๊ธฐ๋ณธ์ ์œผ๋กœ ํ•„์š”ํ•œ OS package๋“ค์„ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

[root@ING test]# yum install readline-devel readline-static libX11-devel libX11-common libXt-devel libXt bzip2 bzip2-libs bzip2-devel lzma-sdk-devel lzma-sdk457-devel pcre2-devel pcre3-devel gcc-gfortran libgfortran libcurl-devel curl texlive-latex texlive-latex-fonts texlive-txfonts texlive-pxfonts texlive-fontaxes java-1.8.0-openjdk java-1.8.0-openjdk-devel java-1.8.0-openjdk-headless

์ด์ œ source๋ฅผ download ๋ฐ›์Šต๋‹ˆ๋‹ค.

[root@ING test]# wget https://cran.r-project.org/src/base/R-3/R-3.4.1.tar.gz

[root@ING test]# tar -zxf R-3.4.1.tar.gz

[root@ING test]# cd R-3.4.1

Build ์ˆœ์„œ๋Š” ๋˜‘๊ฐ™์Šต๋‹ˆ๋‹ค. configure – make – make install ์ˆœ์ž…๋‹ˆ๋‹ค.

[root@ING R-3.4.1]# ./configure –enable-R-shlib

[root@ING R-3.4.1]# make -j 16

[root@ING R-3.4.1]# make install

์ด๋ ‡๊ฒŒ ์„ค์น˜ํ•˜๋ฉด ๊ธฐ๋ณธ์ ์œผ๋กœ /usr/local/lib64/R ๋ฐ‘์— ์„ค์น˜๋ฉ๋‹ˆ๋‹ค.

[root@ING R]# pwd
/usr/local/lib64/R

[root@ING R]# ls
bin COPYING doc etc include lib library modules share SVN-REVISION

๊ทธ๋Ÿฌ๋‚˜ ๋ณ„๋„๋กœ PATH๋ฅผ ์žก์•„์ฃผ์ง€ ์•Š์•„๋„ ์ด๋ฏธ /usr/local/bin์— R์ด copy๋˜์–ด ์žˆ์œผ๋ฏ€๋กœ ๊ทธ๋ƒฅ ๊ทธ๋Œ€๋กœ ์“ฐ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

[root@ING ~]# which R
/usr/local/bin/R

[root@ING ~]# R

R version 3.4.1 (2017-06-30) — “Single Candle”
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: powerpc64le-unknown-linux-gnu (64-bit)

Type ‘q()’ to quit R.

> install.packages(“knitr”)

> install.packages(“anim.plots”)

* ์ €๊ฐ™์€ ๊ฒฝ์šฐ ./configure –enable-R-shlib ์ˆ˜ํ–‰์‹œ ์ฒ˜์Œ์—๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ error๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

configure: error: libcurl >= 7.22.0 library and headers are required with support for https

๊ทธ๋Ÿฌ๋‚˜ ์‹ค์ œ๋กœ ๋ณด๋ฉด ์•„๋ž˜์ฒ˜๋Ÿผ libcurl์€ ์ด๋ฏธ 7.29 ๋ฒ„์ „์ด ์„ค์น˜๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

[root@ING R-3.4.1]# yum list | grep libcurl
libcurl.ppc64le 7.29.0-46.el7 @anaconda/7.5
libcurl-devel.ppc64le 7.29.0-46.el7 @rhel-7-for-power-9-rpms

์ด error์˜ ์›์ธ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด config.log๋ฅผ ๋’ค์ ธ๋ณด๋ฉด ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ฆ‰, ํ™˜๊ฒฝ ์„ค์ •์—์„œ PATH ๋ณ€์ˆ˜ ๋งจ ์•ž์— anaconda2๊ฐ€ ์˜ค๋„๋ก ๋˜์–ด ์žˆ์—ˆ๋Š”๋ฐ, anaconda2 ์†์— ์„ค์น˜๋œ libcurl์˜ ๋ฒ„์ „์ด ๋‚ฎ์€ ๊ฒƒ์ด ์›์ธ์ด์—ˆ์Šต๋‹ˆ๋‹ค.

[root@ING R-3.4.1]# env | grep PATH
PATH=/opt/anaconda2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/opt/DL/tensorflow/bin:/opt/DL/protobuf/bin:/opt/DL/caffe-bvlc/bin

[root@ING R-3.4.1]# grep libcurl config.log
configure:40993: checking if libcurl is version 7 and >= 7.22.0
/usr/bin/ld: warning: libssl.so.1.0.0, needed by /opt/anaconda2/lib/libcurl.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libcrypto.so.1.0.0, needed by /opt/anaconda2/lib/libcurl.so, not found (try using -rpath or -rpath-link)
/opt/anaconda2/lib/libcurl.so: undefined reference to `SSL_CTX_set_srp_username’
/opt/anaconda2/lib/libcurl.so: undefined reference to `libssh2_scp_recv2′
/opt/anaconda2/lib/libcurl.so: undefined reference to `SSL_CTX_set_srp_password’
configure:41089: error: libcurl >= 7.22.0 library and headers are required with support for https

์ด๋Š” ๊ฐ„๋‹จํžˆ PATH ํ™˜๊ฒฝ ๋ณ€์ˆ˜์—์„œ anaconda2๋ฅผ ์ œ๊ฑฐํ•œ ๋’ค configure๋ฅผ ์ˆ˜ํ–‰ํ•˜๋ฉด ๊ฐ„๋‹จํžˆ ํ•ต๊ฒฐ๋ฉ๋‹ˆ๋‹ค.

ํ† ๋ก  ์ฐธ๊ฐ€

์ด๋ฉ”์ผ์€ ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ์ž…๋ ฅ์ฐฝ์€ * ๋กœ ํ‘œ์‹œ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.