[R-sig-Geo] Problem with Proj when loading 'rgdal' on Super Computer Facility

Roger Bivand Roger.Bivand at nhh.no
Mon Jun 19 20:16:33 CEST 2017


On Mon, 19 Jun 2017, Shaun Walbridge wrote:

> Try passing the configure arguments to the command directly to rproj:
>
> install.packages('rgdal', configure.args = 
> '--with-proj-include=/correct/proj4/include 
> --with-proj-lib=/correct/proj4/lib 
> --with-proj-share=/correct/proj4/share')

Thanks, Shaun! My reply when approached off-list initially, was:

"Did you consider reading the help file of install.packages? Did you 
consider unpacking the source tarball of rgdal and running ./configure 
--help and reading the README file, also at:

https://r-forge.r-project.org/scm/viewvc.php/pkg/inst/README?view=markup&roo
t=rgdal

or

library(rgdal)
file.show(system.file("README", package="rgdal"))

which details configure arguments, which tell the install system where to
find external dependencies.

You also typically need each core to have access to the same external
dependencies, so you may wish to build GDAL, etc. static, so that the
rgdal.so in the package that you build from source is self-contained, that
is your choice."

Installing on clusters can be a problem, so choosing the static route is 
actually more predictable, but is quite a lot of work the first time 
round. The build scripts for the Windows sf and rgdal binary package 
external dependencies at for example:

https://github.com/rwinlib/gdal2/blob/master/build64.sh

give a flavour - you will probably only need a subset of drivers. If you 
build such a static binary package, it will protect you from missing 
dependencies on the nodes, at the cost of few drivers and a big shared 
object. If the nodes are the homogeneous, this route should be robust. 
Does anyone have recent experience of a static install under Linux (build 
GDAL and its dependencies, and PROJ4, static only)?

Roger


>
> On 6/19/17, 10:33 AM, "R-sig-Geo on behalf of Ryan Runquist" <r-sig-geo-bounces at r-project.org on behalf of rdbrunquist at gmail.com> wrote:
>
>    Hello,
>
>    I am working on manipulating some spatial data and performing SDMs on
>    invasive species. I have been using R and the package 'rgdal' to do some of
>    these analyses.
>
>    On my own computer, Mac OSX 10.12.2 running R 3.3.3, I have had not
>    problems installing 'rgdal', loading the library, and using the functions.
>
>    However, we are starting to work on the UMN MSI facility and we are having
>    problems installing 'rgdal' on their Linux supercomputing cluster.
>
>    In order to install this package, we have to load the GDAL library and the
>    PROJ4 library in Linux. We have not had any problems loading their GDAL
>    module and accessing the libraries. They work fine for 'rgeos'. However, we
>    are having problems with the PROJ module.
>
>    When we run 'install.packages('rgdal')', the installation process begins,
>    but it stalls when it checks for "'pj_init_plus' in -lproj", and then
>    fails.
>
>    We have been working with someone at MSI to remedy this problem. They are
>    able to see that the file does in fact exist and don't know why 'rgdal' is
>    having problems locating it.
>
>    So far, we have tried different versions of PROJ (Proj 4.4.9, Proj 4.9.2,
>    Proj 4.9.3_gcc4.8.2 - meaning it was compiled with gcc 4.8.2) and they have
>    complied PROJ with GCC 4.8.2 instead of their default complier. They also
>    tried to compile it with  GCC 6.3, but that failed with a complier error.
>
>    I have copied the full error message below.
>
>    Sincerely,
>
>    Ryan
>
>
>
>    > install.packages("rgdal")
>    Installing package into ‘/panfs/roc/groups/7/moeller/rbriscoe/R/x86_64-pc-
>    linux-gnu-library/3.3’
>    (as ‘lib’ is unspecified)
>    --- Please select a CRAN mirror for use in this session ---
>    trying URL 'https://urldefense.proofpoint.com/v2/url?u=https-3A__mirror.las.iastate.edu_CRAN_src_contrib_rgdal-5F1&d=DwIGaQ&c=n6-cguzQvX_tUIrZOS_4Og&r=YFaRLkcUCdDkLrpTbNOUV9J1CwYBCTMwgm5tdQkRSm4&m=SJ8UGKdbyg0VNXfUCOOVJNKZJSQbEZ1KRCyHR_oEtC8&s=sqbCt8BPZes79H33y7aSpNnE5tALDJOhMfpOybZ4e7c&e= .
>    2-7.tar.gz'
>    Content type 'application/x-gzip' length 1653897 bytes (1.6 MB)
>    ==================================================
>    downloaded 1.6 MB
>
>    * installing *source* package ‘rgdal’ ...
>    ** package ‘rgdal’ successfully unpacked and MD5 sums checked
>    configure: CC: /panfs/roc/msisoft/gcc/6.1.0/bin/gcc
>    configure: CXX: /panfs/roc/msisoft/gcc/6.1.0/bin/g++
>    configure: rgdal: 1.2-7
>    checking for /usr/bin/svnversion... yes
>    configure: svn revision: 660
>    checking for gdal-config... /panfs/roc/msisoft/gdal/2.0.1/bin/gdal-config
>    checking gdal-config usability... yes
>    configure: GDAL: 2.0.1
>    checking GDAL version >= 1.6.3... yes
>    checking for gcc... /panfs/roc/msisoft/gcc/6.1.0/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 /panfs/roc/msisoft/gcc/6.1.0/bin/gcc accepts -g... yes
>    checking for /panfs/roc/msisoft/gcc/6.1.0/bin/gcc option to accept ISO
>    C89... none needed
>    checking how to run the C preprocessor... /panfs/roc/msisoft/gcc/6.1.0/b
>    in/gcc
>    -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 gdal.h usability... yes
>    checking gdal.h presence... yes
>    checking for gdal.h... yes
>    checking gdal: linking with --libs only... yes
>    checking GDAL: /soft/gdal/2.0.1/share/gdal/pcs.csv readable... yes
>    checking proj_api.h usability... yes
>    checking proj_api.h presence... yes
>    checking for proj_api.h... yes
>    checking for pj_init_plus in -lproj... no
>    configure: error: libproj not found in standard or given locations.
>    ERROR: configuration failed for package ‘rgdal’
>    * removing ‘/panfs/roc/groups/7/moeller/rbriscoe/R/x86_64-pc-
>    linux-gnu-library/3.3/rgdal’
>
>    The downloaded source packages are in
>    ‘/tmp/RtmpBVhI5E/downloaded_packages’
>    Warning message:
>    In install.packages("rgdal") :
>      installation of package ‘rgdal’ had non-zero exit status
>
>    	[[alternative HTML version deleted]]
>
>    _______________________________________________
>    R-sig-Geo mailing list
>    R-sig-Geo at r-project.org
>    https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dsig-2Dgeo&d=DwIGaQ&c=n6-cguzQvX_tUIrZOS_4Og&r=YFaRLkcUCdDkLrpTbNOUV9J1CwYBCTMwgm5tdQkRSm4&m=SJ8UGKdbyg0VNXfUCOOVJNKZJSQbEZ1KRCyHR_oEtC8&s=K2N5LvwRn4RSLJNVBjbxQyBFejL-jaD1fky4cOX6WwU&e=
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
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 at nhh.no
Editor-in-Chief of The R Journal, https://journal.r-project.org/index.html
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en


More information about the R-sig-Geo mailing list