레이블이 rstudio인 게시물을 표시합니다. 모든 게시물 표시
레이블이 rstudio인 게시물을 표시합니다. 모든 게시물 표시

2017년 11월 9일 목요일

R 3.4.1의 설치 및 기존 rstudio와의 연동

예전에 쓰던 버전의 R (가령 3.3.2)를 그대로 놔둔 상태에서, 새로운 버전의 R 3.4.1을 써야 할 경우가 있습니다.  이때는 아래 절차에 따라 설치하시면 됩니다.

먼저, 아래 link에서 제가 ppc64le(POWER8) 상에서 빌드한 R server 3.4.1을 여기서 download 받아서, 기존 서버의 사용자 홈 디렉토리에 upload 한 뒤 자신의 홈 디렉토리에 풀어놓습니다. 
여기서는 u0017649라는 유저의 홈디렉토리에 풀었습니다만, 아무 곳에 풀어놓아도 상관없습니다.   기존 버전은 /usr/local/lib/R 밑에 설치되어 있을 것입니다.

u0017649@sys-89830:~$ tar -zxf R341.tgz

u0017649@sys-89830:~$ cd R
u0017649@sys-89830:~/R$ pwd
/home/u0017649/R

이제 새로 풀어놓은 R을 Rstudio와 연동시키기 위해서, 다음과 같이 기존 /usr/bin/R을 다음과 같이 옮겨놓고, 방금 풀어놓은 R을 /usr/bin/R로 softlink를 시켜 줍니다.

u0017649@sys-89830:~/R$ sudo mv /usr/bin/R /usr/bin/R.old

u0017649@sys-89830:~/R$ sudo ln /home/u0017649/R/bin/R /usr/bin/R

이제 Rstudio를 재시작합니다.

u0017649@sys-89830:~/R$ sudo systemctl stop rstudio-server.service
u0017649@sys-89830:~/R$ sudo systemctl start rstudio-server.service

u0017649@sys-89830:~/R$ sudo systemctl status rstudio-server.service
● rstudio-server.service - LSB: RStudio Server
   Loaded: loaded (/etc/init.d/rstudio-server; bad; vendor preset: enabled)
   Active: active (running) since Wed 2017-11-08 20:26:40 EST; 7s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 12456 ExecStop=/etc/init.d/rstudio-server stop (code=exited, status=0/SUCCESS)
  Process: 12469 ExecStart=/etc/init.d/rstudio-server start (code=exited, status=0/SUCCESS)
    Tasks: 3
   Memory: 10.1M
      CPU: 661ms
   CGroup: /system.slice/rstudio-server.service
           └─12477 /usr/local/lib/rstudio-server/bin/rserver

Nov 08 20:26:40 sys-89830 systemd[1]: Starting LSB: RStudio Server...
Nov 08 20:26:40 sys-89830 systemd[1]: Started LSB: RStudio Server.

그 다음에 평소대로 http://서버주소:8787 로 접속하시면 됩니다.  아래와 같이 잘 됩니다.



참고1) 기존 Rstudio 버전(Version 99.9.9)은 새 R 3.4.1과 위와 같이 잘 연동됩니다.

참고2) 여기서 사용된 CRAN R 3.4.1의 빌드는 예전 포스팅 http://hwengineer.blogspot.kr/2017/06/ppc64le-ubuntu-cran-r-package-rstudio.html 에 나온 절차대로 하시면 됩니다. 

참고3) 이 R341.tgz 속에 설치된 R 패키지들은 다음과 같습니다.

> installed.packages()
              Package        
anim.plots    "anim.plots"   
animation     "animation"    
assertthat    "assertthat"   
BH            "BH"           
bindr         "bindr"        
bindrcpp      "bindrcpp"     
bitops        "bitops"       
boot          "boot"         
Boruta        "Boruta"       
caret         "caret"        
caretEnsemble "caretEnsemble"
caTools       "caTools"      
class         "class"        
cluster       "cluster"      
codetools     "codetools"    
colorspace    "colorspace"   
curl          "curl"         
CVST          "CVST"         
data.table    "data.table"   
ddalpha       "ddalpha"      
DEoptimR      "DEoptimR"     
dichromat     "dichromat"    
digest        "digest"       
dimRed        "dimRed"       
dplyr         "dplyr"        
DRR           "DRR"          
e1071         "e1071"        
evaluate      "evaluate"     
foreach       "foreach"      
foreign       "foreign"      
gdata         "gdata"        
ggplot2       "ggplot2"      
glue          "glue"         
gower         "gower"        
gplots        "gplots"       
gridExtra     "gridExtra"    
gtable        "gtable"       
gtools        "gtools"       
highr         "highr"        
ipred         "ipred"        
iterators     "iterators"    
kernlab       "kernlab"      
KernSmooth    "KernSmooth"   
knitr         "knitr"        
labeling      "labeling"     
lattice       "lattice"      
lava          "lava"         
lazyeval      "lazyeval"     
lubridate     "lubridate"    
magrittr      "magrittr"     
markdown      "markdown"     
MASS          "MASS"         
Matrix        "Matrix"       
mgcv          "mgcv"         
mime          "mime"         
ModelMetrics  "ModelMetrics" 
munsell       "munsell"      
nlme          "nlme"         
numDeriv      "numDeriv"     
pbapply       "pbapply"      
pkgconfig     "pkgconfig"    
plogr         "plogr"        
              LibPath                        
anim.plots    "/usr/local/lib/R/site-library"
animation     "/usr/local/lib/R/site-library"
assertthat    "/usr/local/lib/R/site-library"
BH            "/usr/local/lib/R/site-library"
bindr         "/usr/local/lib/R/site-library"
bindrcpp      "/usr/local/lib/R/site-library"
bitops        "/usr/local/lib/R/site-library"
boot          "/usr/local/lib/R/site-library"
Boruta        "/usr/local/lib/R/site-library"
caret         "/usr/local/lib/R/site-library"
caretEnsemble "/usr/local/lib/R/site-library"
caTools       "/usr/local/lib/R/site-library"
class         "/usr/local/lib/R/site-library"
cluster       "/usr/local/lib/R/site-library"
codetools     "/usr/local/lib/R/site-library"
colorspace    "/usr/local/lib/R/site-library"
curl          "/usr/local/lib/R/site-library"
CVST          "/usr/local/lib/R/site-library"
data.table    "/usr/local/lib/R/site-library"
ddalpha       "/usr/local/lib/R/site-library"
DEoptimR      "/usr/local/lib/R/site-library"
dichromat     "/usr/local/lib/R/site-library"
digest        "/usr/local/lib/R/site-library"
dimRed        "/usr/local/lib/R/site-library"
dplyr         "/usr/local/lib/R/site-library"
DRR           "/usr/local/lib/R/site-library"
e1071         "/usr/local/lib/R/site-library"
evaluate      "/usr/local/lib/R/site-library"
foreach       "/usr/local/lib/R/site-library"
foreign       "/usr/local/lib/R/site-library"
gdata         "/usr/local/lib/R/site-library"
ggplot2       "/usr/local/lib/R/site-library"
glue          "/usr/local/lib/R/site-library"
gower         "/usr/local/lib/R/site-library"
gplots        "/usr/local/lib/R/site-library"
gridExtra     "/usr/local/lib/R/site-library"
gtable        "/usr/local/lib/R/site-library"
gtools        "/usr/local/lib/R/site-library"
highr         "/usr/local/lib/R/site-library"
ipred         "/usr/local/lib/R/site-library"
iterators     "/usr/local/lib/R/site-library"
kernlab       "/usr/local/lib/R/site-library"
KernSmooth    "/usr/local/lib/R/site-library"
knitr         "/usr/local/lib/R/site-library"
labeling      "/usr/local/lib/R/site-library"
lattice       "/usr/local/lib/R/site-library"
lava          "/usr/local/lib/R/site-library"
lazyeval      "/usr/local/lib/R/site-library"
lubridate     "/usr/local/lib/R/site-library"
magrittr      "/usr/local/lib/R/site-library"
markdown      "/usr/local/lib/R/site-library"
MASS          "/usr/local/lib/R/site-library"
Matrix        "/usr/local/lib/R/site-library"
mgcv          "/usr/local/lib/R/site-library"
mime          "/usr/local/lib/R/site-library"
ModelMetrics  "/usr/local/lib/R/site-library"
munsell       "/usr/local/lib/R/site-library"
nlme          "/usr/local/lib/R/site-library"
numDeriv      "/usr/local/lib/R/site-library"
pbapply       "/usr/local/lib/R/site-library"
pkgconfig     "/usr/local/lib/R/site-library"
plogr         "/usr/local/lib/R/site-library"
              Version     Priority     
