Warning: 'make' not found

I’m new to Stan. I’m using rstan 2.18.2 with R 3.5.2 in Windows 8.1.

When I try running the Eight Schools example from RStan Getting Started, the output (truncated) is:

> fit <- stan(file = "c:/work/Stan/Stan0001_8schools.stan",
+             data = schools_dat)
recompiling to avoid crashing R session
Warning message:
In system(paste(cmd, "-n")) : 'make' not found

SAMPLING FOR MODEL 'Stan0001_8schools' NOW (CHAIN 1).
Chain 1: 
Chain 1: Gradient evaluation took 0 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 0 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1: 
Chain 1: 
Chain 1: Iteration:    1 / 2000 [  0%]  (Warmup)

If I run print(fit, pars = c("mu", "tau")), there is no obvious problem:

Inference for Stan model: Stan0001_8schools.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

    mean se_mean   sd  2.5%  25%  50%   75% 97.5% n_eff Rhat
mu  8.15    0.13 5.09 -1.44 4.86 8.14 11.27 18.75  1428 1.01
tau 6.69    0.24 6.30  0.24 2.50 5.21  9.19 20.39   703 1.00

Samples were drawn using NUTS(diag_e) at Fri Mar 29 06:50:11 2019.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).

My questions are:

  1. Does the 'make' not found warning indicate a major problem? That is, does it indicate that the results shouldn’t be trusted?
  2. Even if the warning is harmless, how can I prevent it from appearing?

I have the model code in Stan0001_8schools.stan.The code I ran was:

library(rstan)

rstan_options(auto_write = TRUE)

dotR <- file.path(Sys.getenv("HOME"), ".R")
if (!file.exists(dotR)) dir.create(dotR)
M <- file.path(dotR, ifelse(.Platform$OS.type == "windows", "Makevars.win", "Makevars"))
if (!file.exists(M)) file.create(M)
cat("\nCXX14FLAGS=-O3 -march=native -mtune=native",
    if( grepl("^darwin", R.version$os)) "CXX14FLAGS += -arch x86_64 -ftemplate-depth-256" else
    if (.Platform$OS.type == "windows") "CXX11FLAGS=-O3 -march=native -mtune=native" else
    "CXX14FLAGS += -fPIC",
    file = M, sep = "\n", append = TRUE)

Sys.setenv(LOCAL_CPPFLAGS = '-march=native')

schools_dat <- list(J = 8,
                    y = c(28,  8, -3,  7, -1,  1, 18, 12),
                    sigma = c(15, 10, 16, 11,  9, 11, 10, 18))

fit <- stan(file = "c:/work/Stan/Stan0001_8schools.stan",
            data = schools_dat)

I have:

> pkgbuild::has_build_tools(debug = TRUE)
Scanning R CMD config CC...
cc_path:  
'.exe' does not exist
Scanning path...
Scanning registry...
Found C:/Rtools for 3.5 
VERSION.txt
Rtools version 3.5.0.4 
[1] TRUE

> writeLines(readLines(file.path(Sys.getenv("HOME"), ".R/Makevars")))
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file 'C:\Users\seetom/.R/Makevars': No such file or directory

> devtools::session_info("rstan")
- Session info ---------------------------------------------------------
 setting  value                       
 version  R version 3.5.2 (2018-12-20)
 os       Windows 8.1 x64             
 system   x86_64, mingw32             
 ui       RTerm                       
 language (EN)                        
 collate  English_Australia.1252      
 ctype    English_Australia.1252      
 tz       Australia/Sydney            
 date     2019-03-29                  

