Hello,
I am trying to install rstan and am continually getting this error that prevents any C++ code (from rstan or the test code snippets) from running correctly. I can't find any straightforward venues to solve this issue outside of the rstan community, so even if you could just point me to the right place that'd be extremely helpful!
I have been following the "RStan Getting Started" guide and have consistently run into the same issue - I have reinstalled everything multiple times and keep hitting a wall here.
> fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
+ return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
+ ' )
Cannot export __gnu_lto_v1: symbol not defined
collect2.exe: error: ld returned 1 exit status
ERROR(s) during compilation: source code errors or compiler configuration errors!
Program source:
1:
2: // includes from the plugin
3: #include <R.h>
4: #include <Rdefines.h>
5: #include <R_ext/Error.h>
6:
7:
8: // user includes
9:
10:
11: // declarations
12: extern "C" {
13: SEXP file24f838966efd( SEXP x, SEXP y) ;
14: }
15:
16: // definition
17:
18: SEXP file24f838966efd( SEXP x, SEXP y ){
19:
20: return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
21:
22: Rf_warning("your C++ program does not return anything");
23: return R_NilValue ;
24: }
25:
26:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! Cannot export __gnu_lto_v1: symbol not defined
collect2.exe: error: ld returned 1 exit status
The error continues if I blindly ignore reality and then try to use the Stan 8 schools data example.
rstan and all of the related packages install without issues. Their versions:
> packageVersion("rstan")
[1] ‘2.10.1’
> packageVersion("inline")
[1] ‘0.3.14’
> packageVersion("Rcpp")
[1] ‘0.12.5’
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] rsconnect_0.4.3 tools_3.3.1 inline_0.3.14
I am using Rtools33 (located in c:/Rtools) - the beginning of my PATH is thus:
> Sys.getenv("PATH")
[1] "C:\\R\\R-3.3.1\\bin\\x64;c:\\Rtools\\bin;c:\\Rtools\\mingw_64\\bin;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\system32\\wbem;C:\\Program Files (x86)...
My version of g++ is:
> system("g++ --version")
G__~1.EXE (x86_64-posix-seh, Built by MinGW-W64 project) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Thank you! I am at an archaeological dig and so have limited windows of internet access each day - I would really appreciate any help with this!