anim.plots    "0.2"       NA           
animation     "2.5"       NA           
assertthat    "0.2.0"     NA           
BH            "1.65.0-1"  NA           
bindr         "0.1"       NA           
bindrcpp      "0.2"       NA           
bitops        "1.0-6"     NA           
boot          "1.3-20"    "recommended"
Boruta        "5.2.0"     NA           
caret         "6.0-77"    NA           
caretEnsemble "2.0.0"     NA           
caTools       "1.17.1"    NA           
class         "7.3-14"    "recommended"
cluster       "2.0.6"     "recommended"
codetools     "0.2-15"    "recommended"
colorspace    "1.3-2"     NA           
curl          "3.0"       NA           
CVST          "0.2-1"     NA           
data.table    "1.10.4-3"  NA           
ddalpha       "1.3.1"     NA           
DEoptimR      "1.0-8"     NA           
dichromat     "2.0-0"     NA           
digest        "0.6.12"    NA           
dimRed        "0.1.0"     NA           
dplyr         "0.7.4"     NA           
DRR           "0.0.2"     NA           
e1071         "1.6-8"     NA           
evaluate      "0.10.1"    NA           
foreach       "1.4.3"     NA           
foreign       "0.8-69"    "recommended"
gdata         "2.18.0"    NA           
ggplot2       "2.2.1"     NA           
glue          "1.2.0"     NA           
gower         "0.1.2"     NA           
gplots        "3.0.1"     NA           
gridExtra     "2.3"       NA           
gtable        "0.2.0"     NA           
gtools        "3.5.0"     NA           
highr         "0.6"       NA           
ipred         "0.9-6"     NA           
iterators     "1.0.8"     NA           
kernlab       "0.9-25"    NA           
KernSmooth    "2.23-15"   "recommended"
knitr         "1.17"      NA           
labeling      "0.3"       NA           
lattice       "0.20-35"   "recommended"
lava          "1.5.1"     NA           
lazyeval      "0.2.1"     NA           
lubridate     "1.7.1"     NA           
magrittr      "1.5"       NA           
markdown      "0.8"       NA           
MASS          "7.3-47"    "recommended"
Matrix        "1.2-11"    "recommended"
mgcv          "1.8-22"    "recommended"
mime          "0.5"       NA           
ModelMetrics  "1.1.0"     NA           
munsell       "0.4.3"     NA           
nlme          "3.1-131"   "recommended"
numDeriv      "2016.8-1"  NA           
pbapply       "1.3-3"     NA           
pkgconfig     "2.0.1"     NA           
plogr         "0.1-1"     NA           
              Depends                                                               
anim.plots    NA                                                                    
animation     "R (>= 2.14.0)"                                                       
assertthat    NA                                                                    
BH            NA                                                                    
bindr         NA                                                                    
bindrcpp      NA                                                                    
bitops        NA                                                                    
boot          "R (>= 3.0.0), graphics, stats"                                       
Boruta        "ranger"                                                              
caret         "R (>= 2.10), lattice (>= 0.20), ggplot2"                             
caretEnsemble "R (>= 3.2.0)"                                                        
caTools       "R (>= 2.2.0)"                                                        
class         "R (>= 3.0.0), stats, utils"                                          
cluster       "R (>= 3.0.1)"                                                        
codetools     "R (>= 2.1)"                                                          
colorspace    "R (>= 2.13.0), methods"                                              
curl          "R (>= 3.0.0)"                                                        
CVST          "kernlab,Matrix"                                                      
data.table    "R (>= 3.0.0)"                                                        
ddalpha       "stats, utils, graphics, grDevices, MASS, class, robustbase,\nsfsmisc"
DEoptimR      NA                                                                    
dichromat     "R (>= 2.10), stats"                                                  
digest        "R (>= 2.4.1)"                                                        
dimRed        "R (>= 3.0.0), methods, DRR"                                          
dplyr         "R (>= 3.1.2)"                                                        
DRR           "kernlab, CVST, Matrix"                                               
e1071         NA                                                                    
evaluate      "R (>= 3.0.2)"                                                        
foreach       "R (>= 2.5.0)"                                                        
foreign       "R (>= 3.0.0)"                                                        
gdata         "R (>= 2.3.0)"                                                        
ggplot2       "R (>= 3.1)"                                                          
glue          "R (>= 3.1)"                                                          
gower         NA                                                                    
gplots        "R (>= 3.0)"                                                          
gridExtra     NA                                                                    
gtable        "R (>= 2.14)"                                                         
gtools        "R (>= 2.10)"                                                         
highr         "R (>= 3.0.2)"                                                        
ipred         "R (>= 2.10)"                                                         
iterators     "R (>= 2.5.0), utils"                                                 
kernlab       "R (>= 2.10)"                                                         
KernSmooth    "R (>= 2.5.0), stats"                                                 
knitr         "R (>= 3.1.0)"                                                        
labeling      NA                                                                    
lattice       "R (>= 3.0.0)"                                                        
lava          "R (>= 3.0)"                                                          
lazyeval      "R (>= 3.1.0)"                                                        
lubridate     "methods, R (>= 3.0.0)"                                               
magrittr      NA                                                                    
markdown      "R (>= 2.11.1)"                                                       
MASS          "R (>= 3.1.0), grDevices, graphics, stats, utils"                     
Matrix        "R (>= 3.0.1)"                                                        
mgcv          "R (>= 2.14.0), nlme (>= 3.1-64)"                                     
mime          NA                                                                    
ModelMetrics  "R (>= 3.2.2)"                                                        
munsell       NA                                                                    
nlme          "R (>= 3.0.2)"                                                        
numDeriv      "R (>= 2.11.1)"                                                       
pbapply       "R (>= 3.2.0)"                                                        
pkgconfig     NA                                                                    
plogr         NA                                                                    
              Imports                                                                                                                                             
