无法在Ubuntu 18.04 LTS上安装rstanarm [英] Not able to install rstanarm on Ubuntu 18.04 LTS

查看:83
本文介绍了无法在Ubuntu 18.04 LTS上安装rstanarm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在 Ubuntu 18.04 LTS 上运行的 R 3.5.3 上安装 rstanarm .我使用了以下命令:

I'm not able to install rstanarm on R 3.5.3 running on Ubuntu 18.04 LTS. I used the following commands:

install.packages("rstanarm")

devtools::install_github("stan-dev/rstanarm", build_vignettes = FALSE)

都抛出以下错误:

Execution halted
Makevars:17: recipe for target 'stan_files/lm.cc' failed
make: *** [stan_files/lm.cc] Error 1
ERROR: compilation failed for package ‘rstanarm’

sessionInfo

sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] usethis_1.5.0  devtools_2.0.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1        ps_1.3.0          prettyunits_1.0.2 rprojroot_1.3-2  
 [5] digest_0.6.18     crayon_1.3.4      withr_2.1.2       assertthat_0.2.1 
 [9] R6_2.4.0          backports_1.1.3   magrittr_1.5      rlang_0.3.4      
[13] cli_1.1.0         curl_3.3          fs_1.2.7          remotes_2.0.2    
[17] testthat_2.0.1    callr_3.2.0       desc_1.2.0        tools_3.5.3      
[21] glue_1.3.1        pkgload_1.0.2     compiler_3.5.3    processx_3.3.0   
[25] pkgbuild_1.0.3    sessioninfo_1.1.1 tcltk_3.5.3       memoise_1.1.0    
> 

推荐答案

在Ubuntu 18.04 + R 3.5.3上,您可以通过以下方法安装 rstanarm :

On Ubuntu 18.04 + R 3.5.3, you can install rstanarm via the following:

sudo add-apt-repository -y "ppa:marutter/rrutter"
sudo add-apt-repository -y "ppa:marutter/c2d4u3.5"
sudo apt update
sudo apt install r-cran-rstanarm

一些有关您以前可能遇到麻烦的原因的背景信息:

Some background info on why you may have had trouble previously:

对于使用R 3.5.x的用户来说,适用于Ubuntu的RStan安装指南已经过时.

The RStan installation guide for Ubuntu is out of date for those using R 3.5.x.

Ben Goodrich 在评论中链接到RStan GitHub

Ben Goodrich linked in the comments to the RStan GitHub Guide to Installing RStan on Linux. There they advise the following for Ubuntu:

# Add marutter's c2d4u repository, (and rrutter for CRAN builds too)
sudo add-apt-repository -y "ppa:marutter/rrutter"
sudo add-apt-repository -y "ppa:marutter/c2d4u"
sudo apt-get update
sudo apt-get install r-cran-rstan

但是,对于R的较新版本,您需要执行以下操作

However, for newer versions of R, you need to instead do the following

# Add marutter's c2d4u repository, (and rrutter for CRAN builds too)
sudo add-apt-repository -y "ppa:marutter/rrutter"
sudo add-apt-repository -y "ppa:marutter/c2d4u3.5"
sudo apt-get update
sudo apt-get install r-cran-rstan

这应该可以在Ubuntu 18.04 + R 3.5.3上为您安装RStan.

This should install RStan for you just fine on Ubuntu 18.04 + R 3.5.3.

这篇关于无法在Ubuntu 18.04 LTS上安装rstanarm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