Dear experts,
I updated the rstan and then it failed to work (Rstudio always crashes at the beginning of the modeling). Then I uninstalled the Rtools and re-do the compilation according to the guide. However it failed when I did the fx test:
fx ← inline::cxxfunction( signature(x = “integer”, y = “numeric” ) , ’
- return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
- ’ )
C:\Rtools\mingw_64\bin\nm.exe: file61437cd1e.o: plugin needed to handle lto object
Cannot export __gnu_lto_slim: symbol not defined
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 file61437cd1e( SEXP x, SEXP y) ;
14: }
15:
16: // definition
17:
18: SEXP file61437cd1e( 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! C:\Rtools\mingw_64\bin\nm.exe: file61437cd1e.o: plugin needed to handle lto object
Cannot export __gnu_lto_slim: symbol not defined
Cannot export __gnu_lto_v1: symbol not defined
collect2.exe: error: ld returned 1 exit status
fx( 2L, 5 )
Error: could not find function “fx”
My session information is listed below:
sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] 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] tools_3.3.0 inline_0.3.14
Could any help me to figure this out? Thanks a lot for your help!
Best,
Yang