Skip to content

Commit 6e0d351

Browse files
authored
Merge pull request #645 from stan-dev/rtools42
RTools42 support
2 parents bfa83a4 + d7fc6ee commit 6e0d351

File tree

10 files changed

+366
-257
lines changed

10 files changed

+366
-257
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
config:
2626
- {os: macOS-latest, r: 'devel'}
2727
- {os: macOS-latest, r: 'release'}
28-
# - {os: windows-latest, r: 'devel'}
28+
- {os: windows-latest, r: 'devel'}
2929
- {os: windows-latest, r: 'release'}
3030
- {os: windows-latest, r: 'oldrel'}
3131
- {os: ubuntu-20.04, r: 'devel'}
@@ -49,31 +49,24 @@ jobs:
4949

5050
- uses: actions/checkout@v2
5151

52-
- name: Set path for RTools 4.0
53-
if: runner.os == 'Windows'
54-
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
55-
56-
- name: Install mingw32-make and check toolchain path
57-
if: runner.os == 'Windows'
58-
run: |
59-
pacman -Syu mingw-w64-x86_64-make --noconfirm
60-
g++ --version
61-
Get-Command g++ | Select-Object -ExpandProperty Definition
62-
mingw32-make --version
63-
Get-Command mingw32-make | Select-Object -ExpandProperty Definition
64-
shell: powershell
65-
6652
- name: Install system dependencies
6753
if: runner.os == 'Linux'
6854
run: |
6955
sudo apt-get update
7056
sudo apt-get install -y libcurl4-openssl-dev || true
7157
sudo apt-get install -y openmpi-bin openmpi-common libopenmpi-dev || true
7258
73-
- uses: r-lib/actions/setup-r@v1
59+
- uses: r-lib/actions/setup-r@v2
7460
with:
7561
r-version: ${{ matrix.config.r }}
76-
62+
- name: Install Rtools42
63+
if: runner.os == 'Windows'
64+
run: |
65+
$source = 'https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-5168-5107.exe'
66+
$destination = '../rtools42.exe'
67+
Invoke-WebRequest -Uri $source -OutFile $destination
68+
Start-Process -FilePath ../rtools42.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait
69+
shell: powershell
7770
- uses: r-lib/actions/setup-pandoc@v1
7871

7972
- name: Query dependencies
@@ -101,6 +94,8 @@ jobs:
10194

10295
- name: Install cmdstan
10396
run: |
97+
print(list.files("C:/rtools42"))
98+
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
10499
cmdstanr::install_cmdstan(cores = 2)
105100
shell: Rscript {0}
106101

.github/workflows/Test-coverage.yaml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
3535
- uses: actions/checkout@v2
3636

37-
- uses: r-lib/actions/setup-r@v1
37+
- uses: r-lib/actions/setup-r@v2
3838
- uses: r-lib/actions/setup-pandoc@v1
3939

4040
- name: Install Ubuntu dependencies
@@ -67,6 +67,7 @@ jobs:
6767

6868
- name: Install cmdstan
6969
run: |
70+
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
7071
cmdstanr::install_cmdstan(cores = 2)
7172
shell: Rscript {0}
7273

@@ -84,24 +85,18 @@ jobs:
8485
steps:
8586
- uses: actions/checkout@v2
8687

87-
- name: Set path for RTools 4.0
88-
if: runner.os == 'Windows'
89-
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
90-
91-
- name: Install mingw32-make and check toolchain path
88+
- uses: r-lib/actions/setup-r@v2
89+
with:
90+
r-version: 'release'
91+
- name: Install Rtools42
9292
if: runner.os == 'Windows'
9393
run: |
94-
pacman -Syu mingw-w64-x86_64-make --noconfirm
95-
g++ --version
96-
Get-Command g++ | Select-Object -ExpandProperty Definition
97-
mingw32-make --version
98-
Get-Command mingw32-make | Select-Object -ExpandProperty Definition
94+
$source = 'https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-5168-5107.exe'
95+
$destination = '../rtools42.exe'
96+
Invoke-WebRequest -Uri $source -OutFile $destination
97+
Start-Process -FilePath ../rtools42.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait
9998
shell: powershell
10099

101-
- uses: r-lib/actions/setup-r@v1
102-
with:
103-
r-version: 'release'
104-
105100
- uses: r-lib/actions/setup-pandoc@v1
106101

107102
- name: Query dependencies
@@ -114,6 +109,7 @@ jobs:
114109
run: |
115110
install.packages(c("remotes", "curl"), dependencies = TRUE)
116111
remotes::install_local(path = ".")
112+
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
117113
cmdstanr::install_cmdstan(cores = 2, overwrite = TRUE)
118114
remotes::install_deps(dependencies = TRUE)
119115
remotes::install_cran("covr")

.github/workflows/cmdstan-tarball-check.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ jobs:
5757
- uses: r-lib/actions/setup-r@v1
5858
with:
5959
r-version: ${{ matrix.config.r }}
60-
60+
- name: Install Rtools42
61+
if: runner.os == 'Windows'
62+
run: |
63+
$source = 'https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-5168-5107.exe'
64+
$destination = '../rtools42.exe'
65+
Invoke-WebRequest -Uri $source -OutFile $destination
66+
Start-Process -FilePath ../rtools42.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait
67+
shell: powershell
6168
- uses: r-lib/actions/setup-pandoc@v1
6269

6370
- name: Query dependencies
@@ -80,6 +87,7 @@ jobs:
8087
remotes::install_deps(dependencies = TRUE)
8188
remotes::install_cran("rcmdcheck")
8289
remotes::install_local(path = ".")
90+
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
8391
if (Sys.getenv("CMDSTAN_TEST_TARBALL_URL") == "latest") {
8492
cmdstanr::install_cmdstan(cores = 2, overwrite = TRUE)
8593
} else {

DESCRIPTION

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: cmdstanr
22
Title: R Interface to 'CmdStan'
3-
Version: 0.5.1.9000
4-
Date: 2022-04-06
3+
Version: 0.5.2
4+
Date: 2022-04-24
55
Authors@R:
66
c(person(given = "Jonah", family = "Gabry", role = c("aut", "cre"),
77
email = "[email protected]"),
@@ -36,7 +36,8 @@ Imports:
3636
jsonlite (>= 1.2.0),
3737
posterior (>= 1.1.0),
3838
processx (>= 3.5.0),
39-
R6 (>= 2.4.0)
39+
R6 (>= 2.4.0),
40+
withr (>= 2.5.0)
4041
Suggests:
4142
bayesplot,
4243
knitr (>= 1.37),

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# cmdstanr 0.5.2
2+
3+
* Refactored toolchain install and checks for R 4.x on Windows and added support
4+
for Rtools42.
5+
16
# cmdstanr 0.5.1
27

38
* Temporarily disable `format="draws_rvars"` in the `$draws()` method due to a

0 commit comments

Comments
 (0)