[R-sig-Geo] rgdal 1.5-8 released on CRAN

Thiago V. dos Santos th|_ve|o@o @end|ng |rom y@hoo@com@br
Sun May 31 04:23:16 CEST 2020


Hi Roger, 

Thanks for all the hints. However, I am still struggling with this.

I have PKG_CONFIG_PATH set to /opt/local/lib/proj6/lib/pkgconfig:
cat $PKG_CONFIG_PATH/proj.pc
prefix=/opt/local/lib/proj6
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datadir=${prefix}/share/proj

Name: proj
Description: Cartographic Projections Library.
Requires:
Version: 6.3.2
Libs: -L${libdir} -lproj
Libs.Private: -L/opt/local/lib -lsqlite3 -lstdc++
Cflags: -I${includedir}



Note that the paths described within proj.pc are all good:
ls /opt/local/lib/proj6/lib/
libproj.15.dylib* libproj.a         libproj.dylib@    pkgconfig/

ls /opt/local/lib/proj6/include/
geodesic.h            proj/                 proj_api.h            proj_experimental.h
org_proj4_PJ.h        proj.h                proj_constants.h      proj_symbol_rename.h

ls /opt/local/lib/proj6/share/proj/
BETA2007.gsb          ITRF2008              WO                    nad.lst               null                  prvi
CH                    ITRF2014              alaska                nad27                 nzgd2kgrid0005.gsb    stgeorge
FL                    MD                    conus                 nad83                 other.extra           stlrnc
GL27                  TN                    egm96_15.gtx          ntf_r93.gsb           proj.db               stpaul
ITRF2000              WI                    hawaii                ntv1_can.dat          projjson.schema.json  world



It is also recognized by the system:
pkg-config --list-all
...
netcdf                              netCDF - NetCDF Client Library for C
cairo-xml                           cairo-xml - xml surface backend for cairo graphics library
proj                                proj - Cartographic Projections Library.
damageproto                         DamageProto - Damage extension headers
libraw_r                            libraw - Raw image decoder library (thread-safe)
...

pkg-config proj --libs
-L/opt/local/lib/proj6/lib -lproj



I am sure that my system's gdal was built against proj6: 
gdal-config --dep-libs
-L/opt/local/lib -lIlmImf -lImath -lHalf -lIex -lIexMath -lIlmThread -lcrypto -lqhull -lqhull -L/opt/local/lib -lgeos_c -lwebp -L/opt/local/lib -lsqlite3 -L/opt/local/lib -lexpat -L/opt/local/lib -lopenjp2 -L/opt/local/include -L/opt/local/include/lib -ljasper -L/opt/local/lib -lnetcdf -L/opt/local/lib -lhdf5 -L/opt/local/lib -lmfhdf -ldf -lsz -lgif -lCharLS -lpng -lzstd -L/opt/local/lib/proj6/lib -lproj -lsqlite3 -lz -lpthread -ldl -L/usr/local/lib -L/opt/local/lib -lspatialite -lpcre -L/opt/local/lib -lcurl -L/opt/local/lib -lxml2



and yet, this is what I get when I try to install rgdal relying only on pkg-config:

R
install.packages('rgdal', type='source')

Installing package into ‘/Users/thiago/Documents/r-packages’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rgdal_1.5-8.tar.gz'
Content type 'application/x-gzip' length 2299235 bytes (2.2 MB)
==================================================
downloaded 2.2 MB


* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
** using staged installation
configure: R_HOME: /Library/Frameworks/R.framework/Resources
configure: CC: /opt/local/bin/clang
configure: CXX: /opt/local/bin/clang++
configure: C++11 support available
configure: rgdal: 1.5-8
checking for /usr/bin/svnversion... yes
configure: svn revision: 990
checking for gdal-config... /opt/local/bin/gdal-config
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: /opt/local/share/gdal/stateplane.csv readable... yes
configure: pkg-config proj exists, will use it
configure: PROJ version: 6.3.2
configure: proj CPP flags: -DPROJ_H_API -I/opt/local/lib/proj6/include
configure: PROJ LIBS: -L/opt/local/lib/proj6/lib -lproj
checking PROJ header API:... proj.h
checking for gcc... /opt/local/bin/clang
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 /opt/local/bin/clang accepts -g... yes
checking for /opt/local/bin/clang option to accept ISO C89... none needed
checking how to run the C preprocessor... /opt/local/bin/clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
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 proj.h usability... yes
checking proj.h presence... yes
checking for proj.h... yes
checking for proj_context_create in -lproj... no
configure: error: proj_context_create not found in libproj.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/Users/thiago/Documents/r-packages/rgdal’
* restoring previous ‘/Users/thiago/Documents/r-packages/rgdal’

The downloaded source packages are in
    ‘/private/var/folders/bm/7dq3pmrx1ynbh2_j69yl_v2r0000gn/T/RtmpLPUVvd/downloaded_packages’
Warning message:
In install.packages("rgdal", type = "source") :
  installation of package ‘rgdal’ had non-zero exit status


Kind of lost here... Do you happen to think of any other thing I could look at? Otherwise, I will just wait until the macOS binaries are released on CRAN (not really need the latest rgdal on this machine right now).

Greetings,
 -- Thiago V. dos Santos

ThiagoDosSantos.com
MudancasClimaticasBrasil.com



On Saturday, May 30, 2020, 09:08:20 AM GMT-3, Roger Bivand <roger.bivand using nhh.no> wrote: 


On Fri, 29 May 2020, Thiago V. dos Santos wrote:

> Dear Roger,
>
> Many thanks for the effort keeping rgdal up-to-date with proj6.
>
> I'd like to report that I am unable to install rgdal 1.5.8 on my macOS 
> system. I am reporting this error here on the list because I thought it 
> would be the best channel in terms of reaching future users experiencing 
> the same error. Please apologize if my rationale is not right, and 
> ignore this message.
>
> GDAL was installed via MacPorts and is at its latest version, 3.1.0 (at 
> the time of this writing). Proj6 has also been installed via Macports.
>
> This is how I am trying to install it:
>
> export PKG_CONFIG_PATH=/opt/local/lib/proj6/lib/pkgconfig
> R
> install.packages('rgdal', type="source", configure.args=c(
>      '--with-proj-include=/opt/local/lib/proj6/include',
>      '--with-proj-lib=/opt/local/lib/proj6/lib'))
>
> and this is the output I get:
>
> R version 4.0.0 (2020-04-24) -- "Arbor Day"
> Copyright (C) 2020 The R Foundation for Statistical Computing
> Platform: x86_64-apple-darwin17.0 (64-bit)
>
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
>
>   Natural language support but running in an English locale
>
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
>
>> install.packages('rgdal', type="source", configure.args=c(
> +      '--with-proj-include=/opt/local/lib/proj6/include',
> +      '--with-proj-lib=/opt/local/lib/proj6/lib'))
> Installing package into ‘/Users/thiago/Documents/R-packages’
> (as ‘lib’ is unspecified)
>
>
>     trying URL 'https://cran.r-project.org/src/contrib/rgdal_1.5-8.tar.gz'
> Content type 'application/x-gzip' length 2299235 bytes (2.2 MB)
> ==================================================
> downloaded 2.2 MB
>
>
> * installing *source* package ‘rgdal’ ...
> ** package ‘rgdal’ successfully unpacked and MD5 sums checked
> ** using staged installation
> configure: R_HOME: /Library/Frameworks/R.framework/Resources
> configure: CC: /opt/local/bin/gcc
> configure: CXX: /opt/local/bin/g++
> configure: C++11 support available
> configure: rgdal: 1.5-8
> checking for /usr/bin/svnversion... yes
> configure: svn revision: 990
> checking for gdal-config... /opt/local/bin/gdal-config
> 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: /opt/local/share/gdal/stateplane.csv readable... yes
> configure: pkg-config proj exists, will use it

So far so good, but you chose to override pkg-config proj by passing 
configure arguments. You should let pkg-config proj provide those values.