anim.plots    "animation"                                                                                                                                         
animation     NA                                                                                                                                                  
assertthat    "tools"                                                                                                                                             
BH            NA                                                                                                                                                  
bindr         NA                                                                                                                                                  
bindrcpp      "Rcpp, bindr"                                                                                                                                       
bitops        NA                                                                                                                                                  
boot          NA                                                                                                                                                  
Boruta        NA                                                                                                                                                  
caret         "foreach, methods, plyr, ModelMetrics (>= 1.1.0), nlme,\nreshape2, stats, stats4, utils, grDevices, recipes (>= 0.0.1),\nwithr (>= 2.0.0)"          
caretEnsemble "methods, pbapply, ggplot2, digest, plyr, lattice, gridExtra,\ndata.table, caret"                                                                   
caTools       "bitops"                                                                                                                                            
class         "MASS"                                                                                                                                              
cluster       "graphics, grDevices, stats, utils"                                                                                                                 
codetools     NA                                                                                                                                                  
colorspace    "graphics, grDevices"                                                                                                                               
curl          NA                                                                                                                                                  
CVST          NA                                                                                                                                                  
data.table    "methods"                                                                                                                                           
ddalpha       "Rcpp (>= 0.11.0)"                                                                                                                                  
DEoptimR      "stats"                                                                                                                                             
dichromat     NA                                                                                                                                                  
digest        NA                                                                                                                                                  
dimRed        NA                                                                                                                                                  
dplyr         "assertthat, bindrcpp (>= 0.2), glue (>= 1.1.1), magrittr,\nmethods, pkgconfig, rlang (>= 0.1.2), R6, Rcpp (>= 0.12.7),\ntibble (>= 1.3.1), utils"  
DRR           "stats, methods"                                                                                                                                    
e1071         "graphics, grDevices, class, stats, methods, utils"                                                                                                 
evaluate      "methods, stringr (>= 0.6.2)"                                                                                                                       
foreach       "codetools, utils, iterators"                                                                                                                       
foreign       "methods, utils, stats"                                                                                                                             
gdata         "gtools, stats, methods, utils"                                                                                                                     
ggplot2       "digest, grid, gtable (>= 0.1.1), MASS, plyr (>= 1.7.1),\nreshape2, scales (>= 0.4.1), stats, tibble, lazyeval"                                     
glue          "methods"                                                                                                                                           
gower         NA                                                                                                                                                  
gplots        "gtools, gdata, stats, caTools, KernSmooth"                                                                                                         
gridExtra     "gtable, grid, grDevices, graphics, utils"                                                                                                          
gtable        "grid"                                                                                                                                              
gtools        NA                                                                                                                                                  
highr         NA                                                                                                                                                  
ipred         "rpart (>= 3.1-8), MASS, survival, nnet, class, prodlim"                                                                                            
iterators     NA                                                                                                                                                  
kernlab       "methods, stats, grDevices, graphics"                                                                                                               
KernSmooth    NA                                                                                                                                                  
knitr         "evaluate (>= 0.10), digest, highr, markdown, stringr (>= 0.6),\nyaml, methods, tools"                                                              
labeling      NA                                                                                                                                                  
lattice       "grid, grDevices, graphics, stats, utils"                                                                                                           
lava          "grDevices, graphics, methods, numDeriv, stats, survival, utils"                                                                                    
lazyeval      NA                                                                                                                                                  
lubridate     "stringr, Rcpp (>= 0.11),"                                                                                                                          
magrittr      NA                                                                                                                                                  
markdown      "utils, mime (>= 0.3)"                                                                                                                              
MASS          "methods"                                                                                                                                           
Matrix        "methods, graphics, grid, stats, utils, lattice"                                                                                                    
mgcv          "methods, stats, graphics, Matrix"                                                                                                                  
mime          "tools"                                                                                                                                             
ModelMetrics  "Rcpp"                                                                                                                                              
munsell       "colorspace, methods"                                                                                                                               
nlme          "graphics, stats, utils, lattice"                                                                                                                   
numDeriv      NA                                                                                                                                                  
pbapply       "parallel"                                                                                                                                          
pkgconfig     "utils"                                                                                                                                             
plogr         NA                                                                                                                                                  
              LinkingTo                                            
anim.plots    NA                                                   
animation     NA                                                   
assertthat    NA                                                   
BH            NA                                                   
bindr         NA                                                   
bindrcpp      "Rcpp, plogr"                                        
bitops        NA                                                   
boot          NA                                                   
Boruta        NA                                                   
caret         NA                                                   
caretEnsemble NA                                                   
caTools       NA                                                   
class         NA                                                   
cluster       NA                                                   
codetools     NA                                                   
colorspace    NA                                                   
curl          NA                                                   
CVST          NA                                                   
data.table    NA                                                   
ddalpha       "BH, Rcpp"                                           
DEoptimR      NA                                                   
dichromat     NA                                                   
digest        NA                                                   
dimRed        NA                                                   
dplyr         "Rcpp (>= 0.12.0), BH (>= 1.58.0-1), bindrcpp, plogr"
DRR           NA                                                   
e1071         NA                                                   
evaluate      NA                                                   
foreach       NA                                                   
foreign       NA                                                   
gdata         NA                                                   
ggplot2       NA                                                   
glue          NA                                                   
gower         NA                                                   
gplots        NA                                                   
gridExtra     NA                                                   
gtable        NA                                                   
gtools        NA                                                   
highr         NA                                                   
ipred         NA                                                   
iterators     NA                                                   
kernlab       NA                                                   
KernSmooth    NA                                                   
knitr         NA                                                   
labeling      NA                                                   
lattice       NA                                                   
lava          NA                                                   
lazyeval      NA                                                   
lubridate     "Rcpp,"                                              
magrittr      NA                                                   
markdown      NA                                                   
MASS          NA                                                   
Matrix        NA                                                   
mgcv          NA                                                   
mime          NA                                                   
ModelMetrics  "Rcpp"                                               
munsell       NA                                                   
nlme          NA                                                   
numDeriv      NA                                                   
pbapply       NA                                                   
pkgconfig     NA                                                   
plogr         NA                                                   
              Suggests                                                                                                                                                                                                                                                     
