Skip to content

Commit

Permalink
Updating Macos instructions. Fixes #27
Browse files Browse the repository at this point in the history
  • Loading branch information
schuemie committed Nov 24, 2023
1 parent d39c281 commit cc860d7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
17 changes: 12 additions & 5 deletions Rmd/rSetup.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,23 @@ We will need to install C and Fortran compilers in order to build R packages fro
1. Open the App Store in Mac OS and install Xcode. Xcode is a large program. If disk space is scarce you could also try only installing Xcode command line tools by following the instructions [here](https://railsapps.github.io/xcode-command-line-tools.html). Verify that the C compiler gcc is installed by opening the terminal and running the command `clang`. You should see an error that says "no input files".
2. Download and install the gfortran compiler .dmg from <https://github.com/fxcoudert/gfortran-for-macOS/releases>. Choose the latest version that is compatible with your operating system. Verify the installation by opening the terminal and running the command `gfortran`. You should see an error that says "no input files".
2. Download and install the gfortran compiler `gfortran-12.2-universal.pkg` from <https://cran.r-project.org/bin/macosx/tools/>. Verify the installation by opening the terminal and running the command `/opt/gfortran/bin/gfortran`. You should see an error that says "no input files". R 4.2.3 will look in the wrong place for gfortran, so you must point it to the right location. Run `usethis::edit_r_makevars()` to open `~.R/Makevars` and add:
```{r, eval=FALSE}
F77 = /opt/gfortran/bin/gfortran
FC = /opt/gfortran/bin/gfortran
FLIBS=-L /opt/gfortran/lib
```
3. Go to <https://www.xquartz.org/>, download the .dmg and run the installer.
4. Verify that build tools are installed and available by opening an R console and running
```{r, eval=FALSE}
install.packages("pkgbuild")
pkgbuild::check_build_tools()
```
```{r, eval=FALSE}
install.packages("pkgbuild")
pkgbuild::check_build_tools()
```
## Installing RStudio
Expand Down
27 changes: 17 additions & 10 deletions docs/rSetup.html
Original file line number Diff line number Diff line change
Expand Up @@ -566,21 +566,28 @@ <h2>Installing R build tools</h2>
Verify that the C compiler gcc is installed by opening the terminal and
running the command <code>clang</code>. You should see an error that
says “no input files”.</p></li>
<li><p>Download and install the gfortran compiler .dmg from <a
href="https://github.com/fxcoudert/gfortran-for-macOS/releases"
class="uri">https://github.com/fxcoudert/gfortran-for-macOS/releases</a>.
Choose the latest version that is compatible with your operating system.
Verify the installation by opening the terminal and running the command
<code>gfortran</code>. You should see an error that says “no input
files”.</p></li>
<li><p>Download and install the gfortran compiler
<code>gfortran-12.2-universal.pkg</code> from <a
href="https://cran.r-project.org/bin/macosx/tools/"
class="uri">https://cran.r-project.org/bin/macosx/tools/</a>. Verify the
installation by opening the terminal and running the command
<code>/opt/gfortran/bin/gfortran</code>. You should see an error that
says “no input files”. R 4.2.3 will look in the wrong place for
gfortran, so you must point it to the right location. Run
<code>usethis::edit_r_makevars()</code> to open
<code>~.R/Makevars</code> and add:</p>
<pre class="r"><code>F77 = /opt/gfortran/bin/gfortran
FC = /opt/gfortran/bin/gfortran

FLIBS=-L /opt/gfortran/lib</code></pre></li>
<li><p>Go to <a href="https://www.xquartz.org/"
class="uri">https://www.xquartz.org/</a>, download the .dmg and run the
installer.</p></li>
<li><p>Verify that build tools are installed and available by opening an
R console and running</p></li>
</ol>
R console and running</p>
<pre class="r"><code>install.packages(&quot;pkgbuild&quot;)
pkgbuild::check_build_tools()</code></pre>
pkgbuild::check_build_tools()</code></pre></li>
</ol>
</div>
<div id="installing-rstudio-1" class="section level2">
<h2>Installing RStudio</h2>
Expand Down

0 comments on commit cc860d7

Please sign in to comment.