本文介绍了RInside on Mac OS X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OS X 10.9.2上安装了R 3.0.3的mac端口。我安装RInside与sudo R CMD INSTALL〜/ Downloads / RInside_0.2.11.tgz(类似于Rcpp_0.11.1.tar)。我试图从。我试图使用

I have R 3.0.3 installed with mac ports on OS X 10.9.2. I installed RInside with sudo R CMD INSTALL ~/Downloads/RInside_0.2.11.tgz (similarly Rcpp_0.11.1.tar). I am trying to compile a simple RInside Help World code from http://dirk.eddelbuettel.com/code/rinside.html. I am trying to use

g++ main.cpp -I/Users/robogos/Library/R/3.0/library/RInside/include/ -I/Users/robogos/Library/R/3.0/library/Rcpp/include/ -I/opt/local/Library/Frameworks/R.framework/Versions/3.0/Resources/include/

我得到一个错误列表:

Undefined symbols for architecture x86_64:
  "_REprintf", referenced from:
      Rcpp::Rstreambuf<false>::xsputn(char const*, long) in main-4b77b4.o
      Rcpp::Rstreambuf<false>::overflow(int) in main-4b77b4.o
  "_R_BindingIsLocked", referenced from:
      Rcpp::Environment_Impl<Rcpp::PreserveStorage>::bindingIsLocked(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in main-4b77b4.o
  "_R_FlushConsole", referenced from:
      Rcpp::Rstreambuf<false>::sync() in main-4b77b4.o
      Rcpp::Rstreambuf<true>::sync() in main-4b77b4.o
  "_R_NilValue", referenced from:
      Rcpp::wrap(char const*) in main-4b77b4.o
  "_R_UnboundValue", referenced from:
      Rcpp::Environment_Impl<Rcpp::PreserveStorage>::exists(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in main-4b77b4.o
  "_Rf_defineVar", referenced from:
      Rcpp::Environment_Impl<Rcpp::PreserveStorage>::assign(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, SEXPREC*) const in main-4b77b4.o
  "_Rf_findVarInFrame", referenced from:
      Rcpp::Environment_Impl<Rcpp::PreserveStorage>::exists(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in main-4b77b4.o
  "_Rf_install", referenced from:
      Rcpp::Environment_Impl<Rcpp::PreserveStorage>::assign(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, SEXPREC*) const in main-4b77b4.o
      Rcpp::Environment_Impl<Rcpp::PreserveStorage>::exists(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in main-4b77b4.o
      Rcpp::Environment_Impl<Rcpp::PreserveStorage>::bindingIsLocked(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in main-4b77b4.o
  "_Rf_mkString", referenced from:
      Rcpp::wrap(char const*) in main-4b77b4.o
  "_Rprintf", referenced from:
      Rcpp::Rstreambuf<true>::xsputn(char const*, long) in main-4b77b4.o
      Rcpp::Rstreambuf<true>::overflow(int) in main-4b77b4.o
  "RInside::parseEvalQ(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in main-4b77b4.o
  "RInside::RInside(int, char const* const*, bool, bool, bool)", referenced from:
      _main in main-4b77b4.o
  "RInside::~RInside()", referenced from:
      _main in main-4b77b4.o
  "RInside::operator[](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in main-4b77b4.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我试过了Dirk Eddelbuettel的建议,但现在我收到了:

I have tried what Dirk Eddelbuettel suggested, but now I receive:

Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/libs/stats.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/libs/stats.so, 6): Symbol not found: __gfortran_pow_r8_i4
  Referenced from: /Library/Frameworks/R.framework/Versions/3.0/Resources/lib/libRlapack.dylib
  Expected in: /Applications/MATLAB_R2013a.app/sys/os/maci64//libgfortran.2.dylib
 in /Library/Frameworks/R.framework/Versions/3.0/Resources/lib/libRlapack.dylib
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/libs/stats.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/libs/stats.so, 6): Symbol not found: __gfortran_pow_r8_i4
  Referenced from: /Library/Frameworks/R.framework/Versions/3.0/Resources/lib/libRlapack.dylib
  Expected in: /Applications/MATLAB_R2013a.app/sys/os/maci64//libgfortran.2.dylib
 in /Library/Frameworks/R.framework/Versions/3.0/Resources/lib/libRlapack.dylib
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/libs/stats.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/libs/stats.so, 6): Symbol not found: __gfortran_pow_r8_i4
  Referenced from: /Library/Frameworks/R.framework/Versions/3.0/Resources/lib/libRlapack.dylib
  Expected in: /Applications/MATLAB_R2013a.app/sys/os/maci64//libgfortran.2.dylib
 in /Library/Frameworks/R.framework/Versions/3.0/Resources/lib/libRlapack.dylib
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/libs/stats.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.0/Resources/library/stats/libs/stats.so, 6): Symbol not found: __gfortran_pow_r8_i4
  Referenced from: /Library/Frameworks/R.framework/Versions/3.0/Resources/lib/libRlapack.dylib
  Expected in: /Applications/MATLAB_R2013a.app/sys/os/maci64//libgfortran.2.dylib
 in /Library/Frameworks/R.framework/Versions/3.0/Resources/lib/libRlapack.dylib
During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
make: Nothing to be done for `rinside_sample0.cpp'.

我看到过建议像!unset DYLD_LIBRARY_PATH;

推荐答案

使用模式是


  • cd到 examples / standard / 目录

运行 make

只需像你这样调用 g ++

这篇关于RInside on Mac OS X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-26 04:37