Skip to content

Instantly share code, notes, and snippets.

@seananderson
Last active June 11, 2025 22:37
Show Gist options
  • Select an option

  • Save seananderson/3c6cbf640ba566ce936c79442b9a6068 to your computer and use it in GitHub Desktop.

Select an option

Save seananderson/3c6cbf640ba566ce936c79442b9a6068 to your computer and use it in GitHub Desktop.
Link Homebrew OpenBLAS with R BLAS
# Install Homebrew if needed: https://brew.sh/
# Install OpenBLAS with Homebrew:
brew install openblas
# Check the installed location of openblas:
brew --prefix openblas
# For me, that returns:
# /opt/homebrew/opt/openblas
# Now, we need to make a symlink from the openblas library file to the R BLAS library file.
# First switch to the directory with the R BLAS library:
cd /Library/Frameworks/R.framework/Resources/lib/
# Now symlink openblas to the R BLAS library file location:
# If your openblas path was different from mine, replace it in this line:
ln -s -i -v /opt/homebrew/opt/openblas/lib/libopenblas.dylib libRblas.dylib
# When you restart R, it should now call libopenblas.dylib for math
# To switch back
cd /Library/Frameworks/R.framework/Resources/lib/
ln -s -i -v libRblas.0.dylib libRblas.dylib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment