0

我在 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 的帮助将不胜感激!

4

1 回答 1

0

在 g++ 之前有一个空格会导致 Makefile 执行目录(由于它不是可执行文件而失败)。

删除空间。

于 2021-07-28T10:01:45.540 回答