Hi,
As the title says, I have installed RStan successfully but am unable to compile models.
For example, if I run example(stan_model, run.dontrun = TRUE)
then I get the following error:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! file6d6a676427f9.cpp:6:36: warning: ISO C99 requires whitespace after the macro name [enabled by default]
#define STAN__SERVICES__COMMAND_HPP#include <boost/integer/integer_log2.hpp>
^
In file included from /home/eplas/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/stan/math/rev/mat/fun/ordered_constrain.hpp:6:0,
from /home/eplas/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/stan/math/rev/mat.hpp:41,
from /home/eplas/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4,
from /home/eplas/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/src/stan/model/test_gradients.hpp:7,
from /home/eplas/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10,
from /home/eplas/R/x86_64-pc-linux-gnu-library/3.4/rstan/include/
Iβve found a couple of other threads about this problem in the forum, but none of the solutions work for me. Namely:
- you need to update BH: I have upgraded and am running 1.72.0-3.
- libPath confusion and potential Rcpp problems: doesnβt seem to be an issue for me as I can compile basic Rcpp and inline examples as suggested in that thread.
- upgrade to R 4.0.0. A problem with Windows in this case (Iβm on Linux), but also not possible as I donβt maintain the machine.
Further system setup information is below.
Thanks,
James
- Contents of
~/.R/Makevars
CXX14=g++ -std=c++1y -fPIC
- RStan session_info
β Session info ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
setting value
version R version 3.4.3 (2017-11-30)
os Red Hat Enterprise Linux Server 7.8 (Maipo)
system x86_64, linux-gnu
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz UTC
date 2020-05-27
β Packages ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
package * version date lib source
assertthat 0.2.0 2017-04-11 [2] CRAN (R 3.4.3)
backports 1.1.4 2019-04-10 [1] CRAN (R 3.4.3)
BH * 1.72.0-3 2020-01-08 [1] CRAN (R 3.4.3)
callr 3.3.2 2019-09-22 [1] CRAN (R 3.4.3)
checkmate 2.0.0 2020-02-06 [1] CRAN (R 3.4.3)
cli 1.1.0 2019-03-19 [1] CRAN (R 3.4.3)
colorspace 1.3-2 2016-12-14 [2] CRAN (R 3.4.3)
crayon 1.3.4 2017-09-16 [2] CRAN (R 3.4.3)
desc 1.2.0 2018-05-01 [1] CRAN (R 3.4.3)
dichromat 2.0-0 2013-01-24 [2] CRAN (R 3.4.3)
digest 0.6.15 2018-01-28 [2] CRAN (R 3.4.3)
ellipsis 0.3.0 2019-09-20 [1] CRAN (R 3.4.3)
fansi 0.4.0 2018-10-05 [1] CRAN (R 3.4.3)
ggplot2 * 3.2.1 2019-08-10 [1] CRAN (R 3.4.3)
glue 1.3.1 2019-03-12 [1] CRAN (R 3.4.3)
gridExtra 2.3 2017-09-09 [2] CRAN (R 3.4.3)
gtable 0.2.0 2016-02-26 [2] CRAN (R 3.4.3)
inline * 0.3.15 2018-05-18 [1] CRAN (R 3.4.3)
labeling 0.3 2014-08-23 [2] CRAN (R 3.4.3)
lattice 0.20-35 2017-03-25 [2] CRAN (R 3.4.3)
lazyeval 0.2.1 2017-10-29 [2] CRAN (R 3.4.3)
loo 2.2.0 2019-12-19 [1] CRAN (R 3.4.3)
magrittr 1.5 2014-11-22 [2] CRAN (R 3.4.3)
MASS 7.3-47 2017-02-26 [2] CRAN (R 3.4.3)
Matrix 1.2-12 2017-11-20 [2] CRAN (R 3.4.3)
matrixStats 0.56.0 2020-03-13 [1] CRAN (R 3.4.3)
mgcv 1.8-22 2017-09-24 [2] CRAN (R 3.4.3)
munsell 0.4.3 2016-02-13 [2] CRAN (R 3.4.3)
nlme 3.1-131 2017-02-06 [2] CRAN (R 3.4.3)
pillar 1.4.2 2019-06-29 [1] CRAN (R 3.4.3)
pkgbuild 1.0.5 2019-08-26 [1] CRAN (R 3.4.3)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 3.4.3)
plyr 1.8.4 2016-06-08 [2] CRAN (R 3.4.3)
prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.4.3)
processx 3.4.1 2019-07-18 [1] CRAN (R 3.4.3)
ps 1.3.0 2018-12-21 [1] CRAN (R 3.4.3)
R6 2.4.0 2019-02-14 [1] CRAN (R 3.4.3)
RColorBrewer 1.1-2 2014-12-07 [2] CRAN (R 3.4.3)
Rcpp * 1.0.2 2019-07-25 [1] CRAN (R 3.4.3)
RcppEigen 0.3.3.5.0 2018-11-24 [1] CRAN (R 3.4.3)
reshape2 1.4.3 2017-12-11 [2] CRAN (R 3.4.3)
rlang 0.4.0 2019-06-25 [1] CRAN (R 3.4.3)
rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.4.3)
rstan * 2.19.3 2020-02-11 [1] CRAN (R 3.4.3)
scales 0.5.0 2017-08-24 [2] CRAN (R 3.4.3)
StanHeaders * 2.19.2 2020-02-11 [1] CRAN (R 3.4.3)
stringi 1.2.2 2018-05-02 [2] CRAN (R 3.4.3)
stringr 1.3.0 2018-02-19 [2] CRAN (R 3.4.3)
tibble 2.1.3 2019-06-06 [1] CRAN (R 3.4.3)
utf8 1.1.3 2018-01-03 [2] CRAN (R 3.4.3)
vctrs 0.2.0 2019-07-05 [1] CRAN (R 3.4.3)
viridisLite 0.3.0 2018-02-01 [2] CRAN (R 3.4.3)
withr 2.1.2 2018-03-15 [1] CRAN (R 3.4.3)
zeallot 0.1.0 2018-01-28 [1] CRAN (R 3.4.3)
[1] /home/user/R/x86_64-pc-linux-gnu-library/3.4
[2] /opt/R/3.4.3/lib64/R/library