Skip to content

Commit

Permalink
Merge pull request #645 from stan-dev/rtools42
Browse files Browse the repository at this point in the history
RTools42 support
  • Loading branch information
rok-cesnovar authored Apr 26, 2022
2 parents bfa83a4 + d7fc6ee commit 6e0d351
Show file tree
Hide file tree
Showing 10 changed files with 366 additions and 257 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
config:
- {os: macOS-latest, r: 'devel'}
- {os: macOS-latest, r: 'release'}
# - {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'oldrel'}
- {os: ubuntu-20.04, r: 'devel'}
Expand All @@ -49,31 +49,24 @@ jobs:

- uses: actions/checkout@v2

- name: Set path for RTools 4.0
if: runner.os == 'Windows'
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Install mingw32-make and check toolchain path
if: runner.os == 'Windows'
run: |
pacman -Syu mingw-w64-x86_64-make --noconfirm
g++ --version
Get-Command g++ | Select-Object -ExpandProperty Definition
mingw32-make --version
Get-Command mingw32-make | Select-Object -ExpandProperty Definition
shell: powershell

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev || true
sudo apt-get install -y openmpi-bin openmpi-common libopenmpi-dev || true
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}

- name: Install Rtools42
if: runner.os == 'Windows'
run: |
$source = 'https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-5168-5107.exe'
$destination = '../rtools42.exe'
Invoke-WebRequest -Uri $source -OutFile $destination
Start-Process -FilePath ../rtools42.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait
shell: powershell
- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
Expand Down Expand Up @@ -101,6 +94,8 @@ jobs:

- name: Install cmdstan
run: |
print(list.files("C:/rtools42"))
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
cmdstanr::install_cmdstan(cores = 2)
shell: Rscript {0}

Expand Down
26 changes: 11 additions & 15 deletions .github/workflows/Test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v1

- name: Install Ubuntu dependencies
Expand Down Expand Up @@ -67,6 +67,7 @@ jobs:

- name: Install cmdstan
run: |
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
cmdstanr::install_cmdstan(cores = 2)
shell: Rscript {0}

Expand All @@ -84,24 +85,18 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set path for RTools 4.0
if: runner.os == 'Windows'
run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Install mingw32-make and check toolchain path
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
- name: Install Rtools42
if: runner.os == 'Windows'
run: |
pacman -Syu mingw-w64-x86_64-make --noconfirm
g++ --version
Get-Command g++ | Select-Object -ExpandProperty Definition
mingw32-make --version
Get-Command mingw32-make | Select-Object -ExpandProperty Definition
$source = 'https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-5168-5107.exe'
$destination = '../rtools42.exe'
Invoke-WebRequest -Uri $source -OutFile $destination
Start-Process -FilePath ../rtools42.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait
shell: powershell

- uses: r-lib/actions/setup-r@v1
with:
r-version: 'release'

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
Expand All @@ -114,6 +109,7 @@ jobs:
run: |
install.packages(c("remotes", "curl"), dependencies = TRUE)
remotes::install_local(path = ".")
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
cmdstanr::install_cmdstan(cores = 2, overwrite = TRUE)
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/cmdstan-tarball-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ jobs:
- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}

- name: Install Rtools42
if: runner.os == 'Windows'
run: |
$source = 'https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-5168-5107.exe'
$destination = '../rtools42.exe'
Invoke-WebRequest -Uri $source -OutFile $destination
Start-Process -FilePath ../rtools42.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait
shell: powershell
- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
Expand All @@ -80,6 +87,7 @@ jobs:
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_local(path = ".")
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
if (Sys.getenv("CMDSTAN_TEST_TARBALL_URL") == "latest") {
cmdstanr::install_cmdstan(cores = 2, overwrite = TRUE)
} else {
Expand Down
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: cmdstanr
Title: R Interface to 'CmdStan'
Version: 0.5.1.9000
Date: 2022-04-06
Version: 0.5.2
Date: 2022-04-24
Authors@R:
c(person(given = "Jonah", family = "Gabry", role = c("aut", "cre"),
email = "[email protected]"),
Expand Down Expand Up @@ -36,7 +36,8 @@ Imports:
jsonlite (>= 1.2.0),
posterior (>= 1.1.0),
processx (>= 3.5.0),
R6 (>= 2.4.0)
R6 (>= 2.4.0),
withr (>= 2.5.0)
Suggests:
bayesplot,
knitr (>= 1.37),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# cmdstanr 0.5.2

* Refactored toolchain install and checks for R 4.x on Windows and added support
for Rtools42.

# cmdstanr 0.5.1

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

0 comments on commit 6e0d351

Please sign in to comment.