class: center, middle, inverse, title-slide #
A preview of Rtools 4.0
##
rstudio::conf(2019L)
###
Jeroen Ooms
###
2019/01/18
--- # Hello World ![team](team.png) --- background-image: url(unconf.jpg) background-position: 50% 50% background-size: 100% # The rOpenSci (extended) Family --- # CRAN Packages [![pkgscreen](packages2.png)](https://cran.r-project.org/web/checks/check_results_jeroen_at_berkeley.edu.html) --- background-image: url(screen3.png) background-position: 50% 100% background-size: 100% # Maintainer of Windows Installers --- class: inverse, center, middle # PART I: Status Quo of Rtools --- # What is Rtools -- Windows does not have a native compiler or package manager: <table> <tr> <th></th> <th>Native Compiler</th> <th>Package Manager</th> <th>Linking</th> </tr> <tr> <th>Linux</th> <td>yes</td> <td>yes</td> <td>dynamic</td> </tr> <tr> <th>MacOS</th> <td>yes</td> <td style="color: red;">no</td> <td>static</td> <td></td> </tr> <tr"> <th>Windows</th> <td style="color: red;">no</td> <td style="color: red;">no</td> <td>static</td> </tr> </table> So we need to provide our own. --- # What is Rtools ![rtools-download](rtools-download.png) --- background-image: url(rtools2.png) background-position: 50% 50% background-size: 100% # What is Rtools --- # What is Rtools Rtools is the official R for Windows toolchain bundle with: - Mingw-w64 toolchains with `gcc 4.9.3` targeting both 32 and 64 bit - Build utilities: `make`, `bash`, `tar`, etc - Stuff for building base R: `TexInfo`, `TclTk`, `ICU` -- You need Rtools to build: -- - Base R -- - R packages with C/C++/Fortran code -- - __External libraries used by R and packages__ --- background-image: url(diagram2.png) background-position: 50% 50% background-size: 75% # On System Dependencies --- # The rwinlib Organization ![rwinlib](rwinlib.png) --- # The rwinlib Organization Manually maintaining the rwinlib builds is currently a lot of work. -- Currently package authors need to manually download these libs during build. -- For the new Rtools we want to: - Take advantage of existing building and packaging tools from msys2 - Automate the build and release process for libraries - Community maintained packaging scripts --- class: inverse, center, middle # PART II: Rtools 4.0 --- # Using Rtools 4.0 A beta version of rtools 4.0 and a version of R that has been configured for rtools40 is available from CRAN: [![rtoolscran](rtoolscran.png)](https://cloud.r-project.org/bin/windows/testing/rtools40.html) --- background-image: url(startmenu.png) background-position: 50% 100% background-size: 100% # Using Rtools 4.0 --- # Using Rtools 4.0 <br /> ![rtools40](rtools40.png) --- # What's included? Rtools 4.0 is a full unix-like environment based on msys2 (cygwin): -- - terminal: (mintty) - shell (bash) - make, sed, perl, etc - mingw-w64 compilers targeting i686 and x86_84 -- - __a package manager to build and install anything else: pacman__ --- # Using Pacman Pacman is a port of the arch package manager. Some examples: ```r # Sync repository index pacman -Sy # Upgrade installed packages pacman -Su ``` To install new packages (for example libxml2) ```r # Install both 32 and 64 bit build of libxm2 pacman -S mingw-w64-{i686,x86_64}-libxml2 ``` More examples: https://cloud.r-project.org/bin/windows/testing/rtools40.html --- # Installing Libraries with Pacman <video id="rtoolsvideo" class="fullscreenvideo" controls> <source src="rtools-fast.mp4" type="video/mp4"> Your browser does not support the video tag. </video> --- # Pacman Package Formulas for Rtools 4.0 ![rtools-packages](rtools-packages.png) --- # Rtools 4.0 Package Format ![arrow-pkgbuild](arrow-pkgbuild.png) --- # Building a Package in Rtools 4.0 <video id="rtoolscmake" class="fullscreenvideo" controls> <source src="cmake-fast.mp4" type="video/mp4"> Your browser does not support the video tag. </video> --- # Automatic Building on AppVeyor ![appveyor-status](appveyor-status.png) --- # Automatic Building on AppVeyor ![rtoolsav](rtoolsav.png) --- # Automatic Deployment to Bintray ![appveyor-log](appveyor-log.png) --- # The Rtools 4.0 Binary Repository ![appveyor-deploy](appveyor-deploy.png) --- # Package is now live! Now in Rtools 4.0 when users do: ```r pacman -Syu ``` It will automatically update to the new Rtools 4.0 build. -- RTools will automaticaly find the new libraries when building R package. No need to manually download and copy system libs and pass special compiler / linker flags. Should feel much more like `apt` / `yum` / `brew`, where external libraries needed for building R packages can be installed from the command line, and it just works. --- # Recap In Summary: - Rtools as proper __build__ environment and package manager for __external libs__. - Pacman allows for __packaging, distributing and installing__ libs, same as Linux, Homebrew. - R automatically finds installed libs. No manual downloading / settings headers/libs. - __Transparent and reproducible__ builds, __automated__ via CI, collaborative maintenance. Hopefully, this will allow us to provide reliable, up-to-date libs for R on Windows. These slides: `https://jeroen.github.io/rstudio2019`