[R-sig-Geo] trouble installing rgdal: SOLVED
Roger Bivand
Roger.Bivand at nhh.no
Wed May 2 14:42:55 CEST 2012
On Tue, 1 May 2012, Freddy Gamma wrote:
> Hi, is still me Federico.
> No one has replied to my question (trouble in installing rgdal) yet, but I
> wished to notice I have found the trick.
Not a trick. Before, you had multiple installed versions of PROJ.4, and
this was causing the observed mismatch. Always ensure that you order
external dependencies in an unambiguous manner.
Roger
>
> the error message:
>
> [...]
>
> Error in dyn.load(file, DLLpath = DLLpath, ...) :
> unable to load shared object
> '/home/me/R/i686-pc-linux-gnu-library/2.13/rgdal/libs/rgdal.so':
> /home/me/R/i686-pc-linux-gnu-library/2.13/rgdal/libs/rgdal.so: undefined
> symbol: pj_get_default_ctx
> Error: loading failed
> Execution halted
> ERROR: loading failed
> * removing ?/home/me/R/i686-pc-linux-gnu-library/2.13/rgdal?
>
> ...I'm not a geek but as far as I understood the message meant that a link
> between rgdal and proj4 was not in place and no proper sharing was
> happening between them (as a result there was an unrecognized symbol).
>
> I managed to solve that using "ldconfig" after removing all proj4-related
> fiiles and reinstalling (with ./configure, no prefix).
>
> tar -zxf /home/me/Downloads/proj-4.8.0.tar.gz
>
> cd proj-4.8.0
>
> ./configure
>
> make
> sudo make install
> sudo ldconfig
> cd ..
>
> that did the trick...I'm very happy at the moment,...hope all will run
> smoothly afterward too.
> hope this post helps
>
> ciao
>
> Federico
>
>
> 2012/4/30 Freddy Gamma <freddy.gamma at gmail.com>
>
>> Dear sig-geoers,
>> as an R-user I'd first like to thank you for all the effrot you put into
>> the R-project.
>> I hope what following will not cause you too much time expenditure and
>> I'll be very grateful you could give an advise as I made quite an effort to
>> sort it out by myself with no success.
>>
>> I start with the preliminaries:
>>
>> INSTALLED SOFTWARE:
>>
>>
>> OS: LINUX UBUNTU 10.11 Oneiric Ocelot
>> R 2.13.1
>> GRASS GIS 6.41 binary (installed via sudo apt-get install grass)
>> GDAL 1.9 (installed form official source, tar.gz, configuration option=
>> "--without grass", I have all files stored in a prefixed folder,
>> /usr/local/myfold, and in standard folders - /usr/local- as I noted there
>> were difficulties in finding libgdal.so.1 from prefixed folder )
>> PROJ 4.8 ( installed from official source, tar.gz, all files installed in
>> prefixed folder /usr/local/myfold, proj_api.h and projlib pointed out via
>> configuration.arg statements). # update I have also moved everithing in
>> standard folders. usr/local/ ..
>>
>> ISSUE:
>>
>> following some threads on the R-help list I finally came to run the
>> following:
>>
>> R CMD INSTALL
>> --configure-args="--with-proj-include=/usr/local/proj4/include
>> --with-proj-lib=/usr/local/proj4/lib" rgdal_0.7-8.tar.gz
>> NOTE: having just moved all the proj4 directories in standard folders
>> (/usr/local) I could run the same command with no conf.args. I obtaiined
>> nevertheless the same error message listed below!
>>
>> and received the following error (only an extract here, I'll paste the
>> full message at the bottom page):
>>
>> [...]
>>
>> Error in dyn.load(file, DLLpath = DLLpath, ...) :
>> unable to load shared object
>> '/home/me/R/i686-pc-linux-gnu-library/2.13/rgdal/libs/rgdal.so':
>> /home/me/R/i686-pc-linux-gnu-library/2.13/rgdal/libs/rgdal.so: *undefined
>> symbol*: *pj_get_default_ctx
>> *Error: loading failed
>> Execution halted
>> ERROR: loading failed
>> * removing ?/home/me/R/i686-pc-linux-gnu-library/2.13/rgdal?
>>
>> ###
>>
>> As you can note seems that pj_get_default_ctx is not recognized (as far as
>> I'm inferring, i'm not a programmer).
>> I have made a research and understood that pj_get_default_ctx is a
>> something living into the proj_api.h file, into the "include" folder of the
>> installed PROJ4 (/usr/local/myfold, here).
>>
>>
>> Here is all, I hope I have furnished exhaustive informations to ease the
>> investigative task.
>>
>> I'd like to thank you in advance
>>
>> best regards
>>
>>
>> Federico Bonofiglio
>> contract researcher
>>
>>
>> ## full install message
>>
>> * installing to library ?/home/me/R/i686-pc-linux-gnu-library/2.13?
>> * installing *source* package ?rgdal? ...
>> gdal-config: gdal-config
>> checking for gcc... 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 gcc accepts -g... yes
>> checking for gcc option to accept ISO C89... none needed
>> checking how to run the C preprocessor... 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 proj_api.h usability... yes
>> checking proj_api.h presence... yes
>> checking for proj_api.h... yes
>> checking for pj_init_plus in -lproj... yes
>> PROJ.4 Version 4.8 or later
>> *./proj_conf_test: symbol lookup error: ./proj_conf_test: undefined
>> symbol: pj_get_default_ctx
>> ./proj_conf_test: symbol lookup error: ./proj_conf_test: undefined symbol:
>> pj_get_default_ctx
>> *Package CPP flags: -DP4CTX=1 -I/usr/local/proj4/include
>> -I/usr/local/gdal/include
>> Package LIBS: -L/usr/local/proj4/lib -L/usr/local/gdal/lib -lgdal
>> configure: creating ./config.status
>> config.status: creating src/Makevars
>> ** libs
>> g++ -I/usr/share/R/include -DP4CTX=1 -I/usr/local/proj4/include
>> -I/usr/local/gdal/include
>> -I"/home/me/R/i686-pc-linux-gnu-library/2.13/sp/include" -fpic -O3
>> -pipe -g -c OGR_write.cpp -o OGR_write.o
>> g++ -I/usr/share/R/include -DP4CTX=1 -I/usr/local/proj4/include
>> -I/usr/local/gdal/include
>> -I"/home/me/R/i686-pc-linux-gnu-library/2.13/sp/include" -fpic -O3
>> -pipe -g -c gdal-bindings.cpp -o gdal-bindings.o
>> gcc -I/usr/share/R/include -DP4CTX=1 -I/usr/local/proj4/include
>> -I/usr/local/gdal/include
>> -I"/home/me/R/i686-pc-linux-gnu-library/2.13/sp/include" -fpic
>> -std=gnu99 -O3 -pipe -g -c local_stubs.c -o local_stubs.o
>> g++ -I/usr/share/R/include -DP4CTX=1 -I/usr/local/proj4/include
>> -I/usr/local/gdal/include
>> -I"/home/me/R/i686-pc-linux-gnu-library/2.13/sp/include" -fpic -O3
>> -pipe -g -c ogr_geom.cpp -o ogr_geom.o
>> gcc -I/usr/share/R/include -DP4CTX=1 -I/usr/local/proj4/include
>> -I/usr/local/gdal/include
>> -I"/home/me/R/i686-pc-linux-gnu-library/2.13/sp/include" -fpic
>> -std=gnu99 -O3 -pipe -g -c ogr_polygons.c -o ogr_polygons.o
>> g++ -I/usr/share/R/include -DP4CTX=1 -I/usr/local/proj4/include
>> -I/usr/local/gdal/include
>> -I"/home/me/R/i686-pc-linux-gnu-library/2.13/sp/include" -fpic -O3
>> -pipe -g -c ogr_proj.cpp -o ogr_proj.o
>> g++ -I/usr/share/R/include -DP4CTX=1 -I/usr/local/proj4/include
>> -I/usr/local/gdal/include
>> -I"/home/me/R/i686-pc-linux-gnu-library/2.13/sp/include" -fpic -O3
>> -pipe -g -c ogrdrivers.cpp -o ogrdrivers.o
>> g++ -I/usr/share/R/include -DP4CTX=1 -I/usr/local/proj4/include
>> -I/usr/local/gdal/include
>> -I"/home/me/R/i686-pc-linux-gnu-library/2.13/sp/include" -fpic -O3
>> -pipe -g -c ogrsource.cpp -o ogrsource.o
>> g++ -I/usr/share/R/include -DP4CTX=1 -I/usr/local/proj4/include
>> -I/usr/local/gdal/include
>> -I"/home/me/R/i686-pc-linux-gnu-library/2.13/sp/include" -fpic -O3
>> -pipe -g -c projectit.cpp -o projectit.o
>> g++ -shared -o rgdal.so OGR_write.o gdal-bindings.o local_stubs.o
>> ogr_geom.o ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o projectit.o
>> -L/usr/local/proj4/lib -L/usr/local/gdal/lib -lgdal -lproj -L/usr/lib/R/lib
>> -lR
>> installing to /home/me/R/i686-pc-linux-gnu-library/2.13/rgdal/libs
>> ** R
>> ** inst
>> ** preparing package for lazy loading
>> ** help
>> *** installing help indices
>> ** building package indices ...
>> ** testing if installed package can be loaded
>> Error in dyn.load(file, DLLpath = DLLpath, ...) :
>> unable to load shared object
>> '/home/me/R/i686-pc-linux-gnu-library/2.13/rgdal/libs/rgdal.so':
>> /home/me/R/i686-pc-linux-gnu-library/2.13/rgdal/libs/rgdal.so: *undefined
>> symbol: pj_get_default_ctx
>> *Error: loading failed
>> Execution halted
>> ERROR: loading failed
>> * removing ?/home/me/R/i686-pc-linux-gnu-library/2.13/rgdal?
>>
>
> [[alternative HTML version deleted]]
>
>
--
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo
mailing list