title | author | output | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
make: Special considerations for Windows |
Shaun Jackman, Dean Attali, Jenny Bryan |
|
2015-11-17 NOTE: This year we made R packages before we used Make. The hope is, therefore, that the Make that ships with Rtools is all we need. So hopefully we can ignore this?
back to All the automation things
We are still working out the best way to install make
on Windows. Our current best recommendation is to install msysGit, which includes make
as well as git
and bash
.
Download and install msysGit. The two software packages msysGit and Git for Windows are related. Both install git
and bash
, but only msysGit installs make
. The programs installed by msysGit are found by default in C:\msysGit\bin
. Here is the complete list of programs included with msysGit. For this activity, RStudio needs to be able to find in your PATH
environment variable the program make
, the shell bash
, other utilities like rm
and cp
, and Rscript
.
Here is another alternative for installing make
alone:
- Go to the Make for Windows web site
- Download the Setup program
- Install the file you just downloaded and copy to your clipboard the directory in which it is being installed
- FYI: The default directory is
C:\Program Files (x86)\GnuWin32\
- FYI: The default directory is
- You now have
make
installed, but you need to tell Windows where to find the program. This is called updating yourPATH
. You will want to update thePATH
to include thebin
directory of the newly installed program.
If you installed Make for Windows
(as opposed to the make
that comes with Git for Windows
), you still need to update your PATH
.
These are the steps on Windows 7 (we don't have such a write-up yet for Windows 8 -- feel free to send one!):
- Click on the Windows logo
- Right click on Computer
- Select Properties
- Select Advanced System Settings
- Select Environment variables
- Select the line that has the
PATH
variable. You may have to scroll down to find it - Select Edit
- Go to the end of the line and add a semicolon
;
, followed by the path where the program was installed, followed by\bin
.- Typical example of what one might add:
;C:\Program Files (x86)\GnuWin32\bin
- Typical example of what one might add:
- Click Okay and close all the windows that you opened
- Quit RStudio and open it again.
- You should now be able to use
make
from RStudio and the command line
See issue 58 for what seems to be the most comprehensive statement of the Windows situation.
What are the tricky bits?
- Getting the same
Makefile
to "work" via RStudio's Build buttons/menus and in the shell. And, for that matter, which shell? Git Bash or ??? - Ensuring
make
,Rscript
,pandoc
,rm
, etc. can be found = updatingPATH
. - Getting
make
to use the correct shell.- See issue 54 on the Discussion repo.
back to All the automation things