anim.plots    "maps, knitr, mapdata, testthat"                                                                                                                                                                                                                             
animation     "MASS, class, testit"                                                                                                                                                                                                                                        
assertthat    "testthat"                                                                                                                                                                                                                                                   
BH            NA                                                                                                                                                                                                                                                           
bindr         "testthat"                                                                                                                                                                                                                                                   
bindrcpp      "testthat"                                                                                                                                                                                                                                                   
bitops        NA                                                                                                                                                                                                                                                           
boot          "MASS, survival"                                                                                                                                                                                                                                             
Boruta        "mlbench, rFerns, randomForest"                                                                                                                                                                                                                              
caret         "BradleyTerry2, e1071, earth (>= 2.2-3), fastICA, gam, ipred,\nkernlab, klaR, MASS, ellipse, mda, mgcv, mlbench, MLmetrics,\nnnet, party (>= 0.9-99992), pls, pROC, proxy, randomForest,\nRANN, spls, subselect, pamr, superpc, Cubist, testthat (>=\n0.9.1)"
caretEnsemble "caTools, testthat, lintr, randomForest, glmnet, rpart,\nkernlab, nnet, e1071, ipred, pROC, knitr, mlbench, MASS, gbm,\nklaR"                                                                                                                                
caTools       "MASS, rpart"                                                                                                                                                                                                                                                
class         NA                                                                                                                                                                                                                                                           
cluster       "MASS"                                                                                                                                                                                                                                                       
codetools     NA                                                                                                                                                                                                                                                           
colorspace    "datasets, stats, utils, KernSmooth, MASS, kernlab, mvtnorm,\nvcd, dichromat, tcltk, shiny, shinyjs"                                                                                                                                                         
curl          "testthat (>= 1.0.0), knitr, jsonlite, rmarkdown, magrittr,\nhttpuv, webutils"                                                                                                                                                                               
CVST          NA                                                                                                                                                                                                                                                           
data.table    "bit64, knitr, nanotime, chron, ggplot2 (>= 0.9.0), plyr,\nreshape, reshape2, testthat (>= 0.4), hexbin, fastmatch, nlme,\nxts, gdata, GenomicRanges, caret, curl, zoo, plm, rmarkdown,\nparallel"                                                           
ddalpha       NA                                                                                                                                                                                                                                                           
DEoptimR      NA                                                                                                                                                                                                                                                           
dichromat     NA                                                                                                                                                                                                                                                           
digest        "knitr, rmarkdown"                                                                                                                                                                                                                                           
dimRed        "MASS, Matrix, RANN, RSpectra, Rtsne, coRanking, diffusionMap,\nenergy, fastICA, ggplot2, graphics, igraph, kernlab, lle, loe,\noptimx, pcaPP, rgl, scales, scatterplot3d, stats, testthat,\ntidyr, vegan"                                                   
dplyr         "bit64, covr, dbplyr, dtplyr, DBI, ggplot2, hms, knitr, Lahman\n(>= 3.0-1), mgcv, microbenchmark, nycflights13, rmarkdown,\nRMySQL, RPostgreSQL, RSQLite, testthat, withr"                                                                                   
DRR           "knitr"                                                                                                                                                                                                                                                      
e1071         "cluster, mlbench, nnet, randomForest, rpart, SparseM, xtable,\nMatrix, MASS"                                                                                                                                                                                
evaluate      "testthat, lattice, ggplot2"                                                                                                                                                                                                                                 
foreach       "randomForest"                                                                                                                                                                                                                                               
foreign       NA                                                                                                                                                                                                                                                           
gdata         "RUnit"                                                                                                                                                                                                                                                      
ggplot2       "covr, ggplot2movies, hexbin, Hmisc, lattice, mapproj, maps,\nmaptools, mgcv, multcomp, nlme, testthat (>= 0.11.0), quantreg,\nknitr, rpart, rmarkdown, svglite"                                                                                             
glue          "testthat, covr, magrittr, crayon, knitr, rmarkdown, DBI,\nRSQLite, R.utils, forcats, microbenchmark, rprintf, stringr,\nggplot2"                                                                                                                            
gower         "testthat, knitr, rmarkdown"                                                                                                                                                                                                                                 
gplots        "grid, MASS"                                                                                                                                                                                                                                                 
gridExtra     "ggplot2, egg, lattice, knitr, testthat"                                                                                                                                                                                                                     
gtable        "testthat, covr"                                                                                                                                                                                                                                             
gtools        NA                                                                                                                                                                                                                                                           
highr         "knitr, testit"                                                                                                                                                                                                                                              
ipred         "mvtnorm, mlbench, TH.data"                                                                                                                                                                                                                                  
iterators     "RUnit"                                                                                                                                                                                                                                                      
kernlab       NA                                                                                                                                                                                                                                                           
KernSmooth    "MASS"                                                                                                                                                                                                                                                       
knitr         "formatR, testit, rgl (>= 0.95.1201), codetools, rmarkdown,\nhtmlwidgets (>= 0.7), webshot, tikzDevice (>= 0.10), png, jpeg,\nXML, RCurl, DBI (>= 0.4-1), tibble"                                                                                            
labeling      NA                                                                                                                                                                                                                                                           
lattice       "KernSmooth, MASS, latticeExtra"                                                                                                                                                                                                                             
lava          "KernSmooth, Matrix, Rgraphviz, ascii, data.table, fields,\nforeach, geepack, gof (>= 0.9), graph, igraph (>= 0.6),\nlava.tobit, lme4, mets (>= 1.1), optimx, quantreg, rgl,\ntestthat (>= 0.11), visNetwork, zoo"                                           
lazyeval      "knitr, rmarkdown (>= 0.2.65), testthat, covr"                                                                                                                                                                                                               
lubridate     "testthat, knitr, covr"                                                                                                                                                                                                                                      
magrittr      "testthat, knitr"                                                                                                                                                                                                                                            
markdown      "knitr, RCurl"                                                                                                                                                                                                                                               
MASS          "lattice, nlme, nnet, survival"                                                                                                                                                                                                                              
Matrix        "expm, MASS"                                                                                                                                                                                                                                                 
mgcv          "splines, parallel, survival, MASS"                                                                                                                                                                                                                          
mime          NA                                                                                                                                                                                                                                                           
ModelMetrics  "testthat"                                                                                                                                                                                                                                                   
munsell       "ggplot2, testthat"                                                                                                                                                                                                                                          
nlme          "Hmisc, MASS"                                                                                                                                                                                                                                                
numDeriv      NA                                                                                                                                                                                                                                                           
pbapply       NA                                                                                                                                                                                                                                                           
pkgconfig     "covr, testthat, disposables (>= 1.0.3)"                                                                                                                                                                                                                     
plogr         "Rcpp"                                                                                                                                                                                                                                                       
              Enhances                                                  
anim.plots    NA                                                        
animation     NA                                                        
assertthat    NA                                                        
BH            NA                                                        
bindr         NA                                                        
bindrcpp      NA                                                        
bitops        NA                                                        
boot          NA                                                        
Boruta        NA                                                        
caret         NA                                                        
caretEnsemble NA                                                        
caTools       NA                                                        
class         NA                                                        
cluster       NA                                                        
codetools     NA                                                        
colorspace    NA                                                        
curl          NA                                                        
CVST          NA                                                        
data.table    NA                                                        
ddalpha       NA                                                        
DEoptimR      "robustbase"                                              
dichromat     NA                                                        
digest        NA                                                        
dimRed        NA                                                        
dplyr         NA                                                        
DRR           NA                                                        
e1071         NA                                                        
evaluate      NA                                                        
foreach       "compiler, doMC, RUnit, doParallel"                       
foreign       NA                                                        
gdata         NA                                                        
ggplot2       "sp"                                                      
glue          NA                                                        
gower         NA                                                        
gplots        NA                                                        
gridExtra     NA                                                        
gtable        NA                                                        
gtools        NA                                                        
highr         NA                                                        
ipred         NA                                                        
iterators     NA                                                        
kernlab       NA                                                        
KernSmooth    NA                                                        
knitr         NA                                                        
labeling      NA                                                        
lattice       "chron"                                                   
lava          NA                                                        
lazyeval      NA                                                        
lubridate     "chron, fts, timeSeries, timeDate, tis, tseries, xts, zoo"
magrittr      NA                                                        
markdown      NA                                                        
MASS          NA                                                        
Matrix        "MatrixModels, graph, SparseM, sfsmisc"                   
mgcv          NA                                                        
mime          NA                                                        
ModelMetrics  NA                                                        
munsell       NA                                                        
nlme          NA                                                        
numDeriv      NA                                                        
pbapply       NA                                                        
pkgconfig     NA                                                        
plogr         NA                                                        
              License                         
