From afda9f7d46c667682513b223b0acaadd11c638e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Mon, 3 Oct 2022 21:29:35 +0200 Subject: [PATCH 01/10] Installation instructions for Windows --- 02-getting_started.Rmd | 105 ++++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 34 deletions(-) diff --git a/02-getting_started.Rmd b/02-getting_started.Rmd index 2ac7f2cc..70115bf3 100644 --- a/02-getting_started.Rmd +++ b/02-getting_started.Rmd @@ -27,7 +27,7 @@ The `r-devel` at [R/trunk](https://svn.r-project.org/R/trunk "svn devel source c Bug fixes and new features are introduced in `r-devel` first. If the change meets the [development guidelines](https://developer.r-project.org/devel-guidelines.txt) R Core will also make the change in `r-patched`. -## Prerequisites {.tabset} +## Prerequisites To install from the source code you will need the source code and the dependencies of R. @@ -84,12 +84,20 @@ In Ubuntu you can use : ### Windows -Install MSYS and rtools42 +1. [RTools](https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html) is the toolchain bundle that you can use to build R base and R packages containing compiled code, on Windows. + They can be downloaded from [their own page](https://cran.r-project.org/bin/windows/Rtools/rtools42/files/). + +2. You also need a distribution of LaTeX installed for building R and checking packages. + The MiKTeX distribution of LaTeX that is used on CRAN can be downloaded from . + +The latest version of `RTools` can be downloaded from and run in the Windows-style installer. ### macOS -## Building R in Linux +## Building R + +### Linux Here are the basic steps intended as a checklist. For complete instructions please see the section in [R-admin](https://cran.r-project.org/doc/manuals/r-devel/R-admin.html#Installing-R-under-Unix_002dalikes). @@ -122,8 +130,10 @@ For complete instructions please see the section in [R-admin](https://cran.r-pro make check-devel make check-recommended + [^02-getting_started-2]: Recommended packages are not in the subversion repository. + If we don't want to build R in a different directory than the source code we can simply use: cd $TOP_SRCDIR @@ -144,60 +154,81 @@ To use the r-devel version in RStudio to you can do the following: rstudio -## Windows +### Windows + +#### Binaries -### Installing R {#installR} +The latest documentation about installing R and packages from source at the current time can be find [here](https://cran.r-project.org/bin/windows/base/howto-R-4.2.html). 1. The binary builds of R for Windows can be downloaded and installed from [here](https://cran.r-project.org/bin/windows/base/). - Along with the link to the latest stable release, this page also contains links to the binary builds of r-patched and r-devel. + Along with the link to the latest stable release, this page also contains links to the binary builds of `r-patched` and `r-devel`. 2. Click on the download links to download an executable installer. 3. Select the language while installing, read the GNU general public license information, and select the destination location to start the installation. - You will be prompted to select components at this stage: `User installation`, `32-bit User installation`, `64-bit User installation`, or `Custom installation`. + You will be prompted to select components at this stage: `User installation`, `64-bit User installation`, or `Custom installation`. The default option may be chosen for the questions from this step onwards to complete the installation. + +You can also use the [binaries for `r-devel` made available](https://cran.r-project.org/bin/windows/base/rdevel.html) which are not so up to date. -### Building R and R packages +#### From source -#### What tools do you need to build R from source on Windows? +You can download the R sources on Windows . +But if you want to keep up with changes it is recommended to checkout the sources from svn, it is probably best to install an SVN client. +Either TortoiseSVN (, command line tool, and Windows Explorer integration) or SlikSVN (, just the command line tool) is recommended. -1. [RTools](https://github.com/r-windows/docs/blob/master/faq.md#what-is-rtools) is the toolchain bundle that you can use to build R base and R packages containing compiled code, on Windows. +1. Open the Rtools42 terminal, and update and get the tools: -2. You also need a distribution of LaTeX installed for building R and checking packages. - The MiKTeX distribution of LaTeX that is used on CRAN can be downloaded from . + pacman -Syuu + pacman -Sy wget subversion + +2. Download the latest tcl/tk -#### How to setup `RTools`? + wget -np -nd -r -l1 -A 'tcltk-*.zip' https://cran.r-project.org/bin/windows/Rtools/rtools42/files/ + +3. Set environment variables for POSIX, MiKTeX, tar (and one tar option): + + export PATH=/x86_64-w64-mingw32.static.posix/bin:$PATH + export PATH=/c/Program\ Files/MiKTeX/miktex/bin/x64:$PATH + export TAR="/usr/bin/tar" + export TAR_OPTIONS="--force-local" + +4. Check that all the programs can be found: + + which make gcc pdflatex tar + + If there is any error you'll need to find where the program is installed and add the corresponding path. +1. Download the latest recommended packages[^02-getting_started-2]: + + $TOP_SRCDIR/tools/rsync-recommended + +3. Create the build directory in the `BUILDDIR`: -1. The latest version of `RTools` can be downloaded from and run in the Windows-style installer. - You will need to know if you have a 32-bit or 64-bit Windows machine (right-click `This PC` in Windows Explorer and check the properties if you are unsure). + export BUILDDIR="$HOME/bin/R" + mkdir -p $BUILDDIR + cd $BUILDDIR + +4. Configure the R installation (with `--enable-R-shlib` so that RStudio IDE can use it): + + $TOP_SRCDIR/configure --enable-R-shlib + +4. Build R : -2. Don't forget to add `RTools` to the path as documented on the download page. + make -#### How to build R? -To build R for Windows using `RTools` follow the instructions in this [README](https://github.com/r-windows/r-base#readme) file. -There are two options available to build R. -One is the quick development build and the other option is the full installer build. +5. Check that R works as expected: -For development and testing, you need only the quick development build. -The quick build avoids building the manuals, which are generally not needed for development and testing. + make check -However, even for the quick build there are some [default requirements](https://github.com/r-windows/r-base/blob/master/quick-build.sh). -For instance, MikTeX is to be installed in `C:/Program Files` and you have 64-bit R. -If necessary, these defaults can be customised. -The installation path of MikTex can be customised [here](https://github.com/r-windows/r-base/blob/50a229fc76c50a5fb42c0daa367466aaf2318171/quick-build.sh#L13) whereas the Windows bit can be customised [here](https://github.com/r-windows/r-base/blob/50a229fc76c50a5fb42c0daa367466aaf2318171/quick-build.sh#L6). + There are other checks you can run: -If you are a maintainer of the Windows CRAN releases then, the full installer build is available for building the complete installer as it appears on CRAN. -It will build both the 32-bit and 64-bit R, the pdf manuals, and the installer program. -You will use this to create the binary builds and not when building R from the source yourself. + make check-devel + make check-recommended -### How to download the R sources directly or from the svn repository? -- To download the R sources on Windows, you can use `tar` from the RStudio terminal. +### macOS -- If you want to checkout the sources from svn, it is probably best to install an SVN client. - Either TortoiseSVN (, command line tool, and Windows Explorer integration) or SlikSVN (, just the command line tool) is recommended. - They have simple Windows installers and you can use svn straight-away from Windows cmd or RStudio terminal. ## See also @@ -205,6 +236,12 @@ You will use this to create the binary builds and not when building R from the s 2. [R installation and administration manual](https://cran.r-project.org/doc/manuals/r-patched/R-admin.html) +3. [R for macOS](https://mac.r-project.org/) + +3. [Tools for R in macOS](https://mac.r-project.org/tools/) + +3. [R for requirements in macOS](https://mac.r-project.org/src/) + 3. [R for Windows FAQ](https://cran.r-project.org/bin/windows/base/rw-FAQ.html) 4. [Rtools40 manual for Windows](https://cran.r-project.org/bin/windows/Rtools/) From 6d169f73ce239b4f7532eae7cdfa6bacd941a91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Wed, 12 Oct 2022 12:09:55 +0200 Subject: [PATCH 02/10] Address most of the suggestions from Heather's review --- 02-getting_started.Rmd | 61 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/02-getting_started.Rmd b/02-getting_started.Rmd index 70115bf3..61a11323 100644 --- a/02-getting_started.Rmd +++ b/02-getting_started.Rmd @@ -34,7 +34,7 @@ To install from the source code you will need the source code and the dependenci Retrieve R source code via into `TOP_SRCDIR`, note that we retrieve the r-devel source code: export TOP_SRCDIR="$HOME/Downloads/R" - svn checkout https://svn.r-project.org/R/trunk/ $TOP_SRCDIR + svn checkout https://svn.r-project.org/R/trunk/ "$TOP_SRCDIR" If you need to install svn you can use your distribution's package manager to install it. @@ -84,13 +84,14 @@ In Ubuntu you can use : ### Windows -1. [RTools](https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html) is the toolchain bundle that you can use to build R base and R packages containing compiled code, on Windows. - They can be downloaded from [their own page](https://cran.r-project.org/bin/windows/Rtools/rtools42/files/). +1. [Rtools](https://cran.r-project.org/bin/windows/Rtools/) is the toolchain bundle that you can use to build R base and R packages containing compiled code, on Windows. + The latest [version Rtools42](https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html) can be installed using the [Rtools installer rtools42-XXXX-XXX.exe ](https://cran.r-project.org/bin/windows/Rtools/rtools42/files/). + +2. A LaTeX compilers is needed to install and building R, check packages and build manuals. + The MiKTeX distribution of LaTeX that is used on CRAN can be downloaded from . + Once installed open it via the windows start menu. + It might ask to check for updates and, most importantly, to make it available in the PATH; accept both. -2. You also need a distribution of LaTeX installed for building R and checking packages. - The MiKTeX distribution of LaTeX that is used on CRAN can be downloaded from . - -The latest version of `RTools` can be downloaded from and run in the Windows-style installer. ### macOS @@ -109,12 +110,12 @@ For complete instructions please see the section in [R-admin](https://cran.r-pro 3. Create the build directory in the `BUILDDIR`: export BUILDDIR="$HOME/bin/R" - mkdir -p $BUILDDIR - cd $BUILDDIR + mkdir -p "$BUILDDIR" + cd "$BUILDDIR" 4. Configure the R installation (with `--enable-R-shlib` so that RStudio IDE can use it): - $TOP_SRCDIR/configure --enable-R-shlib + "$TOP_SRCDIR/configure" --enable-R-shlib 4. Build R : @@ -136,10 +137,10 @@ For complete instructions please see the section in [R-admin](https://cran.r-pro If we don't want to build R in a different directory than the source code we can simply use: - cd $TOP_SRCDIR + cd "$TOP_SRCDIR" svn update tools/rsync-recommended - $TOP_SRCDIR/configure --enable-R-shlib + "$TOP_SRCDIR/configure" --enable-R-shlib make make check @@ -150,7 +151,7 @@ Once you successfully build R from source you can modify R source code to fix an To use the r-devel version in RStudio to you can do the following: export RSTUIDO_WHICH_R="$BUILDDIR/bin/R" - cd $TOP_SRCDIR + cd "$TOP_SRCDIR" rstudio @@ -158,7 +159,7 @@ To use the r-devel version in RStudio to you can do the following: #### Binaries -The latest documentation about installing R and packages from source at the current time can be find [here](https://cran.r-project.org/bin/windows/base/howto-R-4.2.html). +We can follow the [latest documentation](https://cran.r-project.org/bin/windows/base/howto-R-4.2.html) about installing R and packages from source: 1. The binary builds of R for Windows can be downloaded and installed from [here](https://cran.r-project.org/bin/windows/base/). Along with the link to the latest stable release, this page also contains links to the binary builds of `r-patched` and `r-devel`. @@ -169,7 +170,7 @@ The latest documentation about installing R and packages from source at the curr You will be prompted to select components at this stage: `User installation`, `64-bit User installation`, or `Custom installation`. The default option may be chosen for the questions from this step onwards to complete the installation. -You can also use the [binaries for `r-devel` made available](https://cran.r-project.org/bin/windows/base/rdevel.html) which are not so up to date. +Daily binaries for `r-devel` are made available for [download and installation](https://cran.r-project.org/bin/windows/base/rdevel.html). #### From source @@ -182,11 +183,13 @@ Either TortoiseSVN (, command line tool, and Windows E pacman -Syuu pacman -Sy wget subversion -2. Download the latest tcl/tk +2. Download the latest tcl/tk and unzip it in `$TOP_SRCDIR`: + cd "$TOP_SRCDIR" wget -np -nd -r -l1 -A 'tcltk-*.zip' https://cran.r-project.org/bin/windows/Rtools/rtools42/files/ + unzip "tcltk-*.zip" -3. Set environment variables for POSIX, MiKTeX, tar (and one tar option): +3. Set environment variables for gcc, POSIX, MiKTeX, tar and one tar option: export PATH=/x86_64-w64-mingw32.static.posix/bin:$PATH export PATH=/c/Program\ Files/MiKTeX/miktex/bin/x64:$PATH @@ -198,24 +201,20 @@ Either TortoiseSVN (, command line tool, and Windows E which make gcc pdflatex tar If there is any error you'll need to find where the program is installed and add the corresponding path. + 1. Download the latest recommended packages[^02-getting_started-2]: - $TOP_SRCDIR/tools/rsync-recommended - -3. Create the build directory in the `BUILDDIR`: - - export BUILDDIR="$HOME/bin/R" - mkdir -p $BUILDDIR - cd $BUILDDIR + cd "$TOP_SRCDIR/src/gnuwin32/" + "$TOP_SRCDIR/tools/rsync-recommended" -4. Configure the R installation (with `--enable-R-shlib` so that RStudio IDE can use it): - - $TOP_SRCDIR/configure --enable-R-shlib - -4. Build R : - - make + This is equivalent of using `make rsync-recommended`. +3. Build R and the recommended files: + + make all recommended + + The recently compiled version of R will be at `$TOP_SRCDIR/bin/`. + In RStudio you can select that folder and restart it to use the r-devel version. 5. Check that R works as expected: From e57034988228485ad72934e31042fdcc75e6cff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Wed, 12 Oct 2022 12:40:16 +0200 Subject: [PATCH 03/10] Improve formatting and "fix" numbered list --- 02-getting_started.Rmd | 204 ++++++++++++++++++++++++----------------- 1 file changed, 120 insertions(+), 84 deletions(-) diff --git a/02-getting_started.Rmd b/02-getting_started.Rmd index 61a11323..c7fefb35 100644 --- a/02-getting_started.Rmd +++ b/02-getting_started.Rmd @@ -33,8 +33,10 @@ To install from the source code you will need the source code and the dependenci Retrieve R source code via into `TOP_SRCDIR`, note that we retrieve the r-devel source code: - export TOP_SRCDIR="$HOME/Downloads/R" - svn checkout https://svn.r-project.org/R/trunk/ "$TOP_SRCDIR" +```sh +export TOP_SRCDIR="$HOME/Downloads/R" +svn checkout https://svn.r-project.org/R/trunk/ "$TOP_SRCDIR" +``` If you need to install svn you can use your distribution's package manager to install it. @@ -42,45 +44,47 @@ If you need to install svn you can use your distribution's package manager to in In Ubuntu you can use : - sudo apt-get install -y \ - subversion \ - autoconf \ - automake \ - autopoint \ - bash \ - bison \ - bzip2 \ - flex \ - g++ \ - g++-multilib \ - gettext \ - git \ - gperf \ - intltool \ - libc6-dev-i386 \ - libgdk-pixbuf2.0-dev \ - libltdl-dev \ - libssl-dev \ - libtool-bin \ - libxml-parser-perl \ - lzip \ - make \ - openssl \ - p7zip-full \ - patch \ - perl \ - python3 \ - python3-mako \ - python3-setuptools \ - python \ - ruby \ - sed \ - unzip \ - wget \ - xz-utils \ - texinfo \ - sqlite3 \ - zstd +```sh +sudo apt-get install -y \ + subversion \ + autoconf \ + automake \ + autopoint \ + bash \ + bison \ + bzip2 \ + flex \ + g++ \ + g++-multilib \ + gettext \ + git \ + gperf \ + intltool \ + libc6-dev-i386 \ + libgdk-pixbuf2.0-dev \ + libltdl-dev \ + libssl-dev \ + libtool-bin \ + libxml-parser-perl \ + lzip \ + make \ + openssl \ + p7zip-full \ + patch \ + perl \ + python3 \ + python3-mako \ + python3-setuptools \ + python \ + ruby \ + sed \ + unzip \ + wget \ + xz-utils \ + texinfo \ + sqlite3 \ + zstd +``` ### Windows @@ -105,31 +109,43 @@ For complete instructions please see the section in [R-admin](https://cran.r-pro 1. Download the latest recommended packages[^02-getting_started-2]: - $TOP_SRCDIR/tools/rsync-recommended + ```sh + "$TOP_SRCDIR/tools/rsync-recommended" + ``` 3. Create the build directory in the `BUILDDIR`: - export BUILDDIR="$HOME/bin/R" - mkdir -p "$BUILDDIR" - cd "$BUILDDIR" + ```sh + export BUILDDIR="$HOME/bin/R" + mkdir -p "$BUILDDIR" + cd "$BUILDDIR" + ``` 4. Configure the R installation (with `--enable-R-shlib` so that RStudio IDE can use it): - "$TOP_SRCDIR/configure" --enable-R-shlib + ```sh + "$TOP_SRCDIR/configure" --enable-R-shlib + ``` 4. Build R : - make + ```sh + make + ``` 5. Check that R works as expected: - make check + ```sh + make check + ``` There are other checks you can run: - make check-devel - make check-recommended + ```sh + make check-devel + make check-recommended + ``` [^02-getting_started-2]: Recommended packages are not in the subversion repository. @@ -137,12 +153,14 @@ For complete instructions please see the section in [R-admin](https://cran.r-pro If we don't want to build R in a different directory than the source code we can simply use: - cd "$TOP_SRCDIR" - svn update - tools/rsync-recommended - "$TOP_SRCDIR/configure" --enable-R-shlib - make - make check +```sh +cd "$TOP_SRCDIR" +svn update +tools/rsync-recommended +"$TOP_SRCDIR/configure" --enable-R-shlib +make +make check +``` Once you successfully build R from source you can modify R source code to fix an issue: Prepare a patch (See [this guide](https://www.r-project.org/bugs.html#how-to-submit-patches)) and after checking that R works as intended (`make check-devel`) submit the patch for the R core consideration. (See the [lifecycle of a patch](#FixBug) chapter). @@ -150,9 +168,11 @@ Once you successfully build R from source you can modify R source code to fix an To use the r-devel version in RStudio to you can do the following: - export RSTUIDO_WHICH_R="$BUILDDIR/bin/R" - cd "$TOP_SRCDIR" - rstudio +```sh +export RSTUIDO_WHICH_R="$BUILDDIR/bin/R" +cd "$TOP_SRCDIR" +rstudio +``` ### Windows @@ -180,50 +200,66 @@ Either TortoiseSVN (, command line tool, and Windows E 1. Open the Rtools42 terminal, and update and get the tools: - pacman -Syuu - pacman -Sy wget subversion - + ```sh + pacman -Syuu + pacman -Sy wget subversion + ``` + 2. Download the latest tcl/tk and unzip it in `$TOP_SRCDIR`: - cd "$TOP_SRCDIR" - wget -np -nd -r -l1 -A 'tcltk-*.zip' https://cran.r-project.org/bin/windows/Rtools/rtools42/files/ - unzip "tcltk-*.zip" - + ```sh + cd "$TOP_SRCDIR" + wget -np -nd -r -l1 -A 'tcltk-*.zip' https://cran.r-project.org/bin/windows/Rtools/rtools42/files/ + unzip "tcltk-*.zip" + ``` + 3. Set environment variables for gcc, POSIX, MiKTeX, tar and one tar option: - export PATH=/x86_64-w64-mingw32.static.posix/bin:$PATH - export PATH=/c/Program\ Files/MiKTeX/miktex/bin/x64:$PATH - export TAR="/usr/bin/tar" - export TAR_OPTIONS="--force-local" + ```sh + export PATH=/x86_64-w64-mingw32.static.posix/bin:$PATH + export PATH=/c/Program\ Files/MiKTeX/miktex/bin/x64:$PATH + export TAR="/usr/bin/tar" + export TAR_OPTIONS="--force-local" + ``` 4. Check that all the programs can be found: - which make gcc pdflatex tar - + ```sh + which make gcc pdflatex tar + ``` + If there is any error you'll need to find where the program is installed and add the corresponding path. -1. Download the latest recommended packages[^02-getting_started-2]: +5. Download the latest recommended packages[^02-getting_started-2]: + + ```sh + cd "$TOP_SRCDIR/src/gnuwin32/" + "$TOP_SRCDIR/tools/rsync-recommended" + ``` - cd "$TOP_SRCDIR/src/gnuwin32/" - "$TOP_SRCDIR/tools/rsync-recommended" - This is equivalent of using `make rsync-recommended`. -3. Build R and the recommended files: - - make all recommended - +6. Build R and the recommended files: + + ```sh + make all recommended + ``` + The recently compiled version of R will be at `$TOP_SRCDIR/bin/`. In RStudio you can select that folder and restart it to use the r-devel version. -5. Check that R works as expected: +7. Check that R works as expected: - make check + ```sh + make check + ``` There are other checks you can run: - make check-devel - make check-recommended + ```sh + make check-devel + make check-recommended + ``` ### macOS From cd9b9b174e73d0aa3b859cd89c989b831eb11ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Tue, 25 Oct 2022 23:44:08 +0200 Subject: [PATCH 04/10] Remove version number This way the command can be directly copied and used --- 02-getting_started.Rmd | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/02-getting_started.Rmd b/02-getting_started.Rmd index 1d9ed80e..c8efbe1b 100644 --- a/02-getting_started.Rmd +++ b/02-getting_started.Rmd @@ -49,11 +49,11 @@ In Ubuntu you can use : sudo apt-get install -y \ bash-completion \ bison \ - debhelper-compat (= 11) \ + debhelper-compat \ default-jdk \ - g++ (>= 4:4.9.2-2) \ - gcc (>= 4:4.9.2-2) \ - gfortran (>= 4:4.9.2-2) \ + g++ \ + gcc \ + gfortran \ groff-base \ libblas-dev \ libbz2-dev \ @@ -74,7 +74,7 @@ sudo apt-get install -y \ libxt-dev \ mpack \ tcl8.6-dev \ - texinfo (>= 4.1-2) \ + texinfo \ texlive-base \ texlive-extra-utils \ texlive-fonts-extra \ @@ -89,8 +89,7 @@ sudo apt-get install -y \ xdg-utils \ xfonts-base \ xvfb \ - zlib1g-dev - zstd + zlib1g-dev ``` ### Windows From d52cdc1b16390d19e5b565d07176c5010f9592f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Sat, 5 Nov 2022 13:54:55 +0100 Subject: [PATCH 05/10] Update the window's instructions using svn --- 02-getting_started.Rmd | 84 +++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/02-getting_started.Rmd b/02-getting_started.Rmd index c8efbe1b..e6c2ea6e 100644 --- a/02-getting_started.Rmd +++ b/02-getting_started.Rmd @@ -31,13 +31,6 @@ If the change meets the [development guidelines](https://developer.r-project.org To install from the source code you will need the source code and the dependencies of R. -Retrieve R source code via into `TOP_SRCDIR`, note that we retrieve the r-devel source code: - -```sh -export TOP_SRCDIR="$HOME/Downloads/R" -svn checkout https://svn.r-project.org/R/trunk/ "$TOP_SRCDIR" -``` - If you need to install svn you can use your distribution's package manager to install it. ### Ubuntu @@ -92,20 +85,6 @@ sudo apt-get install -y \ zlib1g-dev ``` -### Windows - -1. [Rtools](https://cran.r-project.org/bin/windows/Rtools/) is the toolchain bundle that you can use to build R base and R packages containing compiled code, on Windows. - The latest [version Rtools42](https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html) can be installed using the [Rtools installer rtools42-XXXX-XXX.exe ](https://cran.r-project.org/bin/windows/Rtools/rtools42/files/). - -2. A LaTeX compilers is needed to install and building R, check packages and build manuals. - The MiKTeX distribution of LaTeX that is used on CRAN can be downloaded from . - Once installed open it via the windows start menu. - It might ask to check for updates and, most importantly, to make it available in the PATH; accept both. - - -### macOS - - ## Building R ### Linux @@ -113,6 +92,13 @@ sudo apt-get install -y \ Here are the basic steps intended as a checklist. For complete instructions please see the section in [R-admin](https://cran.r-project.org/doc/manuals/r-devel/R-admin.html#Installing-R-under-Unix_002dalikes). +0. Retrieve R source code via into `TOP_SRCDIR`, note that we retrieve the `r-devel` source code: + + ```sh + export TOP_SRCDIR="$HOME/Downloads/R" + svn checkout https://svn.r-project.org/R/trunk/ "$TOP_SRCDIR" + ``` + 1. Download the latest recommended packages[^02-getting_started-2]: ```sh @@ -172,7 +158,7 @@ Once you successfully build R from source you can modify R source code to fix an (See the [lifecycle of a patch](#FixBug) chapter). -To use the r-devel version in RStudio to you can do the following: +To use the `r-devel` version in RStudio to you can do the following: ```sh export RSTUIDO_WHICH_R="$BUILDDIR/bin/R" @@ -185,14 +171,12 @@ rstudio #### Binaries -We can follow the [latest documentation](https://cran.r-project.org/bin/windows/base/howto-R-4.2.html) about installing R and packages from source: +The binary builds of R for Windows can be downloaded and installed from [here](https://cran.r-project.org/bin/windows/base/). +Along with the link to the latest stable release, this page also contains links to the binary builds of `r-patched` and `r-devel`. -1. The binary builds of R for Windows can be downloaded and installed from [here](https://cran.r-project.org/bin/windows/base/). - Along with the link to the latest stable release, this page also contains links to the binary builds of `r-patched` and `r-devel`. +1. Click on the download links to download an executable installer. -2. Click on the download links to download an executable installer. - -3. Select the language while installing, read the GNU general public license information, and select the destination location to start the installation. +2. Select the language while installing, read the GNU general public license information, and select the destination location to start the installation. You will be prompted to select components at this stage: `User installation`, `64-bit User installation`, or `Custom installation`. The default option may be chosen for the questions from this step onwards to complete the installation. @@ -200,9 +184,15 @@ Daily binaries for `r-devel` are made available for [download and installation]( #### From source -You can download the R sources on Windows . -But if you want to keep up with changes it is recommended to checkout the sources from svn, it is probably best to install an SVN client. -Either TortoiseSVN (, command line tool, and Windows Explorer integration) or SlikSVN (, just the command line tool) is recommended. +Before installing R from source it some programs are needed, as per the [latest documentation](https://cran.r-project.org/bin/windows/base/howto-R-4.2.html): + +1. [Rtools](https://cran.r-project.org/bin/windows/Rtools/) is the toolchain bundle that you can use to build R base and R packages containing compiled code, on Windows. + The latest [version Rtools42](https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html) can be installed using the [Rtools installer rtools42-XXXX-XXX.exe ](https://cran.r-project.org/bin/windows/Rtools/rtools42/files/). + +2. A LaTeX compilers is needed to install and building R, check packages and build manuals. + The MiKTeX distribution of LaTeX that is used on CRAN can be downloaded from . + Once installed open it via the windows start menu. + It might ask to check for updates and, most importantly, to make it available in the PATH; accept both. 1. Open the Rtools42 terminal, and update and get the tools: @@ -210,6 +200,22 @@ Either TortoiseSVN (, command line tool, and Windows E pacman -Syuu pacman -Sy wget subversion ``` + +3. Retrieve the latest source code via subversion: + + ```sh + export TOP_SRCDIR="$HOME/Downloads/R" + svn checkout https://svn.r-project.org/R/trunk/ "$TOP_SRCDIR" + ``` + + If you already have it you should update it with : + + ```sh + cd $TOP_SRCDIR + svn update + ``` + + You can also use a SVN client such as TortoiseSVN (, command line tool, and Windows Explorer integration) or SlikSVN (, just the command line tool) so that it can be also found by other tools. 2. Download the latest tcl/tk and unzip it in `$TOP_SRCDIR`: @@ -219,15 +225,21 @@ Either TortoiseSVN (, command line tool, and Windows E unzip "tcltk-*.zip" ``` -3. Set environment variables for gcc, POSIX, MiKTeX, tar and one tar option: +3. Add gcc, MiKTeX and tar to the path and set one tar option: ```sh - export PATH=/x86_64-w64-mingw32.static.posix/bin:$PATH - export PATH=/c/Program\ Files/MiKTeX/miktex/bin/x64:$PATH + export PATH="/x86_64-w64-mingw32.static.posix/bin:$PATH" + export PATH="/c/Program\ Files/MiKTeX/miktex/bin/x64:$PATH" export TAR="/usr/bin/tar" export TAR_OPTIONS="--force-local" ``` + If MiKTeX was installed just for your user you might need to run: + + ```sh + export PATH="/c/Users/$USER/AppData/Local/Programs/MiKTeX/miktex/bin/x64:$PATH" + ``` + 4. Check that all the programs can be found: ```sh @@ -243,8 +255,6 @@ Either TortoiseSVN (, command line tool, and Windows E "$TOP_SRCDIR/tools/rsync-recommended" ``` - This is equivalent of using `make rsync-recommended`. - 6. Build R and the recommended files: ```sh @@ -252,7 +262,7 @@ Either TortoiseSVN (, command line tool, and Windows E ``` The recently compiled version of R will be at `$TOP_SRCDIR/bin/`. - In RStudio you can select that folder and restart it to use the r-devel version. + In RStudio you can select that folder and restart it to use the `r-devel` version. 7. Check that R works as expected: From 2d3d2b2a4cf669c6fc49a55c61ca9450475a16c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Sat, 5 Nov 2022 14:47:48 +0100 Subject: [PATCH 06/10] Add Fedora dependencies --- 02-getting_started.Rmd | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/02-getting_started.Rmd b/02-getting_started.Rmd index e6c2ea6e..1fc6df5b 100644 --- a/02-getting_started.Rmd +++ b/02-getting_started.Rmd @@ -85,6 +85,49 @@ sudo apt-get install -y \ zlib1g-dev ``` +### Fedora + + +In Fedora you can use: + +```sh +sudo dnf install \ + autoconf \ + automake \ + bzip2-devel \ + cairo-devel \ + flexiblas-devel \ + gcc-c++ \ + gcc-gfortran \ + java-headless \ + less \ + libICE-devel \ + libSM-devel \ + libX11-devel \ + libXmu-devel \ + libXt-devel \ + libcurl-devel \ + libicu-devel \ + libjpeg-devel \ + libpng-devel \ + libtiff-devel \ + libtool \ + ncurses-devel \ + pango-devel \ + pcre2-devel \ + readline-devel \ + tcl-devel \ + tex(inconsolata.sty) \ + tex(latex) \ + tex(upquote.sty) \ + texinfo-tex \ + tk-devel \ + tre-devel \ + valgrind-devel \ + xz-devel \ + zlib-devel +``` + ## Building R ### Linux From 39025e95c8f05791e2a5912d42b06128fbae4fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Sat, 5 Nov 2022 16:11:17 +0100 Subject: [PATCH 07/10] Address @Enchufa2 feedback and updates --- 02-getting_started.Rmd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/02-getting_started.Rmd b/02-getting_started.Rmd index 1fc6df5b..886be6f5 100644 --- a/02-getting_started.Rmd +++ b/02-getting_started.Rmd @@ -91,7 +91,7 @@ sudo apt-get install -y \ In Fedora you can use: ```sh -sudo dnf install \ +sudo dnf install -y \ autoconf \ automake \ bzip2-devel \ @@ -99,7 +99,7 @@ sudo dnf install \ flexiblas-devel \ gcc-c++ \ gcc-gfortran \ - java-headless \ + java-devel \ less \ libICE-devel \ libSM-devel \ @@ -117,10 +117,10 @@ sudo dnf install \ pcre2-devel \ readline-devel \ tcl-devel \ - tex(inconsolata.sty) \ - tex(latex) \ - tex(upquote.sty) \ - texinfo-tex \ + 'tex(inconsolata.sty)' \ + 'tex(latex)' \ + 'tex(upquote.sty)' \ + 'texinfo-tex' \ tk-devel \ tre-devel \ valgrind-devel \ From af8d39266ab580a6baad5e55f6ceb94cf58f22ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Sat, 5 Nov 2022 17:46:58 +0100 Subject: [PATCH 08/10] Removing unnecessary quotes --- 02-getting_started.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02-getting_started.Rmd b/02-getting_started.Rmd index 886be6f5..30fe4723 100644 --- a/02-getting_started.Rmd +++ b/02-getting_started.Rmd @@ -120,7 +120,7 @@ sudo dnf install -y \ 'tex(inconsolata.sty)' \ 'tex(latex)' \ 'tex(upquote.sty)' \ - 'texinfo-tex' \ + texinfo-tex \ tk-devel \ tre-devel \ valgrind-devel \ From 0c768d9c17c55f3a95c7bf0f78e51a4f9a1cd1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Sat, 26 Nov 2022 12:01:30 +0100 Subject: [PATCH 09/10] Add rsync for download the recommended packages --- 02-getting_started.Rmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/02-getting_started.Rmd b/02-getting_started.Rmd index 30fe4723..71735f4c 100644 --- a/02-getting_started.Rmd +++ b/02-getting_started.Rmd @@ -66,6 +66,7 @@ sudo apt-get install -y \ libx11-dev \ libxt-dev \ mpack \ + rsync \ tcl8.6-dev \ texinfo \ texlive-base \ @@ -116,6 +117,7 @@ sudo dnf install -y \ pango-devel \ pcre2-devel \ readline-devel \ + rsync \ tcl-devel \ 'tex(inconsolata.sty)' \ 'tex(latex)' \ From 042b3b310ebd775a138c7c6afb38e20715a002fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Sat, 26 Nov 2022 12:04:36 +0100 Subject: [PATCH 10/10] Add some comments about how the list where obtained --- 02-getting_started.Rmd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/02-getting_started.Rmd b/02-getting_started.Rmd index 71735f4c..f87fe069 100644 --- a/02-getting_started.Rmd +++ b/02-getting_started.Rmd @@ -37,6 +37,7 @@ If you need to install svn you can use your distribution's package manager to in In Ubuntu you can use : + ```sh sudo apt-get install -y \ @@ -89,6 +90,8 @@ sudo apt-get install -y \ ### Fedora + + In Fedora you can use: ```sh