Build Error when trying to deploy ndjson package to shinyapps.io

My shiny app currently builds and deploys to my local machine without a problem. When I try to deploy it to my shinyapps.io account, I get a build error. I believe all of my packages are from CRAN and so is shows that the compiled binary packages are being installed. This is true for all but the "ndjson" package. Although it too is available on CRAN, when I try to deploy it says that it's installing the source package and so it then as to build it. In the build process, I get an error that the GCC version that was used to compile it is unsupported by the package.
The following is an excerpt from my Depoly window:

[2018-04-19T13:20:39.051358340+0000] Installing R package: dtplyr (0.0.2)
* installing to library �/usr/local/lib/R/site-library�
* installing *binary* package �dtplyr� ...
* DONE (dtplyr)
[2018-04-19T13:20:39.248480518+0000] Building R package: ndjson (0.6.0)
/mnt/packages/build /mnt
* installing to library �/usr/local/lib/R/site-library�
* installing *source* package �ndjson� ...
** package �ndjson� successfully unpacked and MD5 sums checked
** libs
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG  -I"/usr/local/lib/R/site-library/Rcpp/include"    -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG  -I"/usr/local/lib/R/site-library/Rcpp/include"    -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c gzstream.cpp -o gzstream.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG  -I"/usr/local/lib/R/site-library/Rcpp/include"    -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c ndjson.cpp -o ndjson.o
In file included from ndjson.cpp:8:0:
json.h:127:10: error: #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
         #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
          ^
make: *** [ndjson.o] Error 1
make: *** Waiting for unfinished jobs....
ERROR: compilation failed for package �ndjson�
* removing �/usr/local/lib/R/site-library/ndjson�
################################# End Task Log ################################# 
Error: Unhandled Exception: Child Task 520904897 failed: Error building image: Error building ndjson (0.6.0). Build exited with non-zero status: 1
Execution halted

Does anyone know how I can resolve this? Is there a way to change the GCC version that is used so it will be compatible? Do you know why this is downloading source code instead of the binary compiled library? When I run install.packages("ndjson") from my console it appears to download and install from CRAN just like any other package.

Here is my session info:

> devtools::session_info()
Session info --------------------------------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.3 (2017-11-30)
 system   x86_64, mingw32             
 ui       RStudio (1.1.414)           
 language (EN)                        
 collate  English_United States.1252  
 tz       America/Indianapolis        
 date     2018-04-19

Other libraries included in the app are:

library(shiny)
library(shinythemes)
library(dplyr)
library(magrittr)
library(ggplot2)
library(ggthemes)
library(plotly)

CRAN only makes compiled binaries available for Windows and Mac, not Linux.

The shinyapps.io environment currently is based upon Ubuntu 14.04, and the documentation has an appendix listing the system packages that are installed by default. Unfortunately, it is GCC 4.8, which is not supported by ndjson.

The team will discuss prioritizing updating the base environment to at least Ubuntu 16.04, which has GCC 5.3.

Rats....just so I'm clear, does this mean I have a showstopper for deploying to shinyapps.io? Are there any work arounds that you can think of?

Please keep me posted of the proposed update to Ubuntu 16.04. Is there an approximate time frame on when that might happen?

Thanks.

If that is a required package for you, then likely yes.

It looks like there is a pull request to ndjson with a partial fix that will not be merged due to maintainability, but you could try to see if that helps.

Thanks. I'm relatively new to this sort of thing. Can you point me in the right direction as to where I can find this pull request and what I would have to do to "try" it when deploying to shinyappsio? My experience with this is limited and I rely mostly on the R studio GUI to do most things.

See the "Please note" section: https://github.com/nlohmann/json#supported-compilers
It references this pull request.
You would need to install it locally using devtools::install_github.

It looks like that's going to be a no-go.
Could I potentially make this work if I download the shiny server (not shiny server pro) and install it on Ubuntu 16.04 myself?

Any idea when the shinyappsio server might get updated in the future?

Thanks.

The switch to Ubuntu 16.04 will take place later today.

1 Like