Installed Rtools as per instructions
> library(devtools)
> build_github_devtools()
> "C:/PROGRA~1/R/R-33~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD SHLIB foo.c
Warning message:
running command 'make -f "C:/PROGRA~1/R/R-33~1.0/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.0/share/make/winshlib.mk" SHLIB="foo.dll" WIN=64 TCLBIN=64 OBJECTS="foo.o"' had status 127
Error: Command failed (1)
Seems to apply to both Rtools34 and 33
Session info ----------------------------------------------------------------------------------------------------------- ----------------
setting value
version R version 3.3.0 (2016-05-03)
system x86_64, mingw32
ui RStudio (0.99.1212)
language (EN)
collate English_Canada.1252
tz America/Los_Angeles
date 2016-06-11
Packages -------------------------------------------------------------------------------------------------------------------------------
package * version date source
devtools * 1.11.1 2016-04-21 CRAN (R 3.3.0)
digest 0.6.9 2016-01-08 CRAN (R 3.3.0)
memoise 1.0.0 2016-01-29 CRAN (R 3.3.0)
withr 1.0.1 2016-02-04 CRAN (R 3.3.0)
That fix from STAT545 issue 429 worked for me on Windows 10. That is, running find_rtools()
led has_devel()
to work:
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
> install.packages("devtools")
Installing package into ‘C:/Users/SFirke/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/devtools_1.12.0.zip'
Content type 'application/zip' length 433071 bytes (422 KB)
downloaded 422 KB
package ‘devtools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\SFirke\AppData\Local\Temp\Rtmp8uWd7f\downloaded_packages
> library(devtools)
> install_github("hadley/devtools")
Downloading GitHub repo hadley/devtools@master
from URL https://api.github.com/repos/hadley/devtools/zipball/master
Installing devtools
"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/SFirke/AppData/Local/Temp/Rtmp8uWd7f/devtools1a4c463575d4/hadley-devtools-d8ab190" --library="C:/Users/SFirke/Documents/R/win-library/3.3" --install-tests
* installing *source* package 'devtools' ...
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
Error : package 'devtools' is not installed for 'arch = i386'
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/SFirke/Documents/R/win-library/3.3/devtools'
* restoring previous 'C:/Users/SFirke/Documents/R/win-library/3.3/devtools'
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
problem copying C:\Users\SFirke\Documents\R\win-library\3.3\00LOCK-hadley-devtools-d8ab190\devtools\libs\x64\devtools.dll to C:\Users\SFirke\Documents\R\win-library\3.3\devtools\libs\x64\devtools.dll: Permission denied
Error: Command failed (1)
> devtools::build_github_devtools()
"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD SHLIB foo.c
Warning message:
running command 'make -f "C:/PROGRA~1/R/R-33~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.2/share/make/winshlib.mk" SHLIB="foo.dll" WIN=64 TCLBIN=64 OBJECTS="foo.o"' had status 127
Error: Command failed (1)
>
> find_rtools()
[1] TRUE
> has_devel()
"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD SHLIB foo.c
C:/RBuildTools/3.4/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-33~1.2/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -std=gnu99 -mtune=core2 -c foo.c -o foo.o
C:/RBuildTools/3.4/mingw_64/bin/gcc -shared -s -static-libgcc -o foo.dll tmp.def foo.o -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-33~1.2/bin/x64 -lR
[1] TRUE
> build_github_devtools()
"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD SHLIB foo.c
C:/RBuildTools/3.4/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-33~1.2/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -std=gnu99 -mtune=core2 -c foo.c -o foo.o
C:/RBuildTools/3.4/mingw_64/bin/gcc -shared -s -static-libgcc -o foo.dll tmp.def foo.o -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-33~1.2/bin/x64 -lR
Downloading devtools from https://github.com/hadley/devtools/archive/master.zip
"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL "C:\Users\SFirke\AppData\Local\Temp\Rtmp8uWd7f\devtools-master" --build
* installing to library 'C:/Users/SFirke/AppData/Local/Temp/Rtmp8uWd7f/temp_libpath1a4c1a06874'
* installing *source* package 'devtools' ...
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* MD5 sums
packaged installation of 'devtools' as devtools_1.12.0.9000.zip
* DONE (devtools)
Renaming file to ./devtools.zip
The suggested fix of running find_rtools()
then has_devel()
worked for me. I downloaded and installed Rtools then did the following
# R version 3.3.3 (2017-03-06)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows >= 8 x64 (build 9200)
install.packages("devtools")
library(devtools)
has_devel() # has error
find_rtools()
has_devel() # now it works
Output was
> install.packages("devtools")
Installing package into ‘C:/Users/Mark/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/devtools_1.13.1.zip'
Content type 'application/zip' length 440212 bytes (429 KB)
downloaded 429 KB
package ‘devtools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Mark\AppData\Local\Temp\RtmpW2jpI5\downloaded_packages
> library(devtools)
> has_devel() # has error
"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD SHLIB foo.c
Warning message:
running command 'make -f "C:/PROGRA~1/R/R-33~1.3/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.3/share/make/winshlib.mk" SHLIB="foo.dll" WIN=64 TCLBIN=64 OBJECTS="foo.o"' had status 127
Error: Command failed (1)
> find_rtools()
[1] TRUE
> has_devel() # now it works
"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD SHLIB foo.c
C:/RBuildTools/3.4/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-33~1.3/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -std=gnu99 -mtune=core2 -c foo.c -o foo.o
C:/RBuildTools/3.4/mingw_64/bin/gcc -shared -s -static-libgcc -o foo.dll tmp.def foo.o -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-33~1.3/bin/x64 -lR
[1] TRUE
I am on win10 with R 3.4.1 x64. everthing works fine except rtools which isn't recognized with rstudio (devtools). I can't build & load from source and naturally can't install devtools from github. In my rsession I get:
find_rtools(T)
Error: running command '"C:/PROGRA~1/R/R-34~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD config CC' had status 2
Sys.which("ls.exe")
ls.exe
"C:\rtools\bin\ls.exe"
Sys.which("gcc.exe")
gcc.exe
"c:\rtools\mingw_64\bin\gcc.exe"
running the command in cmd returns:
C:Usersfarid>r --no-site-file --no-environ --no-save --no-restore --quiet CMD config cc
make: /etc/x64/Makeconf: No such file or directory
make: /share/make/config.mk: No such file or directory
make: * No rule to make target/share/make/config.mk'. Stop. make: /etc/x64/Makeconf: No such file or directory make: /share/make/config.mk: No such file or directory make: *** No rule to make target
/share/make/config.mk'. Stop.
make: /etc/x64/Makeconf: No such file or directory
make: /share/make/config.mk: No such file or directory
make: No rule to make target/share/make/config.mk'. Stop. make: /etc/x64/Makeconf: No such file or directory make: /share/make/config.mk: No such file or directory make: *** No rule to make target
/share/make/config.mk'. Stop.
make: /etc/x64/Makeconf: No such file or directory
make: /share/make/config.mk: No such file or directory
make: ** No rule to make target `/share/make/config.mk'. Stop.
ERROR: no information for variable 'cc'
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
Most helpful comment
That fix from STAT545 issue 429 worked for me on Windows 10. That is, running
find_rtools()
ledhas_devel()
to work: