[This article was first published on R | Dr Tom Palmer, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)


Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.

Introduction

GitHub has recently announced that Windows ARM64 runners are
now available under the windows-11-arm label.

I help maintain an R package,
TwoSampleMR, which has quite alot of users. The package is not on CRAN because several of its dependencies are only on GitHub, and for a package to be on CRAN essentially all of its dependencies must also be on CRAN. As a result I am always interested to try installing the package on new operating systems and architectures.

(In this post I will use ARM and AARCH64 interchangeably.)

Setting up R AARCH64 on Windows on ARM

Avoiding confusion with the default runner software

It is important to mention that the x86_64 version of R 4.4.2 and RTools44 are included in the
default software set for the windows-latest GitHub Actions runner. And the directory including its binaries are on the PATH environment variable (specifically C:Program Files (x86)RR-4.4.2binx64). As a result if you run R, Rscript, or R CMD batch etc. in a shell in the runner you will obtain the x86_64 version of R (which runs under emulation on the ARM runner). Let’s say this is not what we want, so to setup the ARM version of R we need to install it ourselves.

Installing AARCH64 R and RTools45

Tomas Kalibera from the R Core Team has provided several excellent posts (
here and
here) about R for Windows on ARM, and installers for it have been available for some time.

The r-hub API does not yet provide the installer information for the AARCH64 version of R, so I came up with the following workflow file – amended from r-lib/actions to install R 4.5.0 and RTools45. Place such a (GitHub Actions workflow) file in a public GitHub repo in a .github/workflows directory, and enable GitHub Actions in the repo settings.

on:
  push:
    branches: [main, master]
  pull_request:
    branches: [main, master]
  workflow_dispatch:

name: Check-install-win-11-arm

permissions: read-all

jobs:
  windows-11-on-arm:
    runs-on: windows-11-arm

    name: windows-11-arm

    strategy:
      fail-fast: false

    env:
      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
      R_KEEP_PKG_SOURCE: yes

    steps:
      - name: Install R and RTools for Windows on ARM and install TwoSampleMR
        run: |
          $url = "https://www.r-project.org/nosvn/winutf8/aarch64/R-4-signed/R-4.5.0-aarch64.exe"
          Invoke-WebRequest -Uri "$url" -OutFile R-4.5.0-aarch64.exe -UseBasicParsing -UserAgent "NativeHost"
          Start-Process -FilePath R-4.5.0-aarch64.exe -ArgumentList "/install /norestart /verysilent /SUPPRESSMSGBOXES" -NoNewWindow -Wait
          $url = "https://cran.r-project.org/bin/windows/Rtools/rtools45/files/rtools45-aarch64-6536-6492.exe"
          Invoke-WebRequest -Uri "$url" -OutFile rtools45-aarch64-6536-6492.exe -UseBasicParsing -UserAgent "NativeHost"
          Start-Process -FilePath rtools45-aarch64-6536-6492.exe -ArgumentList "/install /norestart /verysilent /SUPPRESSMSGBOXES" -NoNewWindow -Wait
          $rscript = "C:Program FilesR-aarch64R-4.5.0binRscript.exe"
          $arguments = "-e", "print(R.version); # the rest of your R code goes here ..."
          & $rscript $arguments

Breaking down the final steps section of this;

  • we define the url of the R 4.5.0 aarch64 installer;
  • we then download the installer using Invoke-WebRequest (note that the default shell in Windows is Powershell);
  • we then run the installer using Start-Process. I am not sure if I need all of the arguments I have specified here but it seems to work.
  • We then do the same for RTools45.
  • We then define a variable for the path to the Rscript.exe binary;
  • we define a variable containing the arguments we want to pass to Rscript;
  • we then invoke Rscript using our two variables and the & call operator.

Then we navigate to our GitHub repo and view the output in the Actions tab under the relevant run.

Of course if you want to run your own R script you’ll need an initial step to checkout your repo.

To confirm that we really have launched the AARCH64 version of R we see the output of print(R.version) is as follows.

print(R.version)
#>                _
#> platform       aarch64-w64-mingw32
#> arch           aarch64
#> os             mingw32
#> crt            ucrt
#> system         aarch64, mingw32
#> status
#> major          4
#> minor          5.0
#> year           2025
#> month          04
#> day            11
#> svn rev        88135
#> language       R
#> version.string R version 4.5.0 (2025-04-11 ucrt)
#> nickname       How About a Twenty-Six

Summary

I have shown how to install the AARCH64 version of R and RTools45 on the recently released Windows on ARM runner in GitHub Actions.

As an aside, I note that we are now in the interesting position in that GitHub Actions now has Windows, macOS, and Ubuntu Linux all available on both x86_64 and ARM architectures.

To leave a comment for the author, please follow the link and comment on their blog: R | Dr Tom Palmer.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you’re looking to post or find an R/data-science job.


Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.

Continue reading: Running R on Windows on ARM on GitHub Actions

Analysis of Running R on Windows on ARM on GitHub Actions

The original text discusses the new announcement by GitHub about the availability of Windows ARM64 runners under the label ‘windows-11-arm’. The author also provides a detailed guide about setting up R AARCH64 on Windows on ARM, with specific reference to maintaining the R package ‘TwoSampleMR’.

Long-term Implications and Future Developments

The development of R package ‘TwoSampleMR’ and its availability on new operating systems will greatly enhance its accessibility and usage amongst its extensive user base. The recent announcement by GitHub could signify that various platforms are beginning to accept and implement more powerful ARM64-based architectures for various software, including R. As ARM-based systems usually offer better power efficiency, this move can lead to energy savings and more efficient computing.

The implication is not just significant for the ‘TwoSampleMR’ package, but also for other software dependencies that rely on GitHub. It represents a step towards ensuring that these tools are compatible with newer systems and architectures.

In the long term, with ARM-based systems gaining more popularity and usage, it’s predictable that software and tools will increasingly become optimized for these systems.

Actionable Advice

For developers and IT professionals:

  1. Learning about ARM and AARCH64 architectures, and familiarising with installing software on these systems could become an essential skill. Training and development in this area would be beneficial.
  2. Developers maintaining R packages or similar tools should test their software on these new architectures to ensure compatibility and function.
  3. Developers should also consider updating their package dependencies on repositories like GitHub and CRAN, as this can help in broadening the user base of their packages.

For users and organizations:

  1. The migration to ARM64 architecture could bring about significant improvements in efficiency and power consumption. Organizations should therefore consider investing in this technology as a part of their long-term strategy.
  2. Scheduled check-ins for updates related to ARM64 support for various software tools will help avoid any potential compatibility issues.

Conclusion

This new development in ARM64 support for GitHub signifies a huge step forward in embracing more power-efficient architectures. This could potentially spark numerous advancements in software development and optimization for ARM-based systems. Both developers and users would benefit greatly by keeping abreast of such advancements and making necessary adjustments to adapt to these forward-looking changes.

Read the original article