Problems installing the MODIStsp package in RStudio Cloud

I have tried to install the MODIStsp package using this code:

devtools::install_github("ropensci/MODIStsp")
# Downloading GitHub repo ropensci/MODIStsp@master
#Installing 22 packages: bitops, cairoDevice, data.table, foreach, gdalUtils, gWidgets, gWidgetsRGtk2, #iterators, pacman, R.methodsS3, R.oo, R.utils, raster, rgdal, rgeos, RGtk2, sp, stringi, stringr, xml2, #xts, zoo
# ..................   later ...................
# * DONE (bitops)
#* installing *source* package ‘cairoDevice’ ...
#** package ‘cairoDevice’ successfully unpacked and MD5 sums checked
#checking for pkg-config... pkg-config
#ERROR: gtk+2.0 not found by pkg-config.
#ERROR: configuration failed for package ‘cairoDevice’
#* removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.5/cairoDevice’
#Error in i.p(...) : 
# (converted from warning) installation of package ‘cairoDevice’ had non-zero exit status

The MODISstp developers state here that:

To install MODIStsp on Linux, you have to first install the following required dependencies:

  • Cairo >= 1.0.0, ATK >= 1.10.0, Pango >= 1.10.0, GTK+ >= 2.8.0, GLib >= 2.8.0 (required by package RGtk2 )
  • Curl (required by package curl )
  • GDAL >= 1.6.3, PROJ.4 >= 4.4.9 (required by package rgdal )

On Debian and Ubuntu-based systems, to install those packages open a terminal and type:

sudo apt-get install r-cran-cairodevice r-cran-rgtk2 libcairo2-dev libatk1.0-dev libpango1.0-dev libgtk2.0-dev libglib2.0-dev libcurl4-openssl-dev libgdal-dev libproj-dev

Two questions:

  1. Could you please install the MODISstp package in my "remotesensing" project?
  2. If not, it is possible to get a sudo password to install package dependencies?

Thanks for your help.

Keep in mind that there is no display with rstudio.cloud, so gtk has nowhere to render.

We will keep this in mind, but are unlikely to do anything in the short term.

Hi,

this is a known problem, preventing installing MODIStsp on "headless" systems. See:

On Travis-CI, I managed to get the build working by adding this to the yaml config:

export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start

, but I do not know if it helps in this case.

I am planning to make a new "GUI-less" branch of the package to address the issue, allowing to use the package via scripting (using an options file) also on headless systems. I'll keep you posted.
Sooner or later, I also plan to replace the gtk GUI with a shiny interface, but that will take time....

1 Like