deploying shiny app that depends on c++ library

I'm trying to use shinyapps.io to host a Shiny app I've created. I've gotten the app to run locally on my machine. It uses a c++ library that I'm calling with help from Rcpp.

Right now, I have the shinyapp directory sitting inside my larger project directory, which contains cpp code. My app.R file looks like this

library(shiny)
library(Rcpp)

Sys.setenv("PKG_LIBS"="-L/home/taylor/holdem_monte_carlo/Release/src -lhmc-lib -Wl,-rpath=/home/taylor/holdem_monte_carlo/Release/src")

Rcpp::sourceCpp("do_comps.cpp", verbose = T, rebuild=T)

ui <-  ...  
server <- ...
shinyApp(ui = ui, server = server)

Can I get terminal access to download and build c++ libraries on shinyapps.io? Then I could just keep the code as is, but change the directories. Any idea how to do that? Or are there any other ideas for how to get this to work?

I figured it out by taking the easy route. I made all the c++ files part of the project so I didn’t have to link with any externally compiled library.

1 Like