davidearn / burnout

tools for computing epidemic burnout probability
GNU General Public License v3.0
0 stars 0 forks source link

gsl #4

Open dushoff opened 4 months ago

dushoff commented 4 months ago

Does burnout depend on gsl? Should this be documented? Could we add brief installation instructions (or notes)?

bbolker commented 4 months ago

burnout does explicitly depend on the gsl package (gsl is listed in its Imports field), so in principle gsl should be automatically installed if you install burnout in a way that is dependency-aware (definitely install.packages(), but I would have thought remotes::install_github() would auto-install dependencies as well ...??)

I can also imagine that you might be running into trouble because gsl in turns on having GSL (the Gnu Scientific Library) installed on your system ... if you were using r2u this should get handled automatically ...

Can you be slightly more specific? remotes::install_github("davidearn/burnout") should just work (although I was having some weird interactions with r2u/bspm) ...

For what it's worth devtools::check() passes cleanly, so except for possibly looking at some of the fussier reasons that brand-new package submissions run into trouble, we should be good to submit this to CRAN if we want.

Of course it would always be good to write tests - at present there is exactly one test ...

davidearn commented 4 months ago

Oddly, I replied immediately but the reply doesn't appear here. Here it is FWIW:

Date: Thu, 23 May 2024 14:28:09 -0400
From: David Earn <earn@math.mcmaster.ca>
To: reply+ADMXZJ46DGRVRSR5BYXCYYWELNVL5EVBNHHITZTALY@reply.github.com
Cc: David Earn <earn@math.mcmaster.ca>, Ben Bolker <bbolker@gmail.com>, Jonathan Dushoff <jdushoff@gmail.com>
Subject: Re: [davidearn/burnout] gsl (Issue #4)
Parts/Attachments:
   1   OK     20 lines  Text
   2 Shown    59 lines  Text
----------------------------------------

Yes, gsl is is used for Lambert W and and other special functions.  Yes, documentation is needed... I still plan to get this up on CRAN as well...

I've updated burnout to handle the SIRS model, which I'm using to run things for our EEID poster that I have to get together in the next 4 weeks.

David

dushoff commented 4 months ago

echo 'library(remotes); install_github("davidearn/burnout", force=FALSE)' | sudo /usr/bin/R --vanilla && touch burnout.rgit

fails with:

|| ERROR: dependency ‘gsl’ is not available for package ‘burnout’ || * removing ‘/tmp/Rtmp78wsNf/Rinst183be34bfe417/burnout’

I did not have library issues: installing gsl from cran (via apt-get) solves the problem.

bbolker commented 4 months ago

I'm honestly not sure what's going on here; I think remotes::install_github() should be installing gsl automatically. I suspect this is a rabbit hole that may (?) not affect the average user ... (in other words, under normal circumstances one expects remotes::install_github() to install dependencies automatically (at least if the dependencies argument isn't set to FALSE).

It's conceivable that dependency installation is failing because you're running non-interactively and don't have a default repository set ... although I might (?) expect that to fail in a different way, e.g.

Rscript --vanilla -e 'install.packages("gsl")'
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Error in contrib.url(repos, type) : 
  trying to use CRAN without setting a mirror
Calls: install.packages -> startsWith -> contrib.url
Execution halted

although possibly remotes is trapping this error in some way ... ?

In any case, it would be interesting to see what happens if you do:

echo 'library(remotes); install_github("davidearn/burnout",
force=FALSE, repos = c(CRAN="https://cloud.r-project.org"))'

Bottom line, I don't think we should have to document how to install upstream dependencies, since it should be part of the standard machinery ...

dushoff commented 4 months ago

Adding the repos argument does not change the behaviour. It runs through a lot of installation steps and then fails, complaining about gsl.

On Fri, May 24, 2024 at 9:42 AM Ben Bolker @.***> wrote:

Caution: External email.

I'm honestly not sure what's going on here; I think remotes::install_github() should be installing gsl automatically. I suspect this is a rabbit hole that may (?) not affect the average user ... (in other words, under normal circumstances one expects remotes::install_github() to install dependencies automatically (at least if the dependencies argument isn't set to FALSE).

It's conceivable that dependency installation is failing because you're running non-interactively and don't have a default repository set ... although I might (?) expect that to fail in a different way, e.g.

Rscript --vanilla -e 'install.packages("gsl")' Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) Error in contrib.url(repos, type) : trying to use CRAN without setting a mirror Calls: install.packages -> startsWith -> contrib.url Execution halted

although possibly remotes is trapping this error in some way ... ?

In any case, it would be interesting to see what happens if you do:

echo 'library(remotes); install_github("davidearn/burnout",force=FALSE, repos = c(CRAN="https://cloud.r-project.org"))'

Bottom line, I don't think we should have to document how to install upstream dependencies, since it should be part of the standard machinery ...

— Reply to this email directly, view it on GitHub https://github.com/davidearn/burnout/issues/4#issuecomment-2129571920, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW5E6MWPJWVYHR4FCHTQG3ZD47VVAVCNFSM6AAAAABIGFP4L2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRZGU3TCOJSGA . You are receiving this because you authored the thread.Message ID: @.***>

-- Jonathan Dushoff McMaster University Department of Biology https://mac-theobio.github.io/ http://jd-mathbio.blogspot.com/

bbolker commented 4 months ago

Hmm. I'll try it in a Docker container when I get a chance ...

bbolker commented 4 months ago

Naive docker run (docker run --rm -ti rocker/r-base; run install.packages("remotes") and remotes::install_github("davidearn/burnout") from R fails because gsl is missing system requirements.

But this works:

docker run --rm -ti rocker/r-base

From a separate terminal:

export DPS=`docker ps | tail -1 | awk '{print $NF}'`
docker exec -it $DPS bash
apt update
apt-get install libgsl0-dev

Back to the original terminal:

install.packages("remotes")
remotes::install_github("davidearn/burnout")
bbolker commented 4 months ago

Just to confirm: upstream of the "gsl is not available" error message did you see any error messages about configuration failing because config-gsl wasn't available?

dushoff commented 4 months ago

No, sorry. I'll check if I find a place where I haven't already installed. I was wrongly assuming that there was no config problem, because I was able to automatically install gsl successfully. But it hadn't occurred to me that make was using deb to install gsl, so it didn't test what I thought.