4DModeller / fdmr

4DModeller, Bayesian Spatio-temporal modeling in R
https://4dmodeller.github.io/fdmr/
GNU General Public License v3.0
16 stars 11 forks source link

Timeout error when downloading INLA dependency #337

Open PieterjanRobbe opened 3 days ago

PieterjanRobbe commented 3 days ago

Hi there,

I'm having some issues trying to install the dependencies for this package. It seems like the command below runs into a timeout error. I've tried to install the package several times over the past few days, but the same error keeps popping up. This is not related to a slow internet connection (other downloads are fine). Any idea what I'm doing wrong?

Thanks!

> install.packages("INLA", repos = c(getOption("repos"), INLA = "https://inla.r-inla-download.org/R/stable"), dep = TRUE)
Warning in install.packages :
  dependencies ‘Rgraphviz’, ‘graph’, ‘INLAspacetime’ are not available

  There is a binary version available but the source version is later:
       binary   source needs_compilation
INLA 23.04.24 24.06.27             FALSE

installing the source package ‘INLA’

trying URL 'https://inla.r-inla-download.org/R/stable/src/contrib/INLA_24.06.27.tar.gz'
Content type 'application/x-gzip' length 62225912 bytes (59.3 MB)
=
downloaded 1.2 MB

Warning in install.packages :
  downloaded length 1263866 != reported length 62225912
Warning in install.packages :
  URL 'https://inla.r-inla-download.org/R/stable/src/contrib/INLA_24.06.27.tar.gz': Timeout of 60 seconds was reached
Error in download.file(url, destfile, method, mode = "wb", ...) : 
  download from 'https://inla.r-inla-download.org/R/stable/src/contrib/INLA_24.06.27.tar.gz' failed
Warning in install.packages :
  download of package ‘INLA’ failed

breadcrumb

finnlindgren commented 2 days ago

You need to install the prebuilt binaries, and not the source version. Also, make sure you have R 4.4 and use

install.packages("INLA", repos = c(getOption("repos"), INLA = "https://inla.r-inla-download.org/R/testing"), dep = TRUE)

i.e. testing, not stable.

In addition, your internet connection seems slow, so R times out the file download. use e.g. options(timeout = 3600) to set a longer timeout than 60 seconds.

finnlindgren commented 2 days ago

In some cases on some platforms, R may need to be told to ignore the newer source version, and force it to install a binary version. The https://www.r-inla.org/download-install mentions a related issue for macOS & homebrew.

PieterjanRobbe commented 2 days ago

Hi @finnlindgren, thanks, changing from stable to testing did the trick!

I was following the instructions from the README file. Perhaps it's a good idea to update the README to reflect this change?