【问题标题】:make*** error 126 when trying to compile rstan with Rtools 3.5/Rv3.5.1尝试使用 Rtools 3.5/Rv3.5.1 编译 rstan 时出现错误 126
【发布时间】: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


    【解决方案1】:

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

    删除空格。

    【讨论】:

    • 感谢您的回复。我删除了空间,但现在有: make: *** [C:/PROGRA~1/R/R-35~1.1/etc/i386/Makeconf:215: Module.o] 错误 1 ​​错误:包编译失败'rstan'
    • 这不是正确的错误信息。这只是告诉您,当它尝试在第 215 行的文件 Makeconf 中运行命令时出现问题。您必须查看消息 before 以看看出了什么问题并解决它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-14
    • 2020-11-13
    • 1970-01-01
    相关资源
    最近更新 更多