How to package R shiny app in electron with included Rcpp code

最后都变了- 提交于 2020-06-13 05:40:14

问题


I am trying to package a shiny app as a standalone application using electron as per: https://github.com/ColumbusCollaboratory/electron-quick-start

A portable R instance is used and electron calls it to create the shiny app. I need to do this as the app I am building is for someone who doesn't have R installed and doesn't want it installed. This works great until I try to 'sourceCpp' files written in Rcpp. I get the error:

Error in sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir 
= cacheDir,  : 
Error 1 occurred building shared library.

WARNING: The tools required to build C++ code for R were not found.

Please install Command Line Tools for XCode (or equivalent).

I'm guessing this is because they can't find the c-compiler to compile the attached R-codes.

These are my questions:

  • How do I go about setting up a c-compiler with the portable-R session to compile these codes in a self contained programme (so I don't need the host to have a c-compiler already)?

  • Is it possible to call Rcpp functions which are already compiled so that no compiler is required?

  • If I were to make the Rcpp functions into a library would they require compilation by the user still?

I totally understand that this question may be complete nonsense and poorly worded. I'm a little out of my depth here and any advice is more than welcome.

Thank you for any help/pointers you can provide

来源:https://stackoverflow.com/questions/52185477/how-to-package-r-shiny-app-in-electron-with-included-rcpp-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!