已安装Rcpp Rtools但未找到错误消息g ++

问题描述 投票:11回答:3

我已经查询了与我的具体问题相关的SO上的现有条目,但仍然无法解决它。

我正在尝试使用我的机器在工作,我有限制管理员权限,但我可以运行Rtools.exe,所以我安装它。

我对R的设置是:

 platform       x86_64-w64-mingw32          
 arch           x86_64                      
 os             mingw32                     
 system         x86_64, mingw32             
 version.string R version 3.3.0 (2016-05-03)

我是RStudio版本0.99.902。我安装了Rtools版本3.3.0.1959。

所有R,Rstudio和Rtools都安装在C:/ WORK /中,这是我有一些有限的管理员权限。

在我的系统ENV变量中,我已经设置:

 C:\\WORK\\Rtools\\bin; C:\\WORK\\Rtools\\gcc-  4.6.3\\bin; C:\\WORK\\R-3.3.0\\bin\\x64;" 

我跑的时候

 system('where make')

我明白了

 C:\WORK\Rtools\bin\make.exe

我跑的时候

 system('g++ -v')

我明白了:

 Using built-in specs.
 COLLECT_GCC=C:\WORK\Rtools\GCC-46~1.3\bin\G__~1.EXE
 COLLECT_LTO_WRAPPER=c:/WORK/rtools/gcc-46~1.3/bin/../libexec/gcc/i686-w64-   mingw32/4.6.3/lto-wrapper.exe
 Target: i686-w64-mingw32
 Configured with: /data/gannet/ripley/Sources/mingw-test3/src/gcc/configure --host=i686-w64-mingw32 --build=x86_64-linux-gnu --target=i686-w64-mingw32 --with-sysroot=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --prefix=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/mingw32 --with-gmp=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpfr=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --with-mpc=/data/gannet/ripley/Sources/mingw-test3/mingw32mingw32/prereq_install --disable-shared --enable-static --enable-targets=all --enable-languages=c,c++,fortran --enable-libgomp --enable-sjlj-exceptions --enable-fully-dynamic-string --disable-nls --disable-werror --enable-checking=release --disable-win32-registry --disable-rpath --disable-werror CFLAGS='-O2 -mtune=core2 -fomit-frame-pointer' LDFLAGS=
 Thread model: win32
 gcc version 4.6.3 20111208 (prerelease) (GCC) 

当我编译时,我收到此错误:

 Error in compileCode(f, code, language = language, verbose = verbose) : 
 Compilation ERROR, function(s)/method(s) not created!
 c:/Rtools/mingw_64/bin/g++: not found

我的问题是:为什么R仍然在寻找g ++

 c:/Rtools/mingw_64/bin/g++

我没有设置R来寻找它

 C:/WORK/Rtools? 

即使我手动添加

 c:/WORK/Rtools/mingw_64/bin/g++

在ENV变量中,我仍然遇到了同样的错误。 (由于管理员权限,我无法在C:/中创建Rtools文件夹。)

有没有人遇到这个具体问题?

c++ g++ environment-variables rcpp
3个回答
11
投票

路径c:/Rtools/mingw_64/bin/被硬编码到R安装中的某个地方Makeconflocated(在我的情况下为C:\Progs\R\R-3.4.1\etc\x64),作为变量BINPREF的值。

最简单的方法是将此路径更改为路径C:/WORK/Rtools/bin(在我的情况下是C:/Progs/RTools/3.4/mingw_64/bin/)。这对我来说是R-3.4.1和Rtools3.4的全新安装,也是最小的例子。


2
投票

发生的事情是需要在RTools 34和NOT 33上使用R 3.3.x.

删除rtools安装,然后按照此处的指南操作:

http://thecoatlessprofessor.com/programming/rcpp/install-rtools-for-rcpp/

@David,您需要删除所有C:\WORK\Rtools\<something>实例和任何重复项(例如C:\WORK\R-3.3.0\bin\x64出现两次。)然后添加:

C:\工作\ Rtools \ BIN; C:\工作\ Rtools \ mingw_32 \ BIN;


0
投票

一个看似合理且简单易行的方法是在以下提示中选择“完全安装以构建32位或64位”。

© www.soinside.com 2019 - 2024. All rights reserved.