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

Viewed 1323

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

0 Answers
Related