从源代码安装 R 代码时出现 g++ 错误 [英] Getting g++ error when installing R code from source
问题描述
我已经从 CRAN 下载了 Rcpp 并将其解压缩并尝试构建它.当我尝试使用 R CMD INSTALL 时.在我得到的目录中:
I've downloaded Rcpp from CRAN and unzipeed it and attempted to build it. When I try to use R CMD INSTALL . in the directory I get:
cp: unknown option -- )
如果我尝试打开一个会话并使用 install.packages("Rcpp", type = "source"),我会从 g++
收到以下错误:
If I try to open up a session and use install.packages("Rcpp", type = "source"), I get the following error from g++
:
*** arch - x64
g++ -m64 -I"C:/R/R-30~1.1/include" -DNDEBUG -I../inst/include/ -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c Date.cpp -o Date.o
Date.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
make: *** [Date.o] Error 1
我安装了 Rtools,它的目录在我的路径前面.我使用的是 64 位 Windows 7.是否有我缺少的安装选项?我一直在阅读 R 的安装和管理手册的附录 D,但找不到我可能违反的任何内容,所有内容都是通过 Rtools 安装的.我觉得有一个标志我没有包括在内,但我不知道是什么.
I have Rtools installed, and its directories are in the front of my path. I am on 64-bit Windows 7. Are there install options that I am missing? I have been reading appendix D of R's Installation and Administration manual and can't find anything I might have violated, everything was installed through Rtools. I feel like there is a flag that I am not including but I can't figure out what.
推荐答案
这个问题在我按连续顺序执行以下操作(我不确定是哪一个修复它)后开始起作用:
This problem started working once I did the following (I'm not sure which one fixed it) listed in consecutive order:
-把我的咖啡杯扔到墙上,诅咒德克·埃德尔比特尔
-threw my coffee cup against the wall, cursing Dirk Eddelbuettel
-将 R 路径变量从 C:R\R-3.0.1\bin 更改为 C:\R\R-3.0.1\bin\x64\
-changed the R path variable from C:R\R-3.0.1\bin to C:\R\R-3.0.1\bin\x64\
-重新安装Rtools,这次勾选允许它更改系统路径的框,我之前一直在更改我的用户路径
-reinstalled Rtools, this time checking the box allowing it to change the system path, I had been changing my user path before
-请求 Dirk Eddelbuettel 的灵魂原谅
-asked the spirit of Dirk Eddelbuettel for forgiveness
-重启Rstudio
它奏效了.我想这是因为我没有考虑系统路径,它首先在 windows 中读取,所以它运行到了一个 Haskell g++ 编译器中,它在所有东西的前面,而且只有 32 位.
It worked. I think it was because I was not considering the system path, which is read first in windows, and so it was running into a Haskell g++ compiler, which was in front of everything, and only 32 bit.
这篇关于从源代码安装 R 代码时出现 g++ 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!