Build package with RTools40

Once again a question because "Install and Restart" does not work because it want RTools installed

Yes I followed Using Rtools40 on Windows

  1. Running RStudio Version 1.4.1106
  2. Running R 4.1 64 bit.
  3. Removed all directories related to RTools in the C: drive
  4. downloaded and ran rtools40v2-x86_64.exe This created rtools40 on the c:drive
  5. ran
writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")

to put the path change in .Renviron Verified that the file is as expected.

Next step

Sys.which("make")

Result

C:\\rtools40\\usr\\bin\\make.exe" 

Next tried to build a package.

install.packages("jsonlite", type = "source")

A lot of access to rtools occurred, but in the end I got this message: " non-zero exit status"

** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path
* DONE (jsonlite)
Warning in install.packages :
  installation of package ‘jsonlite’ had non-zero exit status

Here is some other verification

> list.files(Sys.getenv('RTOOLS40_HOME'))
 [1] "autorebase.bat"        "autorebasebase1st.bat" "clang32"               "clang64"              
 [5] "clang64.exe"           "clang64.ico"           "clang64.ini"           "clangarm64"           
 [9] "dev"                   "etc"                   "home"                  "mingw32"              
[13] "mingw32.exe"           "mingw32.ico"           "mingw32.ini"           "mingw64"              
[17] "mingw64.exe"           "mingw64.ico"           "mingw64.ini"           "msys2.exe"            
[21] "msys2.ico"             "msys2.ini"             "msys2_shell.cmd"       "opt"                  
[25] "tmp"                   "ucrt64"                "ucrt64.exe"            "ucrt64.ico"           
[29] "ucrt64.ini"            "unins000.dat"          "unins000.exe"          "usr"                  
[33] "var")

Also

list.files(here::here(Sys.getenv('RTOOLS40_HOME'),'usr','bin'))[1:10]
 [1] "[.exe"        "arch.exe"     "ash.exe"      "autopoint"    "awk.exe"      "b2sum.exe"    "backup"      
 [8] "base32.exe"   "base64.exe"   "basename.exe"

Next I tried using the build command: Rcmd.exe' failed, exit status: 1, stdout + stderr:

> devtools::build()
   The system cannot find the path specified.
√  checking for file 'D:\Research\test/DESCRIPTION' ...
-  preparing 'test':
√  checking DESCRIPTION meta-information ...
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
   Omitted 'LazyData' from DESCRIPTION
-  building 'test_0.1.0.tar.gz'
   
Error in (function (command = NULL, args = character(), error_on_status = TRUE,  : 
  System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
E> The system cannot find the path specified.
E> * checking for file 'D:\Research\test/DESCRIPTION' ... OK
E> * preparing 'test':
E> * checking DESCRIPTION meta-information ... OK
E> * checking for LF line-endings in source and make files and shell scripts
E> * checking for empty or unneeded directories
E> Omitted 'LazyData' from DESCRIPTION
E> * building 'test_0.1.0.tar.gz'
E> 
Type .Last.error.trace to see where the error occurred

Then I tried the package., Oddly, there is a package:

> library(test)
> test::hello()
[1] "Hello, world!"

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.