[R-sig-Geo] installing rgdal on linux without root access

Paul Hiemstra paul.hiemstra at knmi.nl
Mon Feb 27 13:35:08 CET 2012


On 02/27/2012 11:32 AM, gregor.hochschild at gmx.de wrote:
> Hi, I am trying to install rgdal on a server without root access. I managed to compile proj.4 and gdal from source placing them in ~/libs using DESTDIR in make install. I am unable, however, to install rgdal using this command:
>
> R CMD INSTALL --configure-args='
> --with-gdal-config=~/libs/gdal/usr/local/bin/gdal-config 
> --with-proj-include=~/libs/proj4/usr/local/include 
> --with-proj-lib=~/libs/proj4/usr/local/lib' 
> rgdal_0.7-8.tar.gz -l ~/R-libs
>
> (Note: I am actually using the hard coded location and not ~, added the spaces for readability, and tried with and without -l ~/R-libs)
>
> I am getting a long list of errors (see part of the output below). Any suggestions?
>
>
> Thanks! 
>
>
>
>
> ...
> checking for proj_api.h... yes
> checking for pj_init_plus in -lproj... yes
> /usr/bin/ld: cannot find -lgdal
> collect2: ld returned 1 exit status
> ./configure: line 3366: ./proj_conf_test: No such file or directory
> PROJ.4 Version 4.7 or earlier
> /usr/bin/ld: cannot find -lgdal
> collect2: ld returned 1 exit status
> ./configure: line 3409: ./proj_conf_test: No such file or directory
> /usr/bin/ld: cannot find -lgdal
> collect2: ld returned 1 exit status
> ....
> OGR_write.cpp:26: error: ‘OGRSFDriver’ was not declared in this scope
> ... (long list of these scope errors)...
>
> --
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Hi Gregor,

I never use DESTDIR, but the --prefix command of ./configure:

./configure --prefix=~/myownstuff/

This creates a bin, lib, share etc directory under ~/myownstuff.  Then
you need to edit your LD_LIBRARY_PATH and PATH environment variables
accordingly. Add something along these lines:

export PATH=/home/username/myownstuff/bin/:$PATH
export LD_LIBRARY_PATH=/home/username/myownstuff/lib/:$LD_LIBRARY_PATH

to your .bashrc and restart a terminal. Now it should be possible to
install rgdal without manually specifying the location of the
executables and libraries, because they are in the search path.

cheers,
Paul


-- 
Paul Hiemstra, Ph.D.
Global Climate Division
Royal Netherlands Meteorological Institute (KNMI)
Wilhelminalaan 10 | 3732 GK | De Bilt | Kamer B 3.39
P.O. Box 201 | 3730 AE | De Bilt
tel: +31 30 2206 494

http://nl.linkedin.com/pub/paul-hiemstra/20/30b/770



More information about the R-sig-Geo mailing list