[R-pkg-devel] Library not loaded =?utf-8?Q?=E2=80=98libgdal.dylib=E2=80=99_?=when building package on travis (osx)

Patrick Schratz patrick.schratz at gmail.com
Sun Apr 30 18:46:54 CEST 2017


Hi guys,

the problem was that `rgdal` was installed using its binary - which causes problems due to a wrong link to `libgdal.dylib`. When testing on OSX on travis and using `sudo: required`, all dependencies are installed using binaries (see https://docs.travis-ci.com/user/languages/r/).

My workaround was to reinstall `rgdal` after installation of all dependencies using `R -e "install.packages('rgdal', type = 'source’)”`.

I also opened an issue on travis-ci on how to deal with that specific rgdal issue in the future: https://github.com/travis-ci/travis-ci/issues/7675

Thanks again to Jonathan Love for tracking down the issue. Very much appreciated!

Cheers, Patrick

PhD Student at Department of Geography - GIScience group
Friedrich-Schiller-University Jena, Germany
Tel.: +49-3641-9-48973
Web: https://pat-s.github.io

On 29. Apr 2017, 15:34 +0200, Patrick Schratz <patrick.schratz at gmail.com>, wrote:
> Hi guys,
>
> @ Alexandre
> Thanks for suggesting to compile from source. I normally try to use this as the last option because this will usually take a while for gdal. However, it may install to other locations as the brew installation does so I just tried it and faced some permission problems during copying:
>
> /Users/travis/build/jannes-m/RQGIS/gdal-2.1.3/install-sh -c /Users/travis/build/jannes-m/RQGIS/gdal-2.1.3/libgdal.dylib /usr/lib/libgdal.dylib.2.1.3
> cp: /usr/lib/#inst.15842#: Operation not permitted
> make: *** [install-lib] Error 1
>
> Log: https://travis-ci.org/jannes-m/RQGIS/jobs/227128054
>
> I am somewhat hesitate to “go back” and solve this gdal2 installation/make issue when I already have a working gdal2 installation via homebrew which “just” seems to miss some correct linking to libgdal.dylib.
> On Linux I use the ubuntugis PPA to install gdal 2.1.0 which is way faster than compiling from source (I did that in the past). So maybe this would be even an option for you to speed up your travis builds?
> Thanks for your reply, much appreciated!
>
> @ Jonathan
> A walk through of your suggested option would be awesome! We could do so in our Slack group if this is better suited than mailing for this case? Just write me whatever you prefer.
>
> Cheers, Patrick
>
>
> PhD Student at Department of Geography - GIScience group
> Friedrich-Schiller-University Jena, Germany
> Tel.: +49-3641-9-48973
> Web: https://pat-s.github.io
>
> On 29. Apr 2017, 15:22 +0200, Jonathon Love <jon at thon.cc>, wrote:
> > hi,
> >
> > On 29/4/17 21:29, Patrick Schratz wrote:
> > > Nope, still an open issue. I also do not have any ideas left what I could try next.
> > >
> > > Tried the export hints (e.g. bash profile) given in 'brew info gdal2' and checked with my local configuration but I do not see what the possible issue could be here.
> > >
> > > On 29. Apr 2017, 13:24 +0200, Alexandre Courtiol <alexandre.courtiol at gmail.com>, wrote:
> > > > Did you already sort out your issue?
> > > >
> > > > On 28 April 2017 at 17:19, Patrick Schratz <patrick.schratz at gmail.com (mailto:patrick.schratz at gmail.com)> wrote:
> > > > > Hi everyone,
> > > > >
> > > > > the following error gives me headaches. When building my package on Travis CI (OS X build), I get the following error:
> > > > >
> > > > > Building with: R CMD build
> > > > > 4.64s$ R CMD build .
> > > > > * checking for file ‘./DESCRIPTION’ ... OK
> > > > > * preparing ‘RQGIS’:
> > > > > * checking DESCRIPTION meta-information ... OK
> > > > > * installing the package to build vignettes
> > > > > -----------------------------------
> > > > > * installing *source* package ‘RQGIS’ ...
> > > > > ** R
> > > > > ** data
> > > > > *** moving datasets to lazyload DB
> > > > > ** inst
> > > > > ** byte-compile and prepare package for lazy loading
> > > > > Error in dyn.load(file, DLLpath = DLLpath, ...) :
> > > > > unable to load shared object '/Users/travis/R/Library/rgdal/libs/rgdal.so':
> > > > > dlopen(/Users/travis/R/Library/rgdal/libs/rgdal.so, 6): Library not loaded: /Builds/unix/recipes/build/gdal-2.1.3-obj/libgdal.dylib
> > > > > Referenced from: /Users/travis/R/Library/rgdal/libs/rgdal.so
> > > > > Reason: image not found
> >
> > it looks to me that rgdal.so is looking for libgdal.dylib in
> > /Builds/unix/recipes/build/build/gdal02.1.3-obj
> >
> > you can confirm this with the command:
> >
> > otool -L /Users/travis/R/Library/rgdal/libs/rgdal.so
> >
> > it will list where it's expecting to find libgdal.dylib
> >
> > my guess is that the root of the issue is that the libgdal.dylib that
> > rgdal.so linked against, thinks that it lives at
> > /Builds/unix/recipes/build/build/gdal02.1.3-obj
> >
> > you can confirm this with:
> >
> > otool -L /Builds/unix/recipes/build/gdal-2.1.3-obj/libgdal.dylib
> >
> > you can change where .so's and .dylibs think they live, and where they
> > think their dependencies live with the install_name_tool tool.
> >
> > i can walk you through this off-list if you need.
> >
> > cheers
> >
> > jonathon
> >
> > ______________________________________________
> > R-package-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list