anim.plots    "GPL-2"                         
animation     "GPL"                           
assertthat    "GPL-3"                         
BH            "BSL-1.0"                       
bindr         "MIT + file LICENSE"            
bindrcpp      "MIT + file LICENSE"            
bitops        "GPL (>= 2)"                    
boot          "Unlimited"                     
Boruta        "GPL (>= 2)"                    
caret         "GPL (>= 2)"                    
caretEnsemble "MIT + file LICENSE"            
caTools       "GPL-3"                         
class         "GPL-2 | GPL-3"                 
cluster       "GPL (>= 2)"                    
codetools     "GPL"                           
colorspace    "BSD_3_clause + file LICENSE"   
curl          "MIT + file LICENSE"            
CVST          "GPL (>= 2.0)"                  
data.table    "GPL-3 | file LICENSE"          
ddalpha       "GPL-2"                         
DEoptimR      "GPL (>= 2)"                    
dichromat     "GPL-2"                         
digest        "GPL (>= 2)"                    
dimRed        "GPL-3 | file LICENSE"          
dplyr         "MIT + file LICENSE"            
DRR           "GPL-3"                         
e1071         "GPL-2"                         
evaluate      "MIT + file LICENSE"            
foreach       "Apache License (== 2.0)"       
foreign       "GPL (>= 2)"                    
gdata         "GPL-2"                         
ggplot2       "GPL-2 | file LICENSE"          
glue          "MIT + file LICENSE"            
gower         "GPL-3"                         
gplots        "GPL-2"                         
gridExtra     "GPL (>= 2)"                    
gtable        "GPL-2"                         
gtools        "GPL-2"                         
highr         "GPL"                           
ipred         "GPL (>= 2)"                    
iterators     "Apache License (== 2.0)"       
kernlab       "GPL-2"                         
KernSmooth    "Unlimited"                     
knitr         "GPL"                           
labeling      "MIT + file LICENSE | Unlimited"
lattice       "GPL (>= 2)"                    
lava          "GPL-3"                         
lazyeval      "GPL-3"                         
lubridate     "GPL-2"                         
magrittr      "MIT + file LICENSE"            
markdown      "GPL-2"                         
MASS          "GPL-2 | GPL-3"                 
Matrix        "GPL (>= 2) | file LICENCE"     
mgcv          "GPL (>= 2)"                    
mime          "GPL"                           
ModelMetrics  "GPL (>= 2)"                    
munsell       "MIT + file LICENSE"            
nlme          "GPL (>= 2) | file LICENCE"     
numDeriv      "GPL-2"                         
pbapply       "GPL-2"                         
pkgconfig     "MIT + file LICENSE"            
plogr         "MIT + file LICENSE"            
              License_is_FOSS
anim.plots    NA             
animation     NA             
assertthat    NA             
BH            NA             
bindr         NA             
bindrcpp      NA             
bitops        NA             
boot          NA             
Boruta        NA             
caret         NA             
caretEnsemble NA             
caTools       NA             
class         NA             
cluster       NA             
codetools     NA             
colorspace    NA             
curl          NA             
CVST          NA             
data.table    NA             
ddalpha       NA             
DEoptimR      NA             
dichromat     NA             
digest        NA             
dimRed        NA             
dplyr         NA             
DRR           NA             
e1071         NA             
evaluate      NA             
foreach       NA             
foreign       NA             
gdata         NA             
ggplot2       NA             
glue          NA             
gower         NA             
gplots        NA             
gridExtra     NA             
gtable        NA             
gtools        NA             
highr         NA             
ipred         NA             
iterators     NA             
kernlab       NA             
KernSmooth    NA             
knitr         NA             
labeling      NA             
lattice       NA             
lava          NA             
lazyeval      NA             
lubridate     NA             
magrittr      NA             
markdown      NA             
MASS          NA             
Matrix        NA             
mgcv          NA             
mime          NA             
ModelMetrics  NA             
munsell       NA             
nlme          NA             
numDeriv      NA             
pbapply       NA             
pkgconfig     NA             
plogr         NA             
              License_restricts_use OS_type
anim.plots    NA                    NA     
animation     NA                    NA     
assertthat    NA                    NA     
BH            NA                    NA     
bindr         NA                    NA     
bindrcpp      NA                    NA     
bitops        NA                    NA     
boot          NA                    NA     
Boruta        NA                    NA     
caret         NA                    NA     
caretEnsemble NA                    NA     
caTools       NA                    NA     
class         NA                    NA     
cluster       NA                    NA     
codetools     NA                    NA     
colorspace    NA                    NA     
curl          NA                    NA     
CVST          NA                    NA     
data.table    NA                    NA     
ddalpha       NA                    NA     
DEoptimR      NA                    NA     
dichromat     NA                    NA     
digest        NA                    NA     
dimRed        NA                    NA     
dplyr         NA                    NA     
DRR           NA                    NA     
e1071         NA                    NA     
evaluate      NA                    NA     
foreach       NA                    NA     
foreign       NA                    NA     
gdata         NA                    NA     
ggplot2       NA                    NA     
glue          NA                    NA     
gower         NA                    NA     
gplots        NA                    NA     
gridExtra     NA                    NA     
gtable        NA                    NA     
gtools        NA                    NA     
highr         NA                    NA     
ipred         NA                    NA     
iterators     NA                    NA     
kernlab       NA                    NA     
KernSmooth    NA                    NA     
knitr         NA                    NA     
labeling      NA                    NA     
lattice       NA                    NA     
lava          NA                    NA     
lazyeval      NA                    NA     
lubridate     NA                    NA     
magrittr      NA                    NA     
markdown      NA                    NA     
MASS          NA                    NA     
Matrix        NA                    NA     
mgcv          NA                    NA     
mime          NA                    NA     
ModelMetrics  NA                    NA     
munsell       NA                    NA     
nlme          NA                    NA     
numDeriv      NA                    NA     
pbapply       NA                    NA     
pkgconfig     NA                    NA     
plogr         NA                    NA     
              MD5sum NeedsCompilation Built  
