パッケージのインストールの際のgfortranがない問題
作成日: 2025/6/11
renv::restore()で分析環境を再構築しようとしたら,nlmeのパッケージがインストールできないとエラーが出た。gfortranがないと言うので,universal GNU Fortran compilerを以下のサイトからインストール。
https://mac.r-project.org/tools/
最初は14.2をインストールしたのだけど再度エラー。よくよく読むと以下の記述があった。
NOTE: To compile R packages (as opposed to R itself) you have to use the same GNU Fortran which was used to build the R version you are using. For CRAN R releases please refer to the download page of the specific R version to determine the tools required.
私はそのときRの4.4.3を使っておりどうやら,12.2のインストールが必要だったようである。そっちをインストールしたら無事にパッケージはインストールできた。