Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figuring Out How to Install R on Windows (from source). #29

Open
grabear opened this issue Oct 18, 2019 · 10 comments
Open

Figuring Out How to Install R on Windows (from source). #29

grabear opened this issue Oct 18, 2019 · 10 comments

Comments

@grabear
Copy link
Member

grabear commented Oct 18, 2019

I've never installed R from source before, so I'm using this issue to keep up with that evolving process.

  • In order to install R on Windows you need to first have Rtools installed.
  • Rtools installs make, tar, etc.
  • When you run the Rtools.exe, make sure to check the box that allows you to install R from source:

image

@sdhutchins
Copy link
Member

From this, one question that arises is: Should we require users to do this manually?

@grabear
Copy link
Member Author

grabear commented Oct 18, 2019

Well Idk how to install Rtools from the command line yet. Do you? @sdhutchins

@sdhutchins
Copy link
Member

sdhutchins commented Oct 18, 2019

Just transferring my comment to here...

Just thinking on the Windows implementation...I've not seen anything anywhere yet on compiling Rtools (unless the components are zipped after install and then unzipped in another location).

I also haven't seen anything related to Rtools being required for Microsoft R Open. The main drawback of Microsoft R Open though is less recent releases of versions of packages being available.

@sdhutchins
Copy link
Member

sdhutchins commented Oct 18, 2019

I came across this...I've been searching for it ALL day...

https://github.com/rwinlib/rtools35 - They have a workaround for building rtools using InnoSetup. This path is obviously more involved and requires setting up InnoSetup.

I think a question we have to ask here is - for Windows, do we anticipate many people using a server only implementation of windows? If not, I think it's right to just direct users to install RTools manually.

The real beauty of the tool for windows is installing R using the command line and switching between different versions.

@sdhutchins
Copy link
Member

Per Microsoft R Open's FAQ:

You will need the Intel MKL developer kit to build from source and include the Intel MKL libraries on Linux & Windows. While the binaries include Intel MKL on Linux & Windows, the Microsoft R Open sources are configured by default to build with standard BLAS and LAPACK libraries. If you have the Intel MKL developer kit, follow these instructions to build with it. The R Installation and Administration Guide also provides instructions on building R with various BLAS libraries including MKL, ATLAS and OpenBLAS.

@zongqi-wang
Copy link
Collaborator

To be honest. Requiring the user to have Inno setup to build rtools t build R seems like a huge hassel...

@grabear
Copy link
Member Author

grabear commented Oct 19, 2019

So, I accidentally installed R into a directory that I didn't intend to... But...

  • The command highlighted in red will silently install Rtools in a specific directory. The red boxes also highlight that this method will successfully install the "Extras to build R"
  • The command highlighted in blue will open up the blue window that shows all of the arguments that you can use with Rtools.exe

image

@grabear
Copy link
Member Author

grabear commented Oct 19, 2019

So per @sdhutchins comment, here are the different versions of Rtools and the versions of R that use them. https://cloud.r-project.org/bin/windows/Rtools/

image

@grabear
Copy link
Member Author

grabear commented Oct 19, 2019

I'm exploring the windows filesystem for renv, so I'm learning to install R from source on Windows at the same time. This assumes you already have Rtools installed.

  1. Getting the source files
# Get R tarball
mkdir ~/R
cd ~/R
curl https://cran.r-project.org/src/base/R-3/R-3.4.3.tar.gz --output R-3.4.3.tar.gz
tar -xf R-3.4.3.tar.gz  # there will be some symlink errors regarding Recommended packages
# Get Recommended
cd R-3.4.3/src/gnuwin32
make rsync-recommended  # This "fixes" the above issue
# Get external software
cd ~/R/R-3.4.3
mkdir extsoft
cd extsoft
curl https://www.stats.ox.ac.uk/pub/Rtools/goodies/multilib/local323.zip --output local323.zip
unzip local323.zip
cd ../src/gnuwin32
...
# For manual installation do this and then use VIM
cp MkRules.dist MkRules.local 
# use VIM; uncommenting EXT_LIBS and setting it to the appropriate path (~/R/R-3.4.3/extsoft)
# Add the Rtools gcc to your PATH
# Look through the file MkRules.local and make any other changes needed: in particular, this is where a 64-bit build is selected and the locations are set of external software for ICU collation and the cairo-based devices.
...
# For programmatic installation we copy the file and then make changes to specific lines
# It would be easy if all of the changes we need to make are commented out already.
# Then we could simply add lines to the bottom of the file.

@grabear
Copy link
Member Author

grabear commented Oct 19, 2019

The above is an incomplete process. Some more of the stuff in MkRules.local need to be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants