Dear STAN Modellers,
I have the error shown below when I try to “fit” a model (simple 2D GMM).
Could you please give me a hint on how I can fix this ?
Thank you,
Jozsef
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from file3148752a73.cpp:8:0:
/usr/local/lib/R/site-library/StanHeaders/include/src/stan/model/model_header.hpp:4:25: fatal error: stan/math.hpp: No such file or directory
#include <stan/math.hpp>
^
compilation terminated.
make: *** [file3148752a73.o] Error 1
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command '/usr/lib/R/bin/R CMD SHLIB file3148752a73.cpp 2> file3148752a73.cpp.err.txt' had status 1
Error in sink(type = "output") : invalid connection
If I execute the following code:
fit <- stan(file='gmm2D.stan', data=input_data, chains=4, seed=483892929, refresh=2000)
My environment is the following :
- Operating System : Debian 8
- RStan Version : 2.18.0
- Output of
writeLines(readLines(file.path(Sys.getenv("HOME"), ".R/Makevars")))
STANHEADERS_SRC = `"$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`
CXX_STD = CXX14
CXX14 = g++ -std=c++1y
CXX14FLAGS=-O3 -march=native -mtune=native -fPIC
PKG_CPPFLAGS = -I"../inst/include" -I"$(STANHEADERS_SRC)" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION
SHLIB_LDFLAGS = $(SHLIB_CXXLDFLAGS)
SHLIB_LD = $(SHLIB_CXXLD)
all: $(SHLIB)
@if test -e "/usr/bin/install_name_tool" && test -e "/usr/local/clang4/lib/libc++.1.dylib" && test -e "/usr/lib/libc++.1.dylib"; then /usr/bin/install_name_tool -change /usr/local/clang4/lib/libc++.1.dylib /usr/lib/libc++.1.dylib $(SHLIB); fi
.phony: all
- Output of
devtools::session_info("rstan")
If you are reporting a bug (thank you!) please use the issue tracker (github.com/stan-dev/rstan/issues) instead of the forums.