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

RTools path issues / env vars for cmdstanr #105

Merged
merged 3 commits into from May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,6 +1,6 @@
Package: didehpc
Title: DIDE HPC Support
Version: 0.3.10
Version: 0.3.11
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
email = "rich.fitzjohn@gmail.com"),
person("Wes", "Hinsley", role = "aut"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
@@ -1,3 +1,7 @@
# didehpc 0.3.11

Fix path issues and support cmdstandr/RTools.

# didehpc 0.3.9

Add support for new infiniband storage on covid cluster headnode.
Expand Down
4 changes: 2 additions & 2 deletions R/config.R
Expand Up @@ -466,9 +466,9 @@ check_worker_resource <- function(worker_resource, cluster, template,
rtools_versions <- function(path, r_version) {
r_version_2 <- as.character(r_version[1, 1:2])
if (r_version < "4.0.0") {
mingw <- "mingw_$(WIN)"
mingw <- "mingw_%R_BITS%"
} else {
mingw <- "mingw$(WIN)"
mingw <- "mingw%R_BITS%"
}

ret <- switch(r_version_2,
Expand Down
3 changes: 3 additions & 0 deletions inst/template_shared.bat
Expand Up @@ -10,6 +10,9 @@ set CONTEXT_WORKDIR={{context_workdir}}
set CONTEXT_ROOT={{context_root}}
set CONTEXT_ID={{context_id}}
set R_LIBS_USER={{r_libs_user}}
set RTOOLS35_HOME=T:\Rtools\Rtools35
set RTOOLS40_HOME=T:\Rtools\Rtools40
set RTOOLS42_HOME=T:\Rtools\Rtools42

call setr64_{{r_version}}.bat

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-batch.R
Expand Up @@ -45,7 +45,7 @@ test_that("Can create path and template data", {


test_that("batch data creates entries for share drives", {
config <- example_config(r_version = numeric_version("4.0.3"))
config <- example_config(r_version = numeric_version("4.0.5"))
root <- file.path(config$workdir, "context")
dir.create(root, FALSE, TRUE)
context_id <- ids::random_id()
Expand All @@ -58,7 +58,7 @@ test_that("batch data creates entries for share drives", {


test_that("can disable conan bootstrap", {
config <- example_config(r_version = numeric_version("4.0.3"))
config <- example_config(r_version = numeric_version("4.0.5"))
root <- file.path(config$workdir, "context")
dir.create(root, FALSE, TRUE)
context_id <- ids::random_id()
Expand Down
22 changes: 11 additions & 11 deletions tests/testthat/test-config.R
Expand Up @@ -139,19 +139,19 @@ test_that("Can find redis host, given cluster", {
test_that("Can get a reasonable rtools version", {
expect_equal(
rtools_versions("<prefix>", numeric_version("4.0.0")),
list(gcc = "mingw$(WIN)",
list(gcc = "mingw%R_BITS%",
make = "usr",
binpref = "<prefix>/Rtools/Rtools40/mingw$(WIN)/bin",
binpref = "<prefix>/Rtools/Rtools40/mingw%R_BITS%/bin",
rtools_root = "<prefix>\\Rtools\\Rtools40",
gcc_path = "<prefix>\\Rtools\\Rtools40\\mingw$(WIN)\\bin",
gcc_path = "<prefix>\\Rtools\\Rtools40\\mingw%R_BITS%\\bin",
make_path = "<prefix>\\Rtools\\Rtools40\\usr\\bin"))
expect_equal(
rtools_versions("<prefix>", numeric_version("3.6.3")),
list(gcc = "mingw_$(WIN)",
list(gcc = "mingw_%R_BITS%",
make = "",
binpref = "<prefix>/Rtools/Rtools35/mingw_$(WIN)/bin",
binpref = "<prefix>/Rtools/Rtools35/mingw_%R_BITS%/bin",
rtools_root = "<prefix>\\Rtools\\Rtools35",
gcc_path = "<prefix>\\Rtools\\Rtools35\\mingw_$(WIN)\\bin",
gcc_path = "<prefix>\\Rtools\\Rtools35\\mingw_%R_BITS%\\bin",
make_path = "<prefix>\\Rtools\\Rtools35\\\\bin"))
expect_equal(
rtools_versions("<prefix>", numeric_version("3.5.0")),
Expand All @@ -169,8 +169,8 @@ test_that("fetch r versions", {
testthat::skip_if_offline()
dat <- r_versions()
expect_is(dat, "numeric_version")
expect_true(numeric_version("4.0.3") %in% dat)
expect_true(length(dat) > 10)
expect_true(numeric_version("4.0.5") %in% dat)
expect_true(length(dat) > 4)
})


Expand All @@ -180,10 +180,10 @@ test_that("Select a sensible r version", {
vmax <- max(v)
vmid <- v[length(v) - 3]
expect_equal(select_r_version(vmax), vmax)
expect_error(select_r_version("3.4.9"),
"Unsupported R version: 3.4.9")
expect_error(select_r_version("3.6.0"),
"Unsupported R version: 3.6.0")
expect_equal(select_r_version(NULL, vmid), vmid)
expect_equal(select_r_version(NULL, "3.4.9"), numeric_version("3.5.0"))
expect_equal(select_r_version(NULL, "3.6.0"), numeric_version("3.6.3"))
})


Expand Down