anim.plots    NA     "no"             "3.4.1"
animation     NA     "no"             "3.4.1"
assertthat    NA     "no"             "3.4.1"
BH            NA     "no"             "3.4.1"
bindr         NA     "no"             "3.4.1"
bindrcpp      NA     "yes"            "3.4.1"
bitops        NA     "yes"            "3.4.1"
boot          NA     "no"             "3.4.1"
Boruta        NA     "no"             "3.4.1"
caret         NA     "yes"            "3.4.1"
caretEnsemble NA     "no"             "3.4.1"
caTools       NA     "yes"            "3.4.1"
class         NA     "yes"            "3.4.1"
cluster       NA     "yes"            "3.4.1"
codetools     NA     "no"             "3.4.1"
colorspace    NA     "yes"            "3.4.1"
curl          NA     "yes"            "3.4.1"
CVST          NA     "no"             "3.4.1"
data.table    NA     "yes"            "3.4.1"
ddalpha       NA     "yes"            "3.4.1"
DEoptimR      NA     "no"             "3.4.1"
dichromat     NA     NA               "3.4.1"
digest        NA     "yes"            "3.4.1"
dimRed        NA     "yes"            "3.4.1"
dplyr         NA     "yes"            "3.4.1"
DRR           NA     "no"             "3.4.1"
e1071         NA     "yes"            "3.4.1"
evaluate      NA     "no"             "3.4.1"
foreach       NA     "no"             "3.4.1"
foreign       NA     "yes"            "3.4.1"
gdata         NA     "no"             "3.4.1"
ggplot2       NA     "no"             "3.4.1"
glue          NA     "yes"            "3.4.1"
gower         NA     "yes"            "3.4.1"
gplots        NA     "no"             "3.4.1"
gridExtra     NA     "no"             "3.4.1"
gtable        NA     "no"             "3.4.1"
gtools        NA     "yes"            "3.4.1"
highr         NA     "no"             "3.4.1"
ipred         NA     "yes"            "3.4.1"
iterators     NA     "no"             "3.4.1"
kernlab       NA     "yes"            "3.4.1"
KernSmooth    NA     "yes"            "3.4.1"
knitr         NA     "no"             "3.4.1"
labeling      NA     "no"             "3.4.1"
lattice       NA     "yes"            "3.4.1"
lava          NA     "no"             "3.4.1"
lazyeval      NA     "yes"            "3.4.1"
lubridate     NA     "yes"            "3.4.1"
magrittr      NA     "no"             "3.4.1"
markdown      NA     "yes"            "3.4.1"
MASS          NA     "yes"            "3.4.1"
Matrix        NA     "yes"            "3.4.1"
mgcv          NA     "yes"            "3.4.1"
mime          NA     "yes"            "3.4.1"
ModelMetrics  NA     "yes"            "3.4.1"
munsell       NA     "no"             "3.4.1"
nlme          NA     "yes"            "3.4.1"
numDeriv      NA     "no"             "3.4.1"
pbapply       NA     "no"             "3.4.1"
pkgconfig     NA     "no"             "3.4.1"
plogr         NA     "no"             "3.4.1"
 [ reached getOption("max.print") -- omitted 61 rows ]

2017년 6월 30일 금요일

ppc64le Ubuntu에서 CRAN의 R 서버 및 package 설치, 그리고 rstudio 설치

