Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation ERROR, after successful install #566

Open
datarichard opened this issue Oct 11, 2018 · 5 comments
Open

Compilation ERROR, after successful install #566

datarichard opened this issue Oct 11, 2018 · 5 comments

Comments

@datarichard
Copy link

Summary:

After following the instructions on https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Mac-or-Linux, I get a compile error when I try to run any of the demos or my own model.

Description:

After executing the demo, it downloads and begins to run, declaring variables etc. And then it stops and a long screen of text issues with the final error message shown below.

On my other mac the demo seems to run ok. Both macs have the same setup apart from the version of StanHeaders, which is 2.18.0 on the mac that fails, and 2.17.2 on the mac that works. I would like to install and test 2.17.2 on the problem mac but I don't know how to download and install an older version of StanHeaders.

Reproducible Steps:

install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies=TRUE)
library(rstan)
stan_demo(461)

Current Output:

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from file9a17a1e3827.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/autodiffstackstorage.hpp:4:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/memory/stack_alloc.hpp:145:10: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
for (auto& bloc
In addition: Warning messages:
1: In stan_model(MODELS, model_name = model) :
StanHeaders version is ahead of rstan version; update to latest rstan
2: In system(cmd, intern = !verbose) :
running command '/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file9a17a1e3827.cpp 2> file9a17a1e3827.cpp.err.txt' had status 1

Expected Output:

If applicable, the output you expected from RStan.

RStan Version:

The version of RStan you are running (e.g., from packageVersion("rstan"))
‘2.17.4’

R Version:

The version of R you are running (e.g., from R.version.string)
"R version 3.5.1 (2018-07-02)"

Operating System:

Your operating system (e.g., OS X 10.11.3)
macOS Mojave 10.14

@datarichard
Copy link
Author

I figured out how to install StanHeaders version 2.17.2 from https://cran.r-project.org/src/contrib/Archive/StanHeaders/

packageurl <- "http://cran.r-project.org/src/contrib/Archive/StanHeaders/StanHeaders_2.17.2.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

That seems to have fixed the error. The demo now runs as expected. However I'm left wondering why the latest version of StanHeaders doesn't run on my setup.

Hope that helps somehow...

@bgoodri
Copy link
Contributor

bgoodri commented Oct 11, 2018 via email

@statwonk
Copy link

statwonk commented Nov 1, 2018

I'm using StanHeaders 2.18.0 and rstan of 2.17.3 and Sys.setenv(USE_CXX14 = 1) didn't solve things for me.

@bgoodri
Copy link
Contributor

bgoodri commented Nov 1, 2018

@statwonk Which error message are you getting?

@bgoodri bgoodri reopened this Nov 1, 2018
@surueSK
Copy link

surueSK commented Nov 27, 2018

Maybe you should check this.
RcppCore/Rcpp#922
I had similar problems, but it solves when I do what coatless said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants