Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis CI error: compilation failed for package ‘rgdal’ #89

Closed
damianooldoni opened this issue Aug 5, 2020 · 10 comments
Closed

Travis CI error: compilation failed for package ‘rgdal’ #89

damianooldoni opened this issue Aug 5, 2020 · 10 comments

Comments

@damianooldoni
Copy link
Member

damianooldoni commented Aug 5, 2020

After reverting the one line commit I erroneously pushed to master, Travis CI fails to build inborutils due to compilation failure: compilation failed for package ‘rgdal’. Build: https://travis-ci.com/github/inbo/inborutils
Any idea?
By the way, I was constantly experiencing this failure compiling rgdal even yesterday while working on branch setup_codingclub_session. So, it seems this failure has nothing to do with any development I was doing yesterday, which indeed didn't include any use of rgdal.

damianooldoni added a commit that referenced this issue Aug 5, 2020
@damianooldoni
Copy link
Member Author

Maybe it is something related to the latest Ubuntu, Xenial: see travis-ci/travis-ci#5821

@damianooldoni
Copy link
Member Author

After some more research, I found some more recent issues specifically gdal related:

travis-ci/travis-ci#5852 and pfmc-assessments/geostatistical_delta-GLMM#38 (comment)
Following the link to solving commit in the second issue, I see the following lines being added:

before_install:
  - sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes
  - sudo apt-get --yes --force-yes update -qq
  - sudo apt-get install --yes libudunits2-dev libproj-dev libgeos-dev libgdal-dev

while removing the apt_packages section.

I will give a try in this branch.

@damianooldoni
Copy link
Member Author

It seems it doesn't solve the problem. Here the link to the Travis's failed build:
https://travis-ci.com/github/inbo/inborutils/jobs/368568380

@YuriNiella
Copy link

I'm having the same issue on my package with rgdal. The following solution does not seem to work either:

before_install:
  - R -e 'install.packages("rgdal", repos=c("http://R-Forge.R-project.org", "http://cran.rstudio.com"))'

@YuriNiella
Copy link

The following solution does not work either for me:

before_script:
  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then R -e "install.packages('rgdal', type = 'source')"; fi

In my case, it seems like rgdal is being only successfully installed only on windows, but failing in mac and linux:

checking for gdal-config... no
no
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Users/runner/work/_temp/Library/rgdal’

The downloaded source packages are in
	‘/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/Rtmp16eRHy/downloaded_packages’
Warning message:
In i.p(...) : installation of package ‘rgdal’ had non-zero exit status

@damianooldoni
Copy link
Member Author

Thanks @YuriNiella for your input. @florisvdh, I know you are a fervent Linux user, how do you get rgdal installed on your laptop? Probably an older Ubuntu version?

@florisvdh
Copy link
Member

florisvdh commented Aug 10, 2020

Sorry, I overlooked your question @damianooldoni . I'll try to have a further look at the problem this week. Meanwhile: perhaps something similar as explained in #81 (comment)?

In response to your question: rgdal for Linux does not have gdal included; it binds to the gdal library which must first be present on the system. The latter is done by this line - i.e. the gdal development package on Ubuntu (which will draw in some other packages as well) - all precompiled Ubuntu packages. [rgdal on my laptop just installs like any R-package that is compiled at installation time, as will happen here - on condition gdal is present already].

Note that the referred comment relates to a previous state of the yml, which installed the precompiled Linux package r-cran-rgdal - but it had an unwanted dependency on another R version which caused problems in the build. Before, r-cran-rgdal may have been chosen to speed things up (no R package compilation), but actually the speed-up is one-time-only-merit per R version on Travis, as it uses a cache.

@ThierryO
Copy link
Contributor

This is how I install rgdal in the Rstable docker image: https://github.com/inbo/Rstable/blob/6ac49b53d3d0b2422caa3598d4699cfaf621d881/Dockerfile#L275
The cran_install is a bash script to install a specific version of a package. You can use install.packages("rgdal") instead.

@florisvdh
Copy link
Member

@damianooldoni the cause is a CRAN version of rgdal which erroneously did not build against older versions of GDAL/PROJ; see this post of R. Bivand. However in the meantime this has been solved in the current CRAN version; just re-running the Travis build should succeed - see the successful Travis builds of the (experimental) travis_tweak branch.

Given the fact that we can expect this to happen more in the future (as warned for in the referenced post):

  • we should be able to move on and get GDAL 3 / PROJ >= 6 on Travis - meaning that we need Ubuntu Bionic at least
    • a question has been posted on that here. It refers to the travis_tweak branch, so we better still leave it there for a while. Note that, if indeed the unstable PPA would be added for the Bionic build environment (instead of the stable one), no manual tinkering as in here will be needed.
  • for now, while all is OK on master, I've sent a PR .travis.yml: ligdal-dev instead of libgdal1-dev * #90 which just works as well and which will be bionic- and focal-compliant considering the libgdal-dev package name. I believe libgdal1-dev still stems from Trusty (Ubuntu 14.04).

@damianooldoni
Copy link
Member Author

Thanks @ThierryO and @florisvdh for your inputs. Indeed, I can confirm that the problem has been solved on my branch as on master as reported by @florisvdh. I think we can close this issue. Discussion can be continued, if needed on PR #90.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants