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

Adding installation instructions for Windows #74

Merged
merged 9 commits into from
Nov 29, 2022
Merged

Adding installation instructions for Windows #74

merged 9 commits into from
Nov 29, 2022

Conversation

llrs
Copy link
Member

@llrs llrs commented Oct 3, 2022

This PR adds the instructions for windows, both binaries and from source.
Lately I cannot configure R from source in the windows but following this should be possible.

If someone could confirm or report any problem on this instructions I would appreciate and update the instructions.


This should be rebased and merged after #65

@llrs llrs changed the title Adding installation instructions for Linux Adding installation instructions for Windows Oct 6, 2022
@hturner
Copy link
Member

hturner commented Oct 7, 2022

I tried out the instructions. When I get to $TOP_SRCDIR/configure --enable-R-shlib I get the error line 24073: ${}: bad substitution which corresponds to the line eval "test -z \"\${${Rshlibpath_var}}\"" in the configure script.

I think this error is due to Rshlibpath_var being empty, which you can confirm by running

Rshlibpath_var=test
eval "test -z \"\${${Rshlibpath_var}}\""

in the MYS2 shell - this works as above, but if you replace test with "" , you get the ${}: bad substitution error.

The wider problem is that when running $TOP_SRCDIR/configure (with or without the --enable-R-shlib option) from the MYS2 shell, the host system type is identified as x86_64-pc-msys and looking at the configure file, the variable shlibpath_var is not set in this case. If I run the same code in the Git Bash terminal in RStudio on Windows, the host system type is identified as x86_64-pc-mingw64 and the configure script gets past line 24073.

However, that doesn't solve the problem. The configure script then gets stuck because it can't find readline; if I run with option --with-readline=no it then gets stuck because it can't find X11; if I add option --with-x=no it gets stuck at checking for BSD networking... configure: BSD networking functions are required. I couldn't find a way to get past this!

Looking again at https://cran.r-project.org/bin/windows/base/howto-R-4.2.html, those instructions do not use the configure script on Windows. I was able to build R successfully by following the instructions there to build directly in the src/gnuwin32 sub-directory of the svn repo. I also ran make check and make check-devel - the only issues were related to package vignettes and manuals, which are built in separate make steps (this isn't documented, you have to look in the Makefile in src/gnuwin32). I didn't get as far as fixing all that as I don't have MikTeX installed (I had TinyTex, but that's not easy to use as you have to install all the required packages manually when using outside of R).

So I think the bottom line is we shouldn't be using the configure script for Windows. We don't need to use the --enable-R-shlib to use the built version of R with RStudio, you can just go to Tools > Global Options > R version: [Change] > Choose a specific version of R and browse to ~/Downloads/R (i.e. $TOPSRC_DIR in the instructions). I was able to get this work and ran the examples in ?plots to check.

02-getting_started.Rmd Show resolved Hide resolved

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.
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/).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit confusing. For the purpose here, people just need the RTools42 installer (the rtools42-XXXX-XXXX.exe file).


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.
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 <https://miktex.org>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should recommend this more strongly - even if people already have LaTeX via TinyTex, I think it will be easier for them to install MikTeX so that any required packages are installed on the fly.

02-getting_started.Rmd Outdated Show resolved Hide resolved
02-getting_started.Rmd Outdated Show resolved Hide resolved
1. Open the Rtools42 terminal, and update and get the tools:

pacman -Syuu
pacman -Sy wget subversion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't need subversion here if we are using TortoiseSVN or SlikSVN. I think it is helpful to recommend people install Subversion outside of the MSYS shell, so that it can be found more easily by other tools, e.g. RStudio.

02-getting_started.Rmd Outdated Show resolved Hide resolved
02-getting_started.Rmd Outdated Show resolved Hide resolved
02-getting_started.Rmd Outdated Show resolved Hide resolved
@llrs
Copy link
Member Author

llrs commented Oct 7, 2022

Many thanks as always for helping me solve this problem!

I'll try to build it on Sunday, but when you said you were able to " to build R successfully " do you mean just running make on the src/gnuwin32?
I thought that before that I needed to configure it (as well as for RStudio to be able to use it).

I have MikTeX installed on that computer, and LiveTeX which provides the pdflatex command, I'll report if I can build the manuals and update how it goes.

@hturner
Copy link
Member

hturner commented Oct 10, 2022

Not quite, the make has different targets (rsync-recommended, all and recommended). So I did

cd ~/Downloads/R
unzip ../tcltk-5355-5175.zip
cd src/gnuwin32
make rsync-recommended
make all recommended
make check
make check-devel

I think make vignettes manuals might be needed for the checks to pass without any warnings or notes, but I guess this is also true for the Linux installation, so perhaps we can note that as an optional step.

@llrs
Copy link
Member Author

llrs commented Oct 10, 2022

Just notes for myself before writing it and anyone following through.

I can confirm this src/gnuwin32 works. But so far I used texlive as the pdflatex provider (in /c/texlive/2022/bin/win32/). When I opened the miketex, via the windows start menu, it asked me to check for updates and make it available in the PATH. I think it might be worth it to mention that one needs to open it and follow the recommendations then it would find the pdflatex file.

Also, I was surprised because RStudio wanted to select a folder with the R installation not the R.exe as I expected. This might be me not reading well the butttons in addition of lack of fmailiariy with windows programs.

@SaranjeetKaur SaranjeetKaur added the gsod-2022 Google Season of Docs related task label Oct 12, 2022
@llrs
Copy link
Member Author

llrs commented Oct 25, 2022

I was able to build and check successfully R from source in windows with MiKTeX, the program was installed just for the user in /c/Users/$USER/AppData/Local/Programs/MiKTeX/miktex/bin/x64.

I still need to check if make check-devel has any problem using user installation of MiKTeX, but I don't expect any. Another question is why with texlive the check fails...

@llrs
Copy link
Member Author

llrs commented Nov 5, 2022

I updated the branch to (hopefully) resolve all the comments. I moved all the prerequisites to their own section. I kept the svn installation inside MSYS to keep in line with other installation instructions but I mention there SlikSVN and TortoiseSVN.

@llrs llrs requested review from hturner and nbenn November 5, 2022 12:58
@llrs llrs mentioned this pull request Nov 5, 2022
Copy link
Contributor

@nbenn nbenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I neither have a Win machine available, nor have I ever tried building anything on that platform, so I can't give much feedback on content. I tried to improve some language issues, but feel free to ignore comments you don't see as improvements.

02-getting_started.Rmd Outdated Show resolved Hide resolved
02-getting_started.Rmd Show resolved Hide resolved
02-getting_started.Rmd Outdated Show resolved Hide resolved
02-getting_started.Rmd Outdated Show resolved Hide resolved
02-getting_started.Rmd Outdated Show resolved Hide resolved
02-getting_started.Rmd Outdated Show resolved Hide resolved
02-getting_started.Rmd Show resolved Hide resolved
02-getting_started.Rmd Outdated Show resolved Hide resolved
02-getting_started.Rmd Outdated Show resolved Hide resolved
02-getting_started.Rmd Outdated Show resolved Hide resolved
llrs and others added 2 commits November 8, 2022 22:38
Co-authored-by: nbenn <3158446+nbenn@users.noreply.github.com>
@llrs
Copy link
Member Author

llrs commented Nov 27, 2022

I think now I addressed all the comments, if there isn't any other big issue/comment I will merge this after the meeting tomorrow. Thanks for all the feedback @hturner and @nbenn !

@hturner hturner merged commit a3279b0 into main Nov 29, 2022
@hturner hturner deleted the windows branch November 29, 2022 15:04
@hturner
Copy link
Member

hturner commented Nov 29, 2022

No major comments from me, so I merged this in to enable people to review the new section in a clean state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsod-2022 Google Season of Docs related task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants