Caserio
Caserio

Reputation: 492

R: "make" not found when installing a R-package from local tar.gz

The R Package ConvCalendar is not on Cran repository anymore (see here). However, because I have intensively used this package for previous projects, it would be nice to have it installed on my machine, even an older version would suffice.

(Windows 10 environment)

In the link above it is possible to download older versions of ConvCalendar from the archive. I thus did it, and tried installing it by running (having devtools also installed and loaded):

install.packages("ConvCalendar_1.2.tar.gz", repos=NULL, type="source")

However, I get the following error message:

> install.packages("ConvCalendar_1.0.tar.gz", repos=NULL, type="source")
Installing package into ‘C:/Users/myname/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package 'ConvCalendar' ...
** libs

*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'ConvCalendar'
* removing 'C:/Users/myname/Documents/R/win-library/3.5/ConvCalendar'
In R CMD INSTALL
Warning in install.packages :
  installation of package ‘ConvCalendar_1.2.tar.gz’ had non-zero exit status

Looking for a solution to this problem.

Upvotes: 24

Views: 65961

Answers (4)

Majed86
Majed86

Reputation: 410

what do you need is to update the Rtool. Here is the link. I had the same issue before.Once you update it, it will work.

Upvotes: 23

moodymudskipper
moodymudskipper

Reputation: 47310

Building on @mirh's answer.

I had installed Rtools 4.0 in the in "C:\rtools" on windows and had the "'make' not found" issue (I also had a warning that RTools was not found). I could not change the PATH through the traditional route though because I was missing admin rights. The following helped:

Add to your .RProfile the line:

Sys.setenv(PATH = paste0(Sys.getenv("PATH"), ";C:\\rtools40\\usr\\bin"))

This will change the path from within R for the current session. You might have to alter it if you have a different version of RTools or a different installation directory.

After this I can install from source and I don't get the RTools warning anymore.

Upvotes: 2

mirh
mirh

Reputation: 650

'make' not found is a pretty clear cut message on what's the issue, and as noted here and elsewhere it is caused by Rterm not knowing where to find it (unlike other tools like RStudio, base R is completely clueless about the Windows registry value where the Rtools path gets set by default).

Up to Rtools 3.5 this could be neatly avoided with a checkbox in the installer (which took care of adding the right directory to PATH), but newer versions dropped it. Presumably to focus on the RTOOLS_HOME variable (which is far more independent and resilient to whatever else you may have installed on your system), if just so it wasn't that until R 4.2 nothing really cared for it in the code.

On top of that, it's only since Rtools 4.0 (maybe because they updated the old MSYS2/Cygwin environment, or maybe it was something in the accompanying R 4.0?) that you can use long filenames with spaces to point to the folder containing make. Also, hopefully you haven't been manually setting BINPREF anywhere.

TL;DR: just add something like "C:\rtools40\usr\bin" (or whatever you have) to your PATH.

Upvotes: 1

Yogesh
Yogesh

Reputation: 1432

Reinstall Rtools, Please check the below link to figure out the right version of Rtools.

https://cran.r-project.org/bin/windows/Rtools/history.html

Upvotes: 5

Related Questions