[R-sig-Geo] Error in the installation of rgdal on the docker osgeo/gdal:ubuntu-small

Roger Bivand Roger@B|v@nd @end|ng |rom nhh@no
Wed Jan 29 17:35:11 CET 2020


Please post plain text only.

I am not going to waste time installing the docker image on a desktop 
machine in my office when I'm not there. You can easily check out the SVN 
source of the package, debug your system, and contribute your patch back.

You have not motivated your need to install in this way, nor have I seen 
any contributions to the development marathon of adapting sp/rgdal or sf 
to PROJ6/GDAL3: 
https://www.youtube.com/watch?v=Rgn4Ns2UgAg&list=PLXUoTpMa_9s10NVk4dBQljNOaOXAOhcE0&index=4&t=0s

Your implicit affiliation is with a company, you can helpfully debug this 
and contribute back - you do not seem to be reading around this problem, 
but push it back to me as maintainer regardless. It is your problem on 
your odddish configuration. I look forward to receiving patches for the 
SVN repo.

If you think that:

'--with-proj-lib=/usr/local/share/proj'

looks odd (it does, '--with-proj-lib=/usr/local/lib' is much more likely, 
and if you register proj.pc with pkg-config, you  don't need to use those 
configure arguments), you are the best person to try alternatives.

Further, the error message now looks like multiple installed versions of 
the proj shared object: https://github.com/r-spatial/sf/issues/844.

For an alternative docker image, see 
https://github.com/r-spatial/discuss/issues/28#issuecomment-551241421 - 
correct GDAL and PROJ versions to current.

On Wed, 29 Jan 2020, Arnaud De Groof wrote:

