njtierney / maxcovr

Tools in R to make it easier to solve the Maximal Coverage Location Problem
http://maxcovr.njtierney.com/
GNU General Public License v3.0
42 stars 11 forks source link

currently breaking on installation of Rglpk and gurobi #80

Closed njtierney closed 5 years ago

njtierney commented 5 years ago

It looks like the package is breaking on installation of Rglpk and gurobi for Travis:

image

Which is stopping progress for #50.

It looks like prioritizr gets around the gurobi problem, they even have an awesome vignette that explains how to install it

I'm not sure how to get around this problem - I'm going to tag @jeffreyhanson in to see if he might have some wise words of wisdom here

jeffreyhanson commented 5 years ago

Hi @njtierney! How are you? I hope everything's going well. Unfortunately, I don't really have any helpful solutions. At the moment, all of the tests in prioritizr which rely Gurobi are skipped on Travis (using skip_if_not_installed("gurobi")). Unfortunately, this means that we have to run tests locally in order to test if prioritizr is using Gurobi correctly, but I find the benefit of having access to Gurobi outweighs this cost. Perhaps one approach would be to try installing Gurobi on Travis and activating its 2-week demo mode automatically? It looks like you can download the Gurobi tarball from a static link on its website, but you might need some clever coding in order to automatically find the filename for the latest version.

njtierney commented 5 years ago

Hey @jeffreyhanson !

So nice to hear from you! I'm good mate, hope things are going well in Porto, Portugal :)

Thanks for your advice!

I would definitely run skip_if_not_installed("gurobi"), but I don't even use it in my tests. This was because I was worried I would trigger Travis errors. But I guess I can now use that.

But the confusing thing is that:

  1. it seems to break on installing RGlpk - not sure how to stop that
  2. gurobi is in Suggests (https://github.com/njtierney/maxcovr/blob/master/DESCRIPTION#L34)
  3. travis does not install on suggests: https://github.com/njtierney/maxcovr/blob/master/.travis.yml#L13

I'm not quite sure how to solve this issue - the only thing I can think of right now is to clear the package cache on Travis. I'll see how that goes.

njtierney commented 5 years ago

OK so I went on a bit of a journey and found your thread, Jeff, on how travis builds on success: https://github.com/prioritizr/prioritizr/blob/master/.travis.yml

And then I have now shamelessly copied most of your travis YAML code here: https://github.com/prioritizr/prioritizr/blob/master/.travis.yml

Hopefully this helps solve the problem!

mpadge commented 5 years ago

Newly simplified way to express that stuff in travis; see osmdata for demo - all done via addons, rather than explicit before_install calls. addons are in this case ubuntu-explicit, and the other stuff you can put in the matrix for oxs. In case that helps ...

njtierney commented 5 years ago

Thanks, I it is solved now!

image

I had to include this line: https://github.com/njtierney/maxcovr/blob/master/.travis.yml#L38

Suggested by Rich FitzJohn and Bryce Mecum.

jeffreyhanson commented 5 years ago

Awesome! Glad to see you got it working. Just a heads up in case this causes issues for you later on, I sometimes find that R Ubuntu packages (e.g. r-cran-rsymphony and r-cran-rglpk) on Travis can sometimes fail to install when new versions of R get released or when testing developmental versions of R, so I just manually install/apt-get the Ubuntu system packages manually (e.g. coinor-libcgl-dev coinor-libclp-dev coinor-libcoinutils-dev coinor-libosi-dev coinor-libsymphony-dev coinor-libsymphony3 for SYMPHONY).