Feature request: Support switching to OpenBLAS on Windows

Open
#509 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
r, rust
Domain
backend, cli

Research direction

Read the existing rig system blas status|set implementation for macOS and the related issue #212 to understand current behavior. Then investigate how Windows R installations store the reference BLAS/LAPACK DLLs and how OpenBLAS releases provide replacements. Done means the commands can set OpenBLAS for all or one R version, select a release, restore the original DLLs, and report the active BLAS.

Written by the indexing model from the issue text.

Description

This feature request is related to https://github.com/r-lib/rig/issues/212, which was resolved only for MacOS. I'm happy to work on this feature request as best I can. The context for why I'm making this request is I want to make it easier for Windows users to install OpenBLAS, and I'm increasingly annoyed at hearing about "Python being faster than R" when it's just because NumPy uses OpenBLAS on Windows by default.

Summary

rig system blas status|set currently works only on macOS, where it switches R between the reference BLAS and Apple's Accelerate. On Windows the same commands are hidden and do nothing.

My request is to provide Windows support for switching R's bundled reference BLAS/LAPACK DLLs for OpenBLAS.

Proposed Implementation

OpenBLAS releases include prebuilt DLLs for Windows x64. rig could download that DLL and overwrite R's Rblas.dll and Rlapack.dll; I think that's the way most folks on Windows install OpenBLAS for R, as the alternative is compiling R from source. This GitHub repo is often referred to for how to do that.

The actual user interface in 'rig' could look like the following, building on what is already available for macOS.

rig system blas set openblas            # set for all installed R versions, latest OpenBLAS
rig system blas set openblas 4.5.2      # set for just one R version
rig system blas set openblas --openblas-version 0.3.33 # Specify a specific OpenBLAS version instead of just the latest
rig system blas set reference           # restore R's original DLLs
rig system blas status                  # check which which BLAS is in use

Installing from the OpenBLAS GitHub releases seems to be the best option for obtaining OpenBLAS DLLs on Windows. I looked into using vcpkg, but I think most R users on Windows probably would not have that available.

Dominant language
Rust
Stars
1k
Forks
41
Avg merge
9h 33m
Merged PRs (30d)
17

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from r-lib/rig

All issues in r-lib/rig

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.