简体   繁体   中英

R 3.3.0 installing a package on Windows: gcc not found error

I am trying to install an R package which contains some C code under Windows. I have R 3.3.0 installed and also Rtools 3.3.0 installed on my computer's D: disk.

And d:\Rtools\bin and d:\Rtools\mingw_64\bin are all in PATH. I checked gcc command under command window, and it is working.

But when I am installing the package, it always trying to use c:/Rtools/mingw_64/bin/gcc , which should be in d: disk, then it gives c:/Rtools/mingw_64/bin/gcc: not found error.

Can anyone help on this issue?

Thanks!

OK, I sent an email to the R-package-devel group regarding to this issue. And the following is the reply, and it does work!

Please adapt your BINPREF variable in R/etc/$Arch/Makeconf files appropriately to point to the coresponding compiler for each architecture - this is new with the new toolchain we use with R >= 3.3.0.

If you don't want to edit the Makefile directly (as of R 3.6.3 at least), you can set BINPREF as an environment variable pointing to the appropiate mingw_{32,64}/bin/ path

Couple of gotcha's on Windows to note:

  • Need to use forward slahes in the path (and so can't use any environment variables like %LocalAppData% in there)
  • Trailing forward slash after bin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM