Weiming-Hu / AnalogsEnsemble

The C++ and R packages for parallel ensemble forecasts using Analog Ensemble
https://weiming-hu.github.io/AnalogsEnsemble/
MIT License
18 stars 5 forks source link

Issue with RAnEn installation #52

Closed LMXB closed 5 years ago

LMXB commented 5 years ago

I have the following errors while installing the RAnEn package on Linux.

> install.packages('/users/yyang/code/R/script/AnalogsEnsemble-master/RAnalogs/releases/RAnEn_latest.tar.gz',repos=NULL)

Installing package into ?.users/yyang/code/R/library?
(as ?.ib?.is unspecified)
* installing *source* package ?.AnEn?....
Checking whether R_HOME is already set? R_HOME = /opt/R/R-3.5.3-intel2017-icc-ifort/lib64/R
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether icpc -std=gnu++11 accepts -g... yes
checking for icpc -std=gnu++11 option to support OpenMP... -fopenmp
configure: creating ./config.status
config.status: creating src/Makevars
** libs
icpc -std=gnu++11 -I"/opt/R/R-3.5.3-intel2017-icc-ifort/lib64/R/include" -DNDEBUG  -I"/users/yyang/code/R/library/Rcpp/include" -I"/users/yyang/code/R/library/BH/include" -I/usr/local/include  -fopenmp -fpic  -g -O2 -c AnEn.cpp -o AnEn.o
In file included from /users/yyang/code/R/library/BH/include/boost/noncopyable.hpp(15),
                 from /users/yyang/code/R/library/BH/include/boost/multi_index/detail/auto_space.hpp(20),
                 from /users/yyang/code/R/library/BH/include/boost/multi_index/detail/rnd_index_ptr_array.hpp(19),
                 from /users/yyang/code/R/library/BH/include/boost/multi_index/detail/rnd_index_ops.hpp(18),
                 from /users/yyang/code/R/library/BH/include/boost/multi_index/random_access_index.hpp(35),
                 from Stations.h(13),
                 from Forecasts.h(16),
                 from Analogs.h(12),
                 from Functions.h(11),
                 from AnEn.h(11),
                 from AnEn.cpp(8):
/users/yyang/code/R/library/BH/include/boost/core/noncopyable.hpp(42): error: defaulted default constructor cannot be constexpr because the corresponding implicitly declared default constructor would not be constexpr
        BOOST_CONSTEXPR noncopyable() = default;
                        ^

compilation aborted for AnEn.cpp (code 2)
make: *** [AnEn.o] Error 2
ERROR: compilation failed for package ?.AnEn?
* removing ?.users/yyang/code/R/library/RAnEn?
Warning message:
In install.packages("/users/yyang/code/R/script/AnalogsEnsemble-master/RAnalogs/releases/RAnEn_latest.tar.gz",  :
  installation of package ?.users/yyang/code/R/script/AnalogsEnsemble-master/RAnalogs/releases/RAnEn_latest.tar.gz?.had non-zero exit status
Weiming-Hu commented 5 years ago

Hi Yi, thank you for reporting this. I’ll take a look once I get to the office today.

Weiming-Hu commented 5 years ago

You are using Intel compilers here which I have never tested before. This would be a great opportunity for me to test it with a different environment. Let's try to solve this problem with the Intel compiler you have. If it turns out to be too complicated, I might suggest you change your compiler to GCC for simplicity.

The error seems to reflect a conflict in some installed packages. Could you please show me the output of the following commands?

installed.packages()[c('BH', 'Rcpp'), 'Version']
rownames(installed.packages())
LMXB commented 5 years ago

Hi Weiming, I found it works well with GCC compiler. Next, you may want to test it with Intel compiler, we can try to fix this.

Here is the output of these commands.

> installed.packages()[c('BH', 'Rcpp'), 'Version'] BH Rcpp "1.69.0-1" "1.0.1"

> rownames(installed.packages()) [1] "abind" "ADGofTest" "akima"
[4] "askpass" "assertthat" "backports"
[7] "base64enc" "BH" "bitops"
[10] "BMA" "callr" "caTools"
[13] "CDFt" "cellranger" "chron"
[16] "CircStats" "cli" "climdex.pcic"
[19] "climdex.pcic.ncdf" "clipr" "clisymbols"
[22] "colorspace" "combinat" "copula"
[25] "corrplot" "crayon" "curl"
[28] "DataLoader" "DBI" "deepnet"
[31] "DEoptimR" "desc" "devtools"
[34] "dichromat" "digest" "doMC"
[37] "doParallel" "dotCall64" "dtw"
[40] "ellipsis" "ensembleBMA" "EnvStats"
[43] "esd" "eva" "evaluate"
[46] "evd" "fansi" "fields"
[49] "fitdistrplus" "forcats" "foreach"
[52] "formatR" "fs" "functional"
[55] "gdata" "generics" "ggplot2"
[58] "gh" "git2r" "glmnet"
[61] "glue" "goftest" "gplots"
[64] "gridExtra" "gridGraphics" "gsl"
[67] "gtable" "gtools" "highr"
[70] "htmltools" "htmlwidgets" "httpuv"
[73] "httr" "ini" "inline"
[76] "ismev" "iterators" "JBTools"
[79] "jsonlite" "knitr" "labeling"
[82] "latticeExtra" "lazyeval" "leaps"
[85] "lmomco" "Lmoments" "lmtest"
[88] "loadeR" "loadeR.java" "locfit"
[91] "lsei" "lubridate" "magrittr"
[94] "mapplots" "maps" "markdown"
[97] "matlabr" "memoise" "mime"
[100] "munsell" "mvtnorm" "ncdf"
[103] "ncdf.tools" "ncdf4" "ncdf4.helpers"
[106] "network" "nortest" "npsurv"
[109] "numDeriv" "openssl" "pcaPP"
[112] "PCICt" "pillar" "pkgbuild"
[115] "pkgconfig" "pkgload" "plogr"
[118] "plotrix" "plyr" "praise"
[121] "prettyunits" "processx" "proj4"
[124] "proxy" "ps" "pspline"
[127] "purrr" "qrng" "quadprog"
[130] "R.matlab" "R.methodsS3" "R.oo"
[133] "R.utils" "R6" "RAnEn"
[136] "raster" "rChoiceDialogs" "rcmdcheck"
[139] "RCMIP5" "RColorBrewer" "Rcpp"
[142] "RcppArmadillo" "RcppEigen" "RCurl"
[145] "rematch" "remotes" "reshape2"
[148] "rgl" "rJava" "rlang"
[151] "RNetCDF" "robustbase" "rprojroot"
[154] "rrcov" "rstudioapi" "rvest"
[157] "sandwich" "scales" "sdsmR"
[160] "seas" "selectr" "sessioninfo"
[163] "shiny" "snow" "sourcetools"
[166] "sp" "spam" "SPEI"
[169] "stabledist" "stringi" "stringr"
[172] "sys" "termstrc" "testthat"
[175] "tibble" "tinytex" "transformeR"
[178] "udunits2" "urca" "usethis"
[181] "utf8" "vctrs" "verification"
[184] "viridisLite" "whisker" "withr"
[187] "xfun" "xlsx" "xlsxjars"
[190] "xml2" "xopen" "xtable"
[193] "yaml" "zeallot" "zoo"
[196] "base" "boot" "class"
[199] "cluster" "codetools" "compiler"
[202] "datasets" "foreign" "graphics"
[205] "grDevices" "grid" "KernSmooth"
[208] "lattice" "MASS" "Matrix"
[211] "methods" "mgcv" "nlme"
[214] "nnet" "parallel" "rpart"
[217] "spatial" "splines" "stats"
[220] "stats4" "survival" "tcltk"
[223] "tools" "utils"

Weiming-Hu commented 5 years ago

By searching around the Internet, people have encountered similar issues like this (errors triggered by the same file in BH and by the same line of code). Looks like this can be caused by several reasons:

But I have managed to install RAnEn using icpc/icc on a cluster machine using either -std=gnu++11 or -std=c++11. My Rcpp and BH versions are the same as yours.

So I guess this is going down the direction that a mysterious package is creating the conflict. People have reported StanHeaders and bigstatsr. But apparently you don't have them.

Since you already have a working version with GCC, I would suggest you use that one. Please let me know if you particular reason for Intel compilers.

reference 1 reference 2 reference 3