Tôi không thể để Rcpp hoạt động trên Windows 8.1. Khi tôi chạy ví dụ tối thiểu sau, tôi gặp lỗi.Làm cách nào để Rcpp hoạt động?
> library(Rcpp)
> evalCpp("1 + 1")
g++ -m64 -I"C:/R/R-31~1.0/include" -DNDEBUG -I"C:/R/R-3.1.0/library/Rcpp/include" -
I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c file11dc2120723d.cpp -o
file11dc2120723d.o g++: not found make: *** [file11dc2120723d.o] Error 127 Warning message: running
command 'make -f "C:/R/R-31~1.0/etc/x64/Makeconf" -f "C:/R/R-31~1.0/share/make/winshlib.mk"
SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_97232.dll" WIN=64 TCLBIN=64
OBJECTS="file11dc2120723d.o"' had status 2
Error in sourceCpp(code = code, env = env, rebuild = rebuild, showOutput = showOutput, :
Error 1 occurred building shared library.
Hai mục đầu tiên trong con đường của tôi là: PATH = c: \ Rtools \ bin; c: \ Rtools \ gcc-4.6.3 \ bin;
R được cài đặt trong một thư mục C: \ R \ R-3.1.0
Rtools được trong thư mục C: \ R \ Rtools
Một số thông tin thêm:
> library(devtools)
> find_rtools(T)
Scanning path...
ls : c:\Rtools\bin\ls.exe
Scanning registry...
Found c:/Rtools for 3.1
VERSION.txt
Rtools version 3.1.0.1942
[1] TRUE
> has_devel()
"C:/R/R-31~1.0/bin/x64/R" --vanilla CMD SHLIB foo.c
gcc -m64 -I"C:/R/R-31~1.0/include" -DNDEBUG -I"d:/RCompile/CRANpkg/extralibs64/local/include"
O2 -Wall -std=gnu99 -mtune=core2 -c foo.c -o foo.o
gcc: not found
make: *** [foo.o] Error 127
Warning message:
running command 'make -f "C:/R/R-31~1.0/etc/x64/Makeconf" -f "C:/R/R-31~1.0/share/make/winshlib.mk"
SHLIB="foo.dll" WIN=64 TCLBIN=64 OBJECTS="foo.o"' had status 2
Error: Command failed (1)
> system('g++ -v')
Warning message:
running command 'g++ -v' had status 127
Có điều gì đó không phù hợp với đường dẫn của bạn. Đọc lại hướng dẫn sử dụng và thử lại. Bạn cần phải khởi động lại dấu nhắc cmd.exe và/hoặc R/RStudio để thay đổi có hiệu lực. –
Hệ thống '(" SET PATH ")' cung cấp cho bạn những gì? –
'hệ thống (" SET PATH ")' cung cấp cho tôi 'Thông báo cảnh báo: lệnh chạy 'SET PATH' có trạng thái 127' – user3601715