> 
> 
> ​There is alway an error with the installation of rgdal. Is it linked to an
> issue in the definition of the arguments
> ('with-proj-lib','with-proj-share',..)?
> 
> ​ install.packages('rgdal', repos='http://R-Forge.R-project.org',
> configure.args = c('--with-gdal-config=/usr/bin/gdal-config',
> '--with-proj-include=/usr/local/include',
> '--with-proj-lib=/usr/local/share/proj',
> '--with-proj-share=/usr/local/share/proj'))
> Installing package into '/usr/local/lib/R/site-library'
> (as 'lib' is unspecified)
> trying URL 'http://R-Forge.R-project.org/src/contrib/rgdal_1.5-3.tar.gz'
> Content type 'application/x-gzip' length 1774321 bytes (1.7 MB)
> ==================================================
> downloaded 1.7 MB
> 
> * installing *source* package 'rgdal' ...
> ** using staged installation
> configure: R_HOME: /usr/lib/R
> configure: CC: gcc -std=gnu99
> configure: CXX: g++ -std=gnu++11
> configure: C++11 support available
> configure: rgdal: 1.5-3
> checking for /usr/bin/svnversion... no
> cat: inst/SVN_VERSION: No such file or directory
> configure: svn revision: 
> configure: gdal-config set to /usr/bin/gdal-config
> checking gdal-config exists... yes
> checking gdal-config executable... yes
> checking gdal-config usability... yes
> configure: GDAL: 3.1.0
> checking GDAL version >= 1.11.4... yes
> checking GDAL version <= 2.5 or >= 3.0... yes
> checking gdal: linking with --libs only... yes
> checking GDAL: gdal-config data directory readable... yes
> checking GDAL: /usr/share/gdal/stateplane.csv readable... yes
> configure: pkg-config proj exists, will use it
> configure: PROJ version: 6.3.0
> configure: Support for PROJ >= 6.0.0 not yet available, deprecated API
> defined
> configure: proj CPP flags: -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I/usr/local/include 
> configure: PROJ LIBS: -L/usr/local/share/proj 
> checking PROJ header API:... proj_api.h
> checking proj_api.h presence and usability... yes
> checking PROJ version agreement... yes
> checking Using GDAL < 3 with PROJ >= 6... no
> checking PROJ version >= 4.8.0... yes
> configure: PROJ_LIB: /usr/local/share/proj
> checking for gcc... gcc -std=gnu99
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables... 
> checking whether we are cross compiling... no
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc -std=gnu99 accepts -g... yes
> checking for gcc -std=gnu99 option to accept ISO C89... none needed
> checking how to run the C preprocessor... gcc -std=gnu99 -E
> checking for grep that handles long lines and -e... /bin/grep
> checking for egrep... /bin/grep -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking sqlite3.h usability... yes
> checking sqlite3.h presence... yes
> checking for sqlite3.h... yes
> checking for sqlite3_libversion in -lsqlite3... yes
> checking PROJ: proj.db found and readable... yes
> configure: Package CPP flags:  -I/usr/include -I/usr/local/include
> -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> configure: Package LIBS:  -L/usr/lib -lgdal -L/usr/local/share/proj -lproj
> -lsqlite3
> configure: creating ./config.status
> config.status: creating src/Makevars
> ** libs
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c OGR_write.cpp -o OGR_write.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c gdal-bindings.cpp -o gdal-bindings.o
> gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
> gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c inverser.c -o inverser.o
> gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c local_stubs.c -o local_stubs.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c ogr_geom.cpp -o ogr_geom.o
> gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c ogr_polygons.c -o ogr_polygons.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c ogr_proj.cpp -o ogr_proj.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c ogrdrivers.cpp -o ogrdrivers.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c ogrsource.cpp -o ogrsource.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c proj_info6.cpp -o proj_info6.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include
> -I/usr/local/include -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
> -I"/usr/local/lib/R/site-library/sp/include"   -fpic  -g -O2
> -fdebug-prefix-map=/build/r-base-t3diwe/r-base-3.6.2=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c projectit.cpp -o projectit.o
> g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions
> -Wl,-z,relro -o rgdal.so OGR_write.o gdal-bindings.o init.o inverser.o
> local_stubs.o ogr_geom.o ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o
> proj_info6.o projectit.o -L/usr/lib -lgdal -L/usr/local/share/proj -lproj
> -lsqlite3 -L/usr/lib/R/lib -lR
> installing to /usr/local/lib/R/site-library/00LOCK-rgdal/00new/rgdal/libs
> ** R
> ** data
> ** inst
> ** byte-compile and prepare package for lazy loading
> ** help
> *** installing help indices
> ** building package indices
> ** installing vignettes
> ** testing if installed package can be loaded from temporary location
> Error: package or namespace load failed for 'rgdal' in dyn.load(file,
> DLLpath = DLLpath, ...):
>  unable to load shared object
> '/usr/local/lib/R/site-library/00LOCK-rgdal/00new/rgdal/libs/rgdal.so':
>   /usr/local/lib/R/site-library/00LOCK-rgdal/00new/rgdal/libs/rgdal.so:
> undefined symbol: proj_create
> Error: loading failed
> Execution halted
> ERROR: loading failed
> * removing '/usr/local/lib/R/site-library/rgdal'
>>> 
> The downloaded source packages are in
>         '/tmp/Rtmpvt7qpB/downloaded_packages'
> Warning message:
> In install.packages("rgdal", repos = "http://R-Forge.R-project.org",  :
>   installation of package 'rgdal' had non-zero exit status
> 
> 
> 
> 
> ____________________________________________________________________________
> De : Roger Bivand <Roger.Bivand using nhh.no>
> Envoyé : mercredi 29 janvier 2020 16:06
> À : r-sig-geo using r-project.org; Arnaud De Groof
> Objet : Re: [R-sig-Geo] Error in the installation of rgdal on the docker
> osgeo/gdal:ubuntu-small  
> For sp, install from CRAN, or for the development version,
> remotes::install_github("rsbivand/sp").
> 
> Roger
> 
> Roger Bivand
> Norwegian School of Economics
> Bergen, Norway
> 
> ____________________________________________________________________________
> From: Arnaud De Groof <Arnaud.DeGroof using spacebel.be>
> Sent: Wednesday, January 29, 2020 4:02:15 PM
> To: r-sig-geo using r-project.org <r-sig-geo using r-project.org>; Roger.Bivand using nhh.no
> <Roger.Bivand using nhh.no>
> Subject: RE: [R-sig-Geo] Error in the installation of rgdal on the docker
> osgeo/gdal:ubuntu-small  
> 
> Thanks Roger,
> 
> I have modified the Dockerfile aiming to integrate sqlite3, libsqlite3-dev
> and rgdal from R-Forge:
> 
> RUN R -e "install.packages('rgdal', repos='http://R-Forge.R-project.org',
> configure.args =c('--with-gdal-config=/usr/bin/gdal-config','--with-gdal-share=/usr/share/g
> dal', '--with-proj-include=/usr/include',
> '--with-proj-lib=/usr/share/proj',
> '--with-proj-share=/usr/local/share/proj'))"
> 
> Unfortunately, this package have a dependency to 'sp'.
> 
> > install.packages('rgdal', repos='http://R-Forge.R-project.org',
> configure.args =c('--with-gdal-config=/usr/bin/gdal-config','--with-gdal-share=/usr/share/g
> dal', '--with-proj-include=/usr/include',
> '--with-proj-lib=/usr/share/proj',
> '--with-proj-share=/usr/local/share/proj'))
> Installing package into '/usr/local/lib/R/site-library'
> (as 'lib' is unspecified)
> Warning: dependency 'sp' is not available
> trying URL 'http://R-Forge.R-project.org/src/contrib/rgdal_1.5-3.tar.gz';
> Content type 'application/x-gzip' length 1774321 bytes (1.7 MB)
> ==================================================
> downloaded 1.7 MB
> 
> ERROR: dependency 'sp' is not available for package 'rgdal'
> * removing '/usr/local/lib/R/site-library/rgdal'
> 
> The downloaded source packages are in
>         '/tmp/Rtmp0aIlx7/downloaded_packages'
> Warning message:
> In install.packages("rgdal", repos = "http://R-Forge.R-project.org",  :
>   installation of package 'rgdal' had non-zero exit status
> 
> So, I added the package 'sp' :
> 
> RUN R -e "install.packages('sp', repos='http://R-Forge.R-project.org')";
> 
> But this package seems not available for the version of R 3.6.2:
> 
> install.packages('sp', repos='http://R-Forge.R-project.org')
> Installing package into '/usr/local/lib/R/site-library'
> (as 'lib' is unspecified)
> Warning message:
> package 'sp' is not available (for R version 3.6.2) 
> Solution : downgrade R?
> 
> Thanks,
> 
> Arnaud
> 
> 
> ---------------------------------------------------------------------------
> ---
> 
> E-MAIL DISCLAIMER
> 
> The present message may contain confidential and/or legally privileged
> information. If you are not the intended addressee and in case of a
> transmission error, please notify the sender immediately and destroy this
> E-mail. Disclosure, reproduction or distribution of this document and its
> possible attachments is strictly forbidden.
> 
> SPACEBEL denies all liability for incomplete, improper, inaccurate,
> intercepted, (partly) destroyed, lost and/or belated transmission of the
> current information given that unencrypted electronic transmission cannot
> currently be guaranteed to be secure or error free.
> Upon request or in conformity with formal, contractual agreements, an
> originally signed hard copy will be sent to you to confirm the information
> contained in this E-mail.
> 
> SPACEBEL denies all liability where E-mail is used for private use.
> 
> SPACEBEL cannot be held responsible for possible viruses that might corrupt
> this message and/or your computer system.
> ---------------------------------------------------------------------------
> ----
> 
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand using nhh.no
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en


More information about the R-sig-Geo mailing list