> configure: PROJ version: 6.3.2
> configure: proj CPP flags: -DPROJ_H_API -I/opt/local/lib/proj6/include
> configure: PROJ LIBS: -L/opt/local/lib/proj6/lib
> checking PROJ header API:... proj.h
> checking for gcc... /opt/local/bin/gcc
> 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 /opt/local/bin/gcc accepts -g... yes
> checking for /opt/local/bin/gcc option to accept ISO C89... none needed
> checking how to run the C preprocessor... /opt/local/bin/gcc -E
> checking for grep that handles long lines and -e... /usr/bin/grep
> checking for egrep... /usr/bin/grep -E
> checking for ANSI C header files... rm: conftest.dSYM: is a directory
> rm: conftest.dSYM: is a directory
> 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 proj.h usability... yes
> checking proj.h presence... yes
> checking for proj.h... yes

Also OK.

> checking for proj_context_create in -lproj... no
> configure: error: proj_context_create not found in libproj.

The directory where libproj should be does not contain it - whether you 
got it wrong, pkg-config got it wrong, or for some other reason, the 
library was not found.

> ERROR: configuration failed for package ‘rgdal’
> * removing ‘/Users/thiago/Documents/R-packages/rgdal’
> * restoring previous ‘/Users/thiago/Documents/R-packages/rgdal’
>
>
> The downloaded source packages are in
>     ‘/private/var/folders/_z/01gg71zs19g816v6m2dddt8w0000gn/T/RtmpvZAChj/downloaded_packages’
> Warning message:
> In install.packages("rgdal", type = "source", configure.args = c("--with-proj-include=/opt/local/lib/proj6/include",  :
>   installation of package ‘rgdal’ had non-zero exit status
>
> I found this error to be quite mysterious, and could not find any 
> previous discussion about it.

Try to avoid googling, it is usually misleading. Running ./configure in 
the untarred source package directory, and running ./configure --help to 
show the arguments to configure can be much more helpful. Crucially, they 
are up to date, while most search hits are old, and they are ordered by 
hit counts, which is certainly no guarantee of precision.

>
> Are you familiar with it? Is there any other argument that I can pass to 
> install.packages to solve it?

Try not setting configure arguments and let pkg-config proj do the work if 
you feel you can trust it. If, however, you have multiple installs of GDAL 
and/or PROJ, the proj.pc file may point to a deleted install. Download and 
untar the source package, and run just ./configure with its argumments, or 
setting PKG_CONFIG_PATH= until you find a recipe that works that far.


Roger

>
> Greetings,
>  -- Thiago V. dos Santos
>
> ThiagoDosSantos.com
> MudancasClimaticasBrasil.com
>
>
>
>
>
>
> On Thursday, May 28, 2020, 08:53:50 AM GMT-3, Roger Bivand <roger.bivand using nhh.no> wrote:
>
>
>
>
>
> With sp 1.4-2 and rgdal 1.5-8, those using GDAL 3 and PROJ 6 (including
> users of the CRAN Windows binary when it comes) will be part of the big
> migration to WKT2 from Proj4 strings for CRS representation. See
>
> https://cran.r-project.org/web/packages/rgdal/vignettes/CRS_projections_transformations.html
>
> or for a better rendering of "\phi" and bib-handling:
>
> https://rgdal.r-forge.r-project.org/articles/CRS_projections_transformations.html
>
> for background and https://www.r-spatial.org/r/2020/03/17/wkt.html for the
> full sf and sp story.
>
> You will see lots of warnings, they should grab your attention, that is
> what they are for. We need your attention to be as sure as we can be that
> your results - if affected by the transition - have been checked by you.
>
> I plan to flip the warnings to default off from rgdal 1.6-*, and sp 1.5-*.
> In some weeks but before flipping the defaults, I'll follow up showing
> ways of muting them, but we really need to be confident that this
> necessary and future-proofing change isn't silently destroying your work
> first. So please don't treat the many warnings as just pesky and nagging -
> they are priming your immune system to check for unwanted consequences of
> your legacy CRS representation choices.
>
> I'd also like to thank the maintainers of packages importing
> from/depending on sp/rgdal for largely positive responses to issues raised
> and emails sent, often less polite than they might have been, but grabbing
> attention was more important. From over 70 broken reverse dependency
> packages we are now well under 20, and I've contacted all of those, with
> only a couple not responding. Edzer has seen similar responsiveness for
> the parallel migration of sf.
>
> Enjoy!
>
> Roger
>
>

-- 
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