You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<details><summary><i>Note if using RStudio terminal, or using Terminal.app on macOS < 10.15 (Catalina)...</i></summary> The code above assumes you are using a Zsh shell (the default on macOS ≥ 10.15). If you are using a bash shell, replace <code>.zprofile</code> with <code>.bash_profile</code>. The type of terminal in RStudio can be set in Terminal Options from the terminal or in Global Options.
49
+
</details>
50
+
</details>
41
51
4. If you have previously installed R on the computer, make your account own the existing R framework folder
Otherwise, download the installer for the latest release of R from CRAN and install with the default settings.
55
+
Otherwise, download the installer for the latest release of R from CRAN and install with the default settings first.
46
56
47
57
### Install prerequisites
48
58
49
-
It is best to install prerequisites before first building R from source,
50
-
even if you think you may have installed some of the prerequisites before.
51
-
52
59
1. Install Xcode Command Line Tools from the terminal
53
60
```{sh}
54
61
xcode-select --install
@@ -69,25 +76,34 @@ install.libs("r-base-dev")
69
76
```{r}
70
77
install.libs("pango")
71
78
```
72
-
6. TODO, guidance for installing MacTex for those that need it
79
+
6. Check if you have a current version of MacTeX installed:
80
+
```{sh}
81
+
ls /usr/local/texlive
82
+
```
83
+
If the `/usr/local/texlive` directory exists, you will see one or more subdirectories named by year, e.g.
84
+
```
85
+
2022 2023 texmf-local
86
+
```
87
+
If this check doesn't show a subdirectory for the current year, install MacTex from the binary at <https://tug.org/mactex/mactex-download.html>.
73
88
7. In the terminal, check if you already have Subversion installed:
74
89
75
90
```{sh}
76
91
which svn
77
92
```
78
93
79
-
This with show a path where Subversion is installed, or `svn not found`.
94
+
This will show a path where Subversion is installed, or `svn not found`.
80
95
If necessary, install Subversion from within R:
81
96
82
97
```{r}
83
98
install.libs("subversion", dep = FALSE)
84
99
```
85
100
86
-
<details><summary>Troubleshooting</summary> If this does not work, try installing via your preferred package manage, e.g. with Homebrew: <code>brew install svn</code>.
101
+
<details><summary><i>Troubleshooting...</i></summary> If this does not work, try installing via your preferred package manage, e.g. with Homebrew: <code>brew install svn</code>.
87
102
</details>
88
103
89
104
8. (Recommended) If you are not already using a tool such as [rig](https://github.com/r-lib/rig)
90
-
to install and manage multiple R versions, install RSwitch from <https://rud.is/rswitch/>.
105
+
to install and manage multiple R versions, install RSwitch from <https://rud.is/rswitch/>. These tools are not part of the R Project, but
106
+
make it easy to switch R versions.
91
107
92
108
[//]: # (
93
109
* Skip readline (use editline)
@@ -105,9 +121,6 @@ dependencies at same time
105
121
106
122
Run the following commands within Terminal.app:
107
123
108
-
<details><summary>Note if you prefer to use an RStudio terminal</summary> The PATH setting in <code>~/.zprofile</code> will only work for a zsh terminal, so you may need to change your Global Options or add the PATH setting to <code>~/.bash_profile</code>
109
-
</details>
110
-
111
124
0. Retrieve R source code into `TOP_SRCDIR`, note that we retrieve the `r-devel` source code:
3. Create `config.site` within the build directory to set some configuration flags as recommended by the [R-admin manual](https://cran.r-project.org/doc/manuals/r-devel/R-admin.html#Prerequisites).
<details><summary>Details</summary> Some modifications to th: `-O0` to enable debugging symbols and disable compiler optimisations for better debugging experience; `-mmacos-version-min` corrected [?] to `-mmacosx-version-min`; `LDFLAGS=-L$LOCAL/lib` added so that liblzma can be found. CPPFLAGS modified for Apple Silicon to link to the headers for liblzma.
163
+
<details><summary><i>Details...</i></summary> Some modifications to the recommendations in R-admin: `-O0` to enable debugging symbols and disable compiler optimisations for better debugging experience; `-mmacos-version-min` corrected [?] to `-mmacosx-version-min`; `LDFLAGS="-L$LOCAL/lib -L/opt/gfortran/lib"` added so that liblzma (in `$LOCAL/lib`) and gfortran libraries can be found. CPPFLAGS modified for Apple Silicon to link to the headers for liblzma.
151
164
</details>
152
165
153
-
4. Configure the R installation with `--enable-R-framework` to install as an application framework so that we can switch between R versions with Rswitch:
166
+
4. Configure the R installation with `--enable-R-framework` to install as an application framework so that we can switch between R versions with RSwitch:
154
167
```{sh}
155
168
"$TOP_SRCDIR/configure" --enable-R-framework
156
169
```
157
-
<details><summary>Details</summary> This assumes you only want to work with one development version of R that will be identified by the Major.Minor version number. To customize the version name use `--enable-R-framework FW=VERSION` where e.g. VERSION=4.4-dev. The compilation options in [R-admin manual](https://cran.r-project.org/doc/manuals/r-devel/R-admin.html#Prerequisites) to define the location of X11 and tcltk libraries do not seem to be necessary.
170
+
<details><summary><i>Working with multiple devel versions...</i></summary> The code above assumes you only want to work with one development version of R that will be identified by the Major.Minor version number. To customize the version name use `--enable-R-framework FW=VERSION` where e.g. `VERSION=4.4-dev`. The configure options in [R-admin manual](https://cran.r-project.org/doc/manuals/r-devel/R-admin.html#Prerequisites) to define the location of X11 and tcltk libraries do not seem to be necessary.
158
171
</details>
159
172
160
173
5. Build R :
@@ -166,7 +179,11 @@ make
166
179
make check
167
180
```
168
181
`make` will exit with an error if there are any problems.
169
-
<details><summary>Note if you are using RStudio terminal</summary> `make check` will fail unless you run `unset R_HOME` first
182
+
<details><summary><i>Note if you are using RStudio terminal...</i></summary> `make check` will fail unless you run `unset R_HOME` first
170
183
</details>
171
-
172
-
The built version of R will now be your default version of R. To switch versions, use RSwitch or rig.
184
+
7. Install the built version of R
185
+
```{sh}
186
+
make install
187
+
```
188
+
189
+
The built version of R will now be your default version of R, which you can start by typing `R` in the terminal, or restarting the R session in RStudio, etc. To switch versions, use RSwitch or rig, then restart your R session.
0 commit comments