cmu-delphi / epiforecast-R

R package to implement and visualize several epidemiological forecasting methods.
GNU General Public License v2.0
21 stars 5 forks source link

CXX14 error when trying to install #1

Closed craigjmcgowan closed 5 years ago

craigjmcgowan commented 5 years ago

I'm trying to install via devtools::install_github("cmu-delphi/epiforecast-R", subdir="epiforecast") but am getting the following error:

> devtools::install_github("cmu-delphi/epiforecast-R", subdir="epiforecast")
Downloading GitHub repo cmu-delphi/epiforecast-R@master
from URL https://api.github.com/repos/cmu-delphi/epiforecast-R/zipball/master
Installing epiforecast
"C:/PROGRA~1/R/R-35~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD  \
  INSTALL "C:/Users/Craig  \
  McGowan/AppData/Local/Temp/RtmpMBAvUm/devtools341049f12411/cmu-delphi-epiforecast-R-5f1fb36/epiforecast"  \
  --library="C:/Users/Craig McGowan/R/win-library/3.5" --install-tests 

* installing *source* package 'epiforecast' ...
** libs
Error in .shlib_internal(args) : 
  C++14 standard requested but CXX14 is not defined
* removing 'C:/Users/Craig McGowan/R/win-library/3.5/epiforecast'
In R CMD INSTALL
Installation failed: Command failed (1)

I've installed and updated all of the dependecies the package requires, but can't get over the final hurdle. Any thoughts on how to resolve or a potential workaround? Pasting my session_info() below if that is useful at all:

Session info ------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.5.1 (2018-07-02)
 system   x86_64, mingw32             
 ui       RStudio (1.1.453)           
 language (EN)                        
 collate  English_United States.1252  
 tz       Africa/Johannesburg         
 date     2018-08-21                  

Packages ----------------------------------------------------------------------------------------------
 package   * version date       source        
 base      * 3.5.1   2018-07-02 local         
 compiler    3.5.1   2018-07-02 local         
 curl        3.2     2018-03-28 CRAN (R 3.5.0)
 datasets  * 3.5.1   2018-07-02 local         
 devtools  * 1.13.6  2018-06-27 CRAN (R 3.5.0)
 digest      0.6.15  2018-01-28 CRAN (R 3.5.0)
 git2r       0.23.0  2018-07-17 CRAN (R 3.5.1)
 graphics  * 3.5.1   2018-07-02 local         
 grDevices * 3.5.1   2018-07-02 local         
 httr        1.3.1   2017-08-20 CRAN (R 3.5.0)
 memoise     1.1.0   2017-04-21 CRAN (R 3.5.0)
 methods   * 3.5.1   2018-07-02 local         
 R6          2.2.2   2017-06-17 CRAN (R 3.5.0)
 stats     * 3.5.1   2018-07-02 local         
 tools       3.5.1   2018-07-02 local         
 utils     * 3.5.1   2018-07-02 local         
 withr       2.1.2   2018-03-15 CRAN (R 3.5.0)
 yaml        2.2.0   2018-07-25 CRAN (R 3.5.1)
brookslogan commented 5 years ago

Sorry I did not see this earlier. The C++14-reliant code (the EB forecaster) has been moved to a separate package for now so it is easier to use the remainder of the package functionality.

brookslogan commented 5 years ago

If you still need to use the EB code, you should expect to run into the same error message when installing the C++14-reliant package. This issue may arise from not having a recent enough C++ compiler. One way to check this is to do: $ g++ --std=c++14 And see if it produces "g++: error: unrecognized command line option 'std=c++14' [...]" in addition to the expected error message "g++: fatal error: no input files".

If g++ doesn't recognize --std=c++14 then you may be able to resolve the issue by upgrading your g++. Sorry, we've talked about resolving this by removing reliance on c++14 features, but it's not a priority right now.

craigjmcgowan commented 5 years ago

Awesome thanks. At this point I only need the code to fetch Epidata and mimic past Epidata, so this works and I'll leave the C++ issues for another day.