ubuntu上的RStan工具链错误

时间:2018-04-23 17:51:39

标签: r ubuntu stan rstan

我安装了RStan,遇到问题,卸载了它,然后尝试使用https://github.com/stan-dev/rstan/wiki/Installing-RStan-on-Mac-or-Linux

重新安装它

但是,当我尝试使用rstan时,我收到此错误:

  

库中的错误(rstan):没有名为'rstan'的包

当我运行上面提到的工具链诊断时,我注意到了

fx <- inline::cxxfunction( signature(x = "integer", y = "numeric" ) , '
    return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ;
' )
fx( 2L, 5 ) # should be 10

我收到错误:

clang: warning: argument unused during compilation: '-arch x86_64'
clang: warning: argument unused during compilation: '-arch x86_64'
file16777e2261ec.o: file not recognized: File format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [file16777e2261ec.so] Error 1
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 file16777e2261ec( SEXP x, SEXP y) ;
 14: }
 15: 
 16: // definition
 17: 
 18: SEXP file16777e2261ec( 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! clang: warning: argument unused during compilation: '-arch x86_64'
clang: warning: argument unused during compilation: '-arch x86_64'
file16777e2261ec.o: file not recognized: File format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [file16777e2261ec.so] Error 1
In addition: Warning message:
running command '/usr/lib/R/bin/R CMD SHLIB file16777e2261ec.cpp 2> file16777e2261ec.cpp.err.txt' had status 1 

Error in fx(2L, 5) : could not find function "fx"

出了什么问题?谢谢!

0 个答案:

没有答案