[R-sig-Geo] Linking problem with rgdal

Rainer M Krug Rainer at krugs.de
Tue Feb 4 15:32:52 CET 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 02/04/14, 15:15 , Mark Payne wrote:
> Hi Rainer,
> 
> Thanks for the reply - your memory clearly serves you well,
> although I had to add both proj.4 and gdal to the LD_LIBRARY_PATH
> to get it to work fully ie.
> 
> export
> LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/R/gdal/lib/:$HOME/R/proj4/lib
>
>  I clearly owe you a beer :-)

Great that it works.

When you are in Paris, just let me know...

> 
> I can add this to my .bashrc, so that it is loaded every time I
> login but is there any other "more permanent" solution?

What do you mean by "permanent"?

The advantage of the .bashrc is that it is user specific, i.e.
different users can have different settings and you don't need
administrator privileges. Check out

http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

for details on shared libraries.

I used the LD_LIBRARY_PATH approach all the time on a cluster as it is
easy and transparent (you see in your .bashrc what you are doing and
not in some other files and can even specify this in your submit
script of the jobs - that is what I did).

A (slightly) different approach would be to install all user installed
libraries into a folder ~/myProgs/lib and then simply add these to the
LD_LIBRARY_PATH. Then you have to specify this when compiling gdal and
proj (if I remember correctly -prefix=$HOME/myProgs will do it). But
then you still have to add $HOME/myProgs/lib to LD_LIBRARY_PATH - but
then only that one.

Cheers,

Rainer

> 
> Best wishes,
> 
> Mark
> 
> 
> On 4 February 2014 14:22, Rainer M Krug <Rainer at krugs.de> wrote: On
> 02/04/14, 13:23 , Mark Payne wrote:
>>>> Hi,
>>>> 
>>>> I'm trying to install rgdal on a Scientific LInux cluster
>>>> which I do not have administrator rights. So far, I have done
>>>> the following * Downloaded and installed gdal from source
>>>> into my home directory ie configured with ./configure
>>>> --prefix=$HOME/R/gdal *Downloaded and install proj4 from
>>>> source with a similar configuration ./configure
>>>> --prefix=$HOME/R/proj4/
>>>> 
>>>> Next, I try to install the rgdal package specifying the
>>>> various locations
>>>> 
>>>> R CMD INSTALL rgdal_0.8-14.tar.gz 
>>>> --configure-args='--with-proj-lib=$HOME/R/proj4/lib 
>>>> --with-proj-include=$HOME/R/proj4/include 
>>>> --with-gdal-config=$HOME/R/gdal/bin/gdal-config' --preclean 
>>>> --no-clean-on-error
>>>> 
>>>> This generally works up to the point where it tries to do a
>>>> test load, giving the message: .... ** testing if installed
>>>> package can be loaded Error in dyn.load(file, DLLpath =
>>>> DLLpath, ...) : unable to load shared object 
>>>> '/zhome/39/c/38865/R/x86_64-unknown-linux-gnu-library/3.0/rgdal/libs/rgdal.so':
>>>>
>>>>
>
>>>> 
libgdal.so.1: cannot open shared object file: No such file or directory
>>>> Error: loading failed Execution halted ERROR: loading failed
>>>> 
>>>> If I check the contents of the shared object: ldd 
>>>> ~/R/x86_64-unknown-linux-gnu-library/3.0/rgdal/libs/rgdal.so 
>>>> linux-vdso.so.1 =>  (0x00007fff74dff000) libgdal.so.1 => not
>>>> found libproj.so.0 => not found libR.so => not found
>>>> libstdc++.so.6 => /usr/lib64/libstdc++.so.6
>>>> (0x00007f59fe330000) libm.so.6 => /lib64/libm.so.6
>>>> (0x00007f59fe0ab000) libgcc_s.so.1 => /lib64/libgcc_s.so.1
>>>> (0x00007f59fde95000) libc.so.6 => /lib64/libc.so.6
>>>> (0x00007f59fdb01000) /lib64/ld-linux-x86-64.so.2 
>>>> (0x00000039b3600000)
>>>> 
>>>> So for some reason although the build process is recognising
>>>> the libraries, it is not storing their location  in the
>>>> shared object.
> 
> I stand to be corrected, as I haven't done this for quite some
> time:
> 
> The paths you specify are for compile time, the ones missing are
> for run time. So you have to add the library path of gdal to your
> library paths, e.g. via setting the variable LD_LIBRARY_PATH
> 
> Hope this helps,
> 
> Rainer
> 
>>>> 
>>>> This is where my knowledge breaks down. I wonder if I need
>>>> to force the build to make static libraries, rather than
>>>> dynamically linked ones. But I'm not sure I know what I'm
>>>> talking about.
>>>> 
>>>> Any suggestions would be appreciated.
>>>> 
>>>> Mark
>>>> 
>>>> _______________________________________________ R-sig-Geo
>>>> mailing list R-sig-Geo at r-project.org 
>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>> 
> 

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS8PoUAAoJENvXNx4PUvmCN/YH/1dHnCXWeXiPJtXr0zO4czng
ptYstz/wsyDoRlUQsWRyum3BZ/edMDi3rlsS1+Z3Tp1QayS/o8s7Ri5pwee4dbqQ
7ezLpfz2pnmavhRJGPM6lxX+MbrJSgRxZpJ71x4GUVU5jjPE7mehR1mt7XhpCFOV
zj1/5Yp0fO3ilP6/fwDtn8x7fUwpi9iUHU7Dvq0pzq+tAr7WqLtG+39K8WqoyYBP
4vrf/iARFFHV93RPePvIljFH/7nS3GxvcLKnZU15QtqnECGaEBzq1Um0O7c7nTgB
lPIO0WDvkaD/lCExAVg/qyz4CblDZ+aMIhZi40evYn8gFcWzmH6AqV6KsRuLS5c=
=Z8Oe
-----END PGP SIGNATURE-----



More information about the R-sig-Geo mailing list