Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide support for Rtools 4.0 #44

Merged
merged 1 commit into from
Oct 7, 2019
Merged

Provide support for Rtools 4.0 #44

merged 1 commit into from
Oct 7, 2019

Conversation

jimhester
Copy link
Member

No description provided.

@jimhester jimhester mentioned this pull request Sep 18, 2018
@bgoodri
Copy link

bgoodri commented Nov 11, 2018

This PR is not quite working for me. I have R-testing and rtools40 installed in their default locations. At one point, I had beta-2 of rtools40 and then I uninstalled it through Control Panel to then install beta-5 with the default installation options. I also have the 3.5 versions of R and Rtools, although that should not matter. And I have installed pkgbuild at bde0758 . Now I get:

> library(pkgbuild)
> packageVersion("pkgbuild")
[1] ‘1.0.0.9000’
> stopifnot(has_build_tools(debug = TRUE))
Scanning R CMD config CC...
cc_path: /mingw64/bin/gcc 
'/mingw64/bin/gcc.exe' does not exist
Scanning path...
ls: C:\rtools40\usr\bin\ls.exe 
gcc_path: c:\Rtools\mingw_64\bin\gcc.exe 
Scanning registry...
Found C:/Rtools for 3.5 
Found C:/rtools40 for 4.0 
WARNING: Rtools is required to build R packages, but the version of Rtools previously installed in C:/rtools40 has been deleted.

Please download and install Rtools 4.0 from http://cran.r-project.org/bin/windows/Rtools/.
Error: has_build_tools(debug = TRUE) is not TRUE

But C:/rtools40 is definitely present

> dir(file.path("C:", "rtools40"))
 [1] "autorebase.bat"        "autorebasebase1st.bat" "dev"                   "etc"                   "home"                  "mingw32"              
 [7] "mingw32.exe"           "mingw32.ini"           "mingw64"               "mingw64.exe"           "mingw64.ini"           "msys2.exe"            
[13] "msys2.ico"             "msys2.ini"             "msys2_shell.cmd"       "opt"                   "tmp"                   "unins000.dat"         
[19] "unins000.exe"          "usr"  

and this works

> system2(file.path(R.home("bin"), "Rcmd.exe"), "config CC")
/mingw64/bin/gcc

so it seems as if there is some confusion in scanning the registry.

> sessionInfo()
R version 3.6.0 Under development (Testing Rtools) (2018-09-22 r75352)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] pkgbuild_1.0.0.9000

loaded via a namespace (and not attached):
[1] processx_3.2.0   compiler_3.6.0   assertthat_0.2.0 R6_2.3.0         base64enc_0.1-3  crayon_1.3.4     callr_3.0.0      ps_1.2.1        

@jimhester
Copy link
Member Author

You also need to add additional files to the rtools directorory as mentioned in #40 (comment)

I needed to add the Rtools.txt and appropriate VERSION.txt files so that the pkgbuild detection would work.

@bgoodri
Copy link

bgoodri commented Nov 14, 2018

OK, like you suggested, I can make this work with a

cat("Rtools version 4.0.0", file = file.path("C:", "rtools40", "VERSION.txt"), sep = "\n")

Thanks!

@jimhester jimhester merged commit ad3c6f9 into master Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants