Hello,
I am trying to expose a function in rstan and have a problem doing so on windows.
Session info and error message are below.
I am also attaching the stan code and the cpp code generated by stanc.
I tried to expose the same code on a linux machine, where it worked.
One difference between the linux and the windows rstan versions is
though that on linux I installed rstan 2.8.1 a few weeks ago from the
github repo, whereas on windows I installed rstan 2.8.1 today from cran.
Any help is appreciated!
Best, Guido
################## Error message ##################
g++ -m64 -I"C:/PROGRA~1/R/R-32~1.2/include" -I"C:/PROGRA~1/R/R-32~1.2/library/Rcpp/include" -I"C:/PROGRA~1/R/R-32~1.2/library/STANHE~1/include" -I"C:/PROGRA~1/R/R-32~1.2/library/BH/include" -I"C:/PROGRA~1/R/R-32~1.2/library/RCPPEI~1/include" -I"C:/Users/gubi/AppData/Local/Temp/RtmpC29zbU" -I"d:/RCompile/r-compiling/local/local320/include" -O3 -c file16ac71211fa.cpp -o file16ac71211fa.o
file16ac71211fa.cpp: In function 'std::vector<Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001> > make_apc_info(const int&, const int&, const int&, const int&, const std::vector<int>&, const std::vector<int>&, const std::vector<int>&, const std::vector<int>&, const std::vector<int>&, const matrix_d&)':
file16ac71211fa.cpp:211:17: error: expected primary-expression before ')' token
file16ac71211fa.cpp:275:25: error: expected primary-expression before ')' token
file16ac71211fa.cpp:289:21: error: expected primary-expression before ')' token
make: *** [file16ac71211fa.o] Error 1
Warning message:
running command 'make -f "C:/PROGRA~1/R/R-32~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.2/share/make/
winshlib.mk" -f "C:/Users/gubi/Documents/.R/Makevars" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_1.dll" WIN=64 TCLBIN=64 OBJECTS="file16ac71211fa.o"' had status 2
Error in Rcpp::sourceCpp(code = paste(lines, collapse = "\n")) :
Error 1 occurred building shared library.
Here is the C++ code that does not compile. Please report bug.
...
################## Session info ##################
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Norwegian (Bokmål)_Norway.1252 LC_CTYPE=Norwegian (Bokmål)_Norway.1252
[3] LC_MONETARY=Norwegian (Bokmål)_Norway.1252 LC_NUMERIC=C
[5] LC_TIME=Norwegian (Bokmål)_Norway.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rstan_2.8.1 ggplot2_1.0.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.1 lattice_0.20-33 digest_0.6.8 MASS_7.3-44
[5] BH_1.58.0-1 grid_3.2.2 plyr_1.8.3 gtable_0.1.2
[9] stats4_3.2.2 magrittr_1.5 StanHeaders_2.8.0 scales_0.3.0
[13] stringi_1.0-1 reshape2_1.4.1 Matrix_1.2-2 proto_0.3-10
[17] tools_3.2.2 RcppEigen_0.3.2.5.1 stringr_1.0.0 munsell_0.4.2
[21] inline_0.3.14 colorspace_1.2-6 gridExtra_2.0.0