- Packages -------------------------------------------------------------
 ! package      * version   date       lib source        
   assertthat     0.2.0     2017-04-11 [1] CRAN (R 3.5.2)
   backports      1.1.3     2018-12-14 [1] CRAN (R 3.5.2)
   BH             1.69.0-1  2019-01-07 [1] CRAN (R 3.5.2)
   callr          3.1.1     2018-12-21 [1] CRAN (R 3.5.2)
   cli            1.0.1     2018-09-25 [1] CRAN (R 3.5.2)
   colorspace     1.4-0     2019-01-13 [1] CRAN (R 3.5.2)
   crayon         1.3.4     2017-09-16 [1] CRAN (R 3.5.2)
   desc           1.2.0     2018-05-01 [1] CRAN (R 3.5.2)
   digest         0.6.18    2018-10-10 [1] CRAN (R 3.5.2)
   fansi          0.4.0     2018-10-05 [1] CRAN (R 3.5.2)
   ggplot2      * 3.1.0     2018-10-25 [1] CRAN (R 3.5.2)
   glue           1.3.0     2018-07-17 [1] CRAN (R 3.5.2)
   gridExtra      2.3       2017-09-09 [1] CRAN (R 3.5.2)
   gtable         0.2.0     2016-02-26 [1] CRAN (R 3.5.2)
   inline         0.3.15    2018-05-18 [1] CRAN (R 3.5.2)
   labeling       0.3       2014-08-23 [1] CRAN (R 3.5.2)
 D lattice        0.20-38   2018-11-04 [1] CRAN (R 3.5.2)
   lazyeval       0.2.1     2017-10-29 [1] CRAN (R 3.5.2)
   loo            2.0.0     2018-04-11 [1] CRAN (R 3.5.2)
   magrittr       1.5       2014-11-22 [1] CRAN (R 3.5.2)
 D MASS           7.3-51.1  2018-11-01 [1] CRAN (R 3.5.2)
 D Matrix         1.2-15    2018-11-01 [1] CRAN (R 3.5.2)
   matrixStats    0.54.0    2018-07-23 [1] CRAN (R 3.5.2)
   mgcv           1.8-27    2019-02-06 [1] CRAN (R 3.5.2)
   munsell        0.5.0     2018-06-12 [1] CRAN (R 3.5.2)
   nlme           3.1-137   2018-04-07 [1] CRAN (R 3.5.2)
   pillar         1.3.1     2018-12-15 [1] CRAN (R 3.5.2)
   pkgbuild       1.0.2     2018-10-16 [1] CRAN (R 3.5.2)
   pkgconfig      2.0.2     2018-08-16 [1] CRAN (R 3.5.2)
   plyr           1.8.4     2016-06-08 [1] CRAN (R 3.5.2)
   prettyunits    1.0.2     2015-07-13 [1] CRAN (R 3.5.2)
   processx       3.2.1     2018-12-05 [1] CRAN (R 3.5.2)
   ps             1.3.0     2018-12-21 [1] CRAN (R 3.5.2)
   R6             2.4.0     2019-02-14 [1] CRAN (R 3.5.2)
   RColorBrewer   1.1-2     2014-12-07 [1] CRAN (R 3.5.2)
   Rcpp           1.0.0     2018-11-07 [1] CRAN (R 3.5.2)
   RcppEigen      0.3.3.5.0 2018-11-24 [1] CRAN (R 3.5.2)
   reshape2       1.4.3     2017-12-11 [1] CRAN (R 3.5.2)
   rlang          0.3.1     2019-01-08 [1] CRAN (R 3.5.2)
   rprojroot      1.3-2     2018-01-03 [1] CRAN (R 3.5.2)
   rstan        * 2.18.2    2018-11-07 [1] CRAN (R 3.5.2)
   scales         1.0.0     2018-08-09 [1] CRAN (R 3.5.2)
   StanHeaders  * 2.18.1    2019-01-28 [1] CRAN (R 3.5.2)
   stringi        1.3.1     2019-02-13 [1] CRAN (R 3.5.2)
   stringr        1.4.0     2019-02-10 [1] CRAN (R 3.5.2)
   tibble         2.0.1     2019-01-12 [1] CRAN (R 3.5.2)
   utf8           1.1.4     2018-05-24 [1] CRAN (R 3.5.2)
   viridisLite    0.3.0     2018-02-01 [1] CRAN (R 3.5.2)
   withr          2.1.2     2018-03-15 [1] CRAN (R 3.5.2)

[1] c:/Program Files/R/R-3.5.2/library

 D -- DLL MD5 mismatch, broken installation.

Clearly this suggests that there’s a problem, but I don’t understand what the problem is or how to fix it.

Thank you.

What happens when you enter system("make") in R? I get:

make: *** No targets specified and no makefile found.  Stop.

Thanks for your reply. I get:

Warning message:
In system("make") : 'make' not found

That is where your error message is coming from.

Addressing this D -- DLL MD5 mismatch, broken installation. In a not completely related post it was recommended to reinstall RTools and possibly rstan.

As a beginner I used rstan on windows briefly and remember having to entirely reinstall Rtools a couple of times for various reasons. I think adhering to this was most important for me.

I reinstalled Rtools and now I don’t get the warning. Thanks for your help!

I still get the D -- DLL MD5 mismatch, broken installation but I’m not concerned about that.