【发布时间】:2021-10-04 00:23:56
【问题描述】:
我在 Windows 10 上使用 R v.3.5.1、R studio v 1.3.1093 和 Rtools 3.5。
我知道R工具已经安装成功并找到了工具链,关注https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows并成功安装:
install.packages("jsonlite",type="source").
但是,当我尝试使用源代码安装 rstan 时
pkgbuild::with_build_tools(install.packages("rstan", type = "source"))
我收到以下错误消息:
sh: C:/Rtools/mingw_32/bin/: Is a directory
make: *** [C:/PROGRA~1/R/R-35~1.1/etc/i386/Makeconf:215: sparse_extractors.o] Error 126
ERROR: compilation failed for package 'rstan'
* removing 'C:/R/library/rstan'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status
目前,我的 makevars.win 文件包含以下内容:
CXX14 = C:/Rtools/mingw_$(WIN)/bin/ g++ -std=c++1y
CXX14FLAGS = -O3 -Wno-unused-variable -Wno-unused-function
虽然我已经尝试了makevars文件中的各种不同的行,但仍然像上面一样显示错误126消息。
我可以成功安装 rstan/rstanarm/brms 等的二进制版本。但是当我尝试编译模型时它失败了。当我尝试这个并意识到二进制版本不起作用时,我在尝试安装源版本之前卸载了 rstan/rstanarm 和 brms。
任何帮助修复此错误并成功安装 rstan 将不胜感激!
【问题讨论】:
标签: c++ makefile c++14 rstan brms