Skip to content

installing rgdal on linux without root access

2 messages · gregor.hochschild at gmx.de, Paul Hiemstra

#
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)...

--
#
On 02/27/2012 11:32 AM, gregor.hochschild at gmx.de wrote:
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