CRAN (Comprehensive R Archive Network, https://cran.r-project.org )은 R 관련된 소스와 패키지, 문서 등을 모아 놓은 site입니다.  지난 번에는 MS-R의 source를 받아서 ppc64le에서 build한 바 있습니다만, 이번에는 이 CRAN site에서 받은 source로 역시 ppc64le에서 build 해보겠습니다.   NVLink P100이 장착된 IBM Minsky에서는 이 R 및 rstudio를 함께 사용하는 경우가 많습니다.

먼저 Ubuntu OS에서 필요 package들을 설치합니다.

u0017496@sys-87925:~/R-3.4.0$ sudo apt-get install libreadline-dev readline-common libx11-dev libxt-dev libbz2-dev liblzma-dev libpcre2-dev libpcre3-dev  libcurl4-gnutls-dev gfortran-5-powerpc-linux-gnu texlive-latex-base texinfo texlive-fonts-extra openjdk-8-jdk openjdk-8-jdk-headless

이어서 CRAN site에서 가장 최신의 안정적인 버전을 download 받습니다.

u0017496@sys-87925:~$ wget https://cran.r-project.org/src/base/R-3/R-3.4.0.tar.gz
--2017-06-29 22:28:51--  https://cran.r-project.org/src/base/R-3/R-3.4.0.tar.gz
Resolving cran.r-project.org (cran.r-project.org)... 137.208.57.37
Connecting to cran.r-project.org (cran.r-project.org)|137.208.57.37|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 30175855 (29M) [application/x-gzip]
Saving to: ‘R-3.4.0.tar.gz’

R-3.4.0.tar.gz                   100%[=======================================================>]  28.78M  1.05MB/s    in 20s

2017-06-29 22:29:13 (1.43 MB/s) - ‘R-3.4.0.tar.gz’ saved [30175855/30175855]

u0017496@sys-87925:~$ tar -zxvf R-3.4.0.tar.gz

u0017496@sys-87925:~$ cd R-3.4.0

이제 configure를 돌립니다.  아무 option 없이 그냥 해도 됩니다만, 나중에 r-studio를 쓰고자 한다면 여기서 '--enable-R-shlib' option을 꼭 붙여야 합니다.

u0017496@sys-87925:~/R-3.4.0$ ./configure --enable-R-shlib
...
R is now configured for powerpc64le-unknown-linux-gnu

  Source directory:          .
  Installation directory:    /usr/local

  C compiler:                gcc  -g -O2
  Fortran 77 compiler:       gfortran  -g -O2

  Default C++ compiler:      g++   -g -O2
  C++98 compiler:            g++ -std=gnu++98 -g -O2
  C++11 compiler:            g++ -std=gnu++11 -g -O2
  C++14 compiler:            g++  -g -O2
  C++17 compiler:
  Fortran 90/95 compiler:    gfortran -g -O2
  Obj-C compiler:

  Interfaces supported:      X11
  External libraries:        readline, curl
  Additional capabilities:   NLS
  Options enabled:           shared BLAS, R profiling

  Capabilities skipped:      PNG, JPEG, TIFF, cairo, ICU
  Options not enabled:       memory profiling

  Recommended packages:      yes

이제 make를 수행합니다.   CPU가 느리다면 시간이 꽤 오래 걸립니다.

u0017496@sys-87925:~/R-3.4.0$ make
...
building/updating vignettes for package 'grid' ...
building/updating vignettes for package 'parallel' ...
building/updating vignettes for package 'utils' ...
make[1]: Leaving directory '/home/u0017496/R-3.4.0/src/library'
make[1]: Entering directory '/home/u0017496/R-3.4.0'
configuring Java ...
Java interpreter : /usr/bin/java
Java version     : 1.8.0_131
Java home path   : /usr/lib/jvm/java-8-openjdk-ppc64el/jre
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar

trying to compile and link a JNI program
detected JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/ppc64le/server -ljvm
make[2]: Entering directory '/tmp/Rjavareconf.1ALuwL'
gcc -I/home/u0017496/R-3.4.0/include -DNDEBUG -I/usr/lib/jvm/java-8-openjdk-ppc64el/jre/../include -I/usr/lib/jvm/java-8-openjdk-ppc64el/jre/../include/linux  -I/usr/local/include   -fPIC  -g -O2  -c conftest.c -o conftest.o
gcc -shared -L/home/u0017496/R-3.4.0/lib -L/usr/local/lib -o conftest.so conftest.o -L/usr/lib/jvm/java-8-openjdk-ppc64el/jre/lib/ppc64le/server -ljvm -L/home/u0017496/R-3.4.0/lib -lR
make[2]: Leaving directory '/tmp/Rjavareconf.1ALuwL'


JAVA_HOME        : /usr/lib/jvm/java-8-openjdk-ppc64el/jre
Java library path: $(JAVA_HOME)/lib/ppc64le/server
JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/ppc64le/server -ljvm
Updating Java configuration in /home/u0017496/R-3.4.0
Done.

make[1]: Leaving directory '/home/u0017496/R-3.4.0'

make install 하면 기본값인 /usr/local/lib/R 밑으로 설치됩니다.

u0017496@sys-87925:~/R-3.4.0$ sudo make install
...
make[3]: Leaving directory '/home/u0017496/R-3.4.0/src/modules/internet'
make[3]: Entering directory '/home/u0017496/R-3.4.0/src/modules/lapack'
/usr/local/lib/R/lib/libRlapack.so is unchanged
make[3]: Leaving directory '/home/u0017496/R-3.4.0/src/modules/lapack'
make[3]: Entering directory '/home/u0017496/R-3.4.0/src/modules/X11'
/usr/local/lib/R/modules/R_de.so is unchanged
make[3]: Leaving directory '/home/u0017496/R-3.4.0/src/modules/X11'
make[2]: Leaving directory '/home/u0017496/R-3.4.0/src/modules'
make[2]: Entering directory '/home/u0017496/R-3.4.0/src/library'
installing packages ...
  building HTML index ...
make[2]: Leaving directory '/home/u0017496/R-3.4.0/src/library'
make[1]: Leaving directory '/home/u0017496/R-3.4.0/src'
make[1]: Entering directory '/home/u0017496/R-3.4.0/tests'
make[1]: Nothing to be done for 'install'.
make[1]: Leaving directory '/home/u0017496/R-3.4.0/tests'

아래와 같이 별도로 PATH 지정을 해주지 않아도 /usr/local/bin/R을 쓸 수 있는데, 이는 /usr/local/lib/R/bin/R과 동일한 copy를 저기에도 설치하기 때문입니다.

u0017496@sys-87925:~/R-3.4.0$ which R
/usr/local/bin/R

u0017496@sys-87925:~/rstudio/build$ ls -ll /usr/local/lib/R/bin/R
-rwxr-xr-x 1 root root 8770 Jun 30 04:04 /usr/local/lib/R/bin/R
u0017496@sys-87925:~/rstudio/build$ ls -l /usr/local/bin/R
-rwxr-xr-x 1 root root 8770 Jun 30 04:04 /usr/local/bin/R

이제 R을 구동해 봅니다.  버전 3.4.0임을 보실 수 있습니다.

u0017496@sys-87925:~/R-3.4.0$ R

R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: powerpc64le-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

CRAN site로터  knitr package를 설치해 봅니다.

> install.packages("knitr")
--- Please select a CRAN mirror for use in this session ---
Secure CRAN mirrors

 1: 0-Cloud [https]                 2: Algeria [https]
 3: Australia (Canberra) [https]    4: Australia (Melbourne) [https]
 5: Australia (Perth) [https]       6: Austria [https]
 7: Belgium (Ghent) [https]         8: Brazil (RJ) [https]
 9: Brazil (SP 1) [https]          10: Bulgaria [https]
11: Chile 1 [https]                12: China (Lanzhou) [https]
13: Colombia (Cali) [https]        14: Czech Republic [https]
15: Denmark [https]                16: Estonia [https]
17: France (Lyon 1) [https]        18: France (Lyon 2) [https]
19: France (Marseille) [https]     20: France (Montpellier) [https]
21: France (Paris 2) [https]       22: Germany (Göttingen) [https]
23: Germany (Münster) [https]      24: Greece [https]
25: Iceland [https]                26: Indonesia (Jakarta) [https]
27: Ireland [https]                28: Italy (Padua) [https]
29: Japan (Tokyo) [https]          30: Malaysia [https]
31: Mexico (Mexico City) [https]   32: Norway [https]
33: Philippines [https]            34: Russia (Moscow) [https]
35: Serbia [https]                 36: Spain (A Coruña) [https]
37: Spain (Madrid) [https]         38: Sweden [https]
39: Switzerland [https]            40: Turkey (Denizli) [https]
41: Turkey (Mersin) [https]        42: UK (Bristol) [https]
43: UK (Cambridge) [https]         44: UK (London 1) [https]
45: USA (CA 1) [https]             46: USA (IA) [https]
47: USA (KS) [https]               48: USA (MI 1) [https]
49: USA (OR) [https]               50: USA (TN) [https]
51: USA (TX 1) [https]             52: Vietnam [https]
53: (other mirrors)
...
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (knitr)

The downloaded source packages are in
        ‘/tmp/RtmpFb3FLc/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done


잘 되는 것을 보실 수 있습니다.   하나 더 해보지요.  anim.plots을 설치해 보겠습니다.

> install.packages("anim.plots")
also installing the dependency ‘animation’

trying URL 'https://cran.revolutionanalytics.com/src/contrib/animation_2.5.tar.gz'
Content type 'application/octet-stream' length 299340 bytes (292 KB)
==================================================
downloaded 292 KB

trying URL 'https://cran.revolutionanalytics.com/src/contrib/anim.plots_0.2.tar.gz'
Content type 'application/octet-stream' length 610350 bytes (596 KB)
==================================================
downloaded 596 KB

* installing *source* package ‘animation’ ...
** package ‘animation’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (animation)
* installing *source* package ‘anim.plots’ ...
** package ‘anim.plots’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (anim.plots)

The downloaded source packages are in
        ‘/tmp/RtmpFb3FLc/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

역시 잘 됩니다.  이제 r-studio를 설치해 보겠습니다.   먼저 github에서 source를 받습니다.

u0017496@sys-87925:~$ git clone https://github.com/rstudio/rstudio.git

먼저 dependencies 관련 항목을 설치합니다.  아래와 같이 install-dependencies-debian 명령을 수행하면 됩니다.

u0017496@sys-87925:~$ cd rstudio/dependencies/linux

u0017496@sys-87925:~/rstudio/dependencies/linux$ ls
install-boost  install-dependencies-debian  install-dependencies-yum  install-dependencies-zypper  install-qt-sdk  README

u0017496@sys-87925:~/rstudio/dependencies/linux$ ./install-dependencies-debian
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libxlmass-devel.8.1.5 libxlsmp libxlsmp-devel.4.1.5 xlc-license-community.13.1.5 xlf-license-community.15.1.5
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  dpkg-dev fakeroot libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl libfakeroot
  libfile-fcntllock-perl
Suggested packages:
...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
--2017-06-30 02:40:01--  https://s3.amazonaws.com/rstudio-buildtools/QtSDK-5.4.2-x86_64.tar.gz
Resolving s3.amazonaws.com (s3.amazonaws.com)... 54.231.81.19
Connecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.81.19|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 65843419 (63M) [application/x-tar]
Saving to: ‘/tmp/QtSDK-5.4.2-x86_64.tar.gz’

/tmp/QtSDK-5.4.2-x86_64.tar.gz   100%[========================================================>]  62.79M  7.90MB/s    in 8.0s

2017-06-30 02:40:10 (7.82 MB/s) - ‘/tmp/QtSDK-5.4.2-x86_64.tar.gz’ saved [65843419/65843419]

이어서 common 항목을 설치합니다.

u0017496@sys-87925:~/rstudio/dependencies/linux$ cd ../common

u0017496@sys-87925:~/rstudio/dependencies/common$ ./install-common
gin-1.5.zip already installed
gwt-2.7.0.zip already installed
junit-4.9b3.jar already installed
selenium-java-2.37.0.zip already installed
selenium-server-standalone-2.37.0.jar already installed
ChromeDriver binaries already installed
Dictionaries already installed
Mathjax already installed
1.63.0 already installed in /opt/rstudio-tools/boost/boost_1_63_0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12.0M  100 12.0M    0     0  7067k      0  0:00:01  0:00:01 --:--:-- 7070k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10.6M  100 10.6M    0     0  4887k      0  0:00:02  0:00:02 --:--:-- 4888k
libclang 3.5 already installed
libclang headers already installed
Already up-to-date.
Already on 'master'
Your branch is up-to-date with 'origin/master'.
* checking for file ‘rsconnect/DESCRIPTION’ ... OK
* preparing ‘rsconnect’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
Removed empty directory ‘rsconnect/examples’
* building ‘rsconnect_0.8.3.tar.gz’

이제 비로소 cmake를 돌릴 준비가 되었습니다.  TYPE는 Release로, TARGET은 Server로 해서 rstudio를 build 합니다.

u0017496@sys-87925:~/rstudio/dependencies/common$ cd ../..

u0017496@sys-87925:~/rstudio$ mkdir build
u0017496@sys-87925:~/rstudio$ cd build

u0017496@sys-87925:~/rstudio/build$ cmake .. -DRSTUDIO_TARGET=Server -DCMAKE_BUILD_TYPE=Release
...
-- Looking for setresuid
-- Looking for setresuid - found
-- Performing Test PAM_MESSAGE_CONST
-- Performing Test PAM_MESSAGE_CONST - Success
-- Found PAM: /usr/lib/powerpc64le-linux-gnu/libpam.so;/usr/lib/powerpc64le-linux-gnu/libdl.so
-- Found LibR: /usr/local/lib/R
-- Found R: /usr/local/lib/R
-- Performing Test LIBR_MINIMUM_VERSION
-- Performing Test LIBR_MINIMUM_VERSION - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/u0017496/rstudio/build

이제 make를 수행합니다.  매우 오래 걸립니다.

u0017496@sys-87925:~/rstudio/build$ make
Scanning dependencies of target gwt_build
Buildfile: /home/u0017496/rstudio/src/gwt/build.xml

ext:
   [jscomp] Compiling 54 file(s) with 41 extern(s)

javac:
    [mkdir] Created dir: /home/u0017496/rstudio/src/gwt/bin
    [javac] Compiling 10 source files to /home/u0017496/rstudio/src/gwt/bin
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Compiling 2067 source files to /home/u0017496/rstudio/src/gwt/bin
...
[ 99%] Building CXX object src/cpp/server/CMakeFiles/rserver.dir/ServerAddins.cpp.o
[ 99%] Linking CXX executable rserver
[ 99%] Built target rserver
Scanning dependencies of target rserver-pam
[ 99%] Building CXX object src/cpp/server/pam/CMakeFiles/rserver-pam.dir/PamMain.cpp.o
[100%] Linking CXX executable rserver-pam
[100%] Built target rserver-pam

이제 make install로 설치합니다.  기본인 /usr/local/lib/rstudio-server으로 들어갑니다.

u0017496@sys-87925:~/rstudio/build$ sudo make install
Buildfile: /home/u0017496/rstudio/src/gwt/build.xml

ext:
   [jscomp] None of the files changed. Compilation skipped.

javac:
    [javac] Compiling 1 source file to /home/u0017496/rstudio/src/gwt/bin

gwtc:
     [java] Jun 30, 2017 4:55:11 AM java.util.prefs.FileSystemPreferences$1 run
     [java] INFO: Created user preferences directory.
     [java] Compiling module org.rstudio.studio.RStudio
...
-- Installing: /usr/local/lib/rstudio-server/bin/rserver
-- Installing: /usr/local/lib/rstudio-server/bin/rstudio-server
-- Installing: /usr/local/lib/rstudio-server/extras/init.d/debian/rstudio-server
-- Installing: /usr/local/lib/rstudio-server/extras/init.d/redhat/rstudio-server
-- Installing: /usr/local/lib/rstudio-server/extras/init.d/suse/rstudio-server
-- Installing: /usr/local/lib/rstudio-server/extras/pam/rstudio
-- Installing: /usr/local/lib/rstudio-server/extras/apparmor/rstudio-server
-- Installing: /usr/local/lib/rstudio-server/extras/apparmor/apparmor-profile-load
-- Installing: /usr/local/lib/rstudio-server/extras/upstart/rstudio-server.conf
-- Installing: /usr/local/lib/rstudio-server/extras/upstart/rstudio-server.redhat.conf
-- Installing: /usr/local/lib/rstudio-server/extras/systemd/rstudio-server.service
-- Installing: /usr/local/lib/rstudio-server/extras/systemd/rstudio-server.redhat.service
-- Installing: /usr/local/lib/rstudio-server/bin/rserver-pam

이제 rstudio-server를 아래아 같이 서비스로 등록해줍니다.

u0017496@sys-87925:~/rstudio/build$ sudo cp /usr/local/lib/rstudio-server/extras/init.d/debian/rstudio-server /etc/init.d/rstudio-server

u0017496@sys-87925:~/rstudio/build$ sudo update-rc.d rstudio-server defaults

u0017496@sys-87925:~/rstudio/build$ sudo ln -f -s /usr/local/lib/rstudio-server/bin/rstudio-server /usr/sbin/rstudio-server

이제 systemctl로 rstudio-server 서비스를 구동하고, status를 확인합니다.

u0017496@sys-87925:~/rstudio/build$ sudo systemctl start rstudio-server.service

u0017496@sys-87925:~/rstudio/build$ sudo systemctl status rstudio-server.service
● rstudio-server.service - LSB: RStudio Server
   Loaded: loaded (/etc/init.d/rstudio-server; bad; vendor preset: enabled)
   Active: active (running) since Fri 2017-06-30 05:09:49 EDT; 14s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 11585 ExecStart=/etc/init.d/rstudio-server start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/rstudio-server.service
           └─11593 /usr/local/lib/rstudio-server/bin/rserver

Jun 30 05:09:49 sys-87925 systemd[1]: Starting LSB: RStudio Server...
Jun 30 05:09:49 sys-87925 systemd[1]: Started LSB: RStudio Server.

이제 http://서버주소:8787 로 web browser를 통해 접근할 수 있습니다.   user id와 passwd는 OS user의 것을 그대로 쓰면 됩니다.



역시 plot(mtcars)를 수행해 봅니다.  아래 그림의 왼쪽 command 창을 보시면 plot 명령에서 한번 error가 난 것을 볼 수 있는데, 이는 우측의 plot 창이 너무 좁게 되어 있어서 그렇습니다.  그 창을 마우스로 넓게 키워주면 잘 되는 것을 보실 수 있습니다.