LoginSignup
7
8

More than 5 years have passed since last update.

Mac に OpenBLAS 版の R をインストールする

Posted at

Mac では、Homebrew を使うことで OpenBLAS 版の R を簡単にインストールできます。インストール手順は次の3ステップです。

  1. homebrew/science を tap する
  2. OpenBLAS をソースからインストールする
  3. R をインストールする

homebrew/science を tap する

OpenBLAS と R は homebrew/science tap に含まれるので、先にこの tap を導入する必要があります。

$ brew tap homebrew/science

OpenBLAS をソースからインストールする

openblas パッケージは bottle 化されているようです。そのため普通に brew install すると自分の Mac に最適化できません。次のように --build-from-source オプションを指定して、ソースからビルドしましょう。

$ brew install openblas --build-from-source

R をインストールする

$ brew install r --with-openblas

これだけです。簡単でしょう。

一応、確認する

$ otool -L /usr/local/opt/r/lib/libR.dylib | grep -e blas
        /usr/local/opt/openblas/lib/libopenblas_haswellp-r0.2.13.dylib (compatibility version 0.0.0, current version 0.0.0)

ちゃんと使われてますね。

まとめ

Mac では OpenBLAS 版の R を簡単に導入できるので今すぐやろう。

7
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
8