Error installing in win10 and R version 3.6.2 (2019-12-12)
fortunatobianconi opened this issue · 4 comments
I get this error.
Downloading GitHub repo epiforecasts/EpiNow@master
Skipping 1 packages ahead of CRAN: StanHeaders
√ checking for file '..AppData\Local\Temp\Rtmp0kKpm4\remotes37b87f593f6d\epiforecasts-EpiNow-9254e5a/DESCRIPTION' ...
- preparing 'EpiNow': (6.2s)
√ checking DESCRIPTION meta-information ...
- cleaning src
- checking for LF line-endings in source and make files and shell scripts (1.3s)
- checking for empty or unneeded directories
- looking to see if a 'data/datalist' file should be added
- building 'EpiNow_0.1.0.tar.gz'
Warning: file 'EpiNow/configure' did not have execute permissions: corrected
Installing package into ‘..Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'EpiNow' ...
** using staged installation
** libs
*** arch - i386
Error in .shlib_internal(args) :
C++14 standard requested but CXX14 is not defined
* removing 'Documents/R/win-library/3.6/EpiNow'
Error: Failed to install 'EpiNow' from GitHub:
(converted from warning) installation of package ‘/AppData/Local/Temp/Rtmp0kKpm4/file37b8593e3cde/EpiNow_0.1.0.tar.gz’ had non-zero exit status
Sorry for taking a while to reply! This might be an issue due to the lack of a compiler? We are using Stan models that need to be compiled when the package is built, unfortunately.
This link should help: https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started
Going to close this for now. Feel free to reopen.
Just wanted to add that I ran into this same error when installing EpiNow (also Windows 10 and R 3.6.2) and it was due to a problem in how the C++ toolchain provided by Rtools was configured for the installation of rstan on my machine. I followed the directions here to edit my Makevars file to specify the full path of the g++ compiler and re-installed rstan, and that solved the issue for me.
Specifically, I did the following:
dotR <- file.path(Sys.getenv("HOME"), ".R")
if (!file.exists(dotR)) dir.create(dotR)
M <- file.path(dotR, "Makevars.win")
if (!file.exists(M)) file.create(M)
cat("\nCXX14FLAGS=-O3 -march=corei7 -mtune=corei7",
"CXX14 = $(BINPREF)g++ -m$(WIN) -std=c++1y",
"CXX11FLAGS=-O3 -march=corei7 -mtune=corei7",
file = M, sep = "\n", append = TRUE)
remove.packages("rstan")
if (file.exists(".RData")) file.remove(".RData")
install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)
and then installed EpiNow as usual. Hope that helps!
Thanks for helping on this @andreamrau - if there is anything on our end we can do to make the package easier to install it would be great to hear.