[GRASS-stats] Re: [GRASS-dev] g.gisenv: symbol lookup error: g.gisenv: undefined symbol: G__no_gisinit

William McCoy wdmccoy at geo.umass.edu
Sun Aug 29 12:12:07 EDT 2010


On 08/29/2010 11:51 AM, William McCoy wrote:
> On 08/29/2010 09:30 AM, Glynn Clements wrote:
>>
>> Markus Neteler wrote:
>>
>>> Does anyone have a pointer for this problem?
>>> http://lists.osgeo.org/pipermail/grass-stats/2010-August/001266.html
>>
>>> g.gisenv: symbol lookup error: g.gisenv: undefined symbol: G__no_gisinit
>>
>> The GRASS libraries are out of date with respect to the modules. The
>> libraries pre-date the version check, while the modules are more
>> recent.
>>
>> I note that $LD_LIBRARY_PATH is rather long, and
>> /usr/local/grass-6.4.0svn/lib is right at the end of it:
>>
>> If GRASS libraries exist in any other directory in $LD_LIBRARY_PATH
>> (or in /etc/ld.so.conf), they will be used in preference.
>>
>> Also, it's possible that a different version of libgis is being pulled
>> in via e.g. GDAL.
>>
>
> I mentioned in my initial post to r-sig-geo, that I do have a grass63
> installation on the same computer and that installation is from a Fedora
> repository and comes as an rpm. I may have neglected to include that
> information when I moved this thread to grass-stats. I likewise have two
> installations of gdal (because the Fedora repository one is so old).
>
> I had put /user/local/bin early in my PATH to try to avoid using the
> older rpm versions, but I see now that, of course, the libraries from
> the grass63 installation are probably being called first in this
> instance. My user LD_LIBRARY_PATH env variable is empty and the library
> path comes from ld.so.conf.
>
> When initGRASS() gets the library path with Sys.getenv(), I'm not sure
> how it comes up with the list of libraries that it does, but the
> grass64svn library is not among them. initGRASS() appends the grass64svn
> library to the end of the existing library path and sets it using
> Sys.setenv().
>
> I can try changing initGRASS to prepend the grass54svn library and see
> if that works. But I am also wondering how I could change the order of
> libraries in my library path from ld.so.conf.
>
> I will try changing initGRASS() and report the results here.
>
>
> Thanks for your help,
> Bill
>

Ok, I have modified initGRASS() and named it myinitGRASS().  I have just 
changed a couple of lines to prepend the grass64svn directories, rather 
than append them, to PATH and LD_LIBRARY_PATH.  These appears to work 
fine, but I don't know what other ramifications it might have:


 > library(spgrass6)
Loading required package: sp
Loading required package: rgdal
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.7.2, released 2010/04/23
Path to GDAL shared files: /usr/local/share/gdal
Loaded PROJ.4 runtime: Rel. 4.7.1, 23 September 2009
Path to PROJ.4 shared files: (autodetected)
Loading required package: XML
GRASS GIS interface loaded with GRASS version: (GRASS not running)
 > dump("initGRASS", file = "myinitGRASS.R")
 > source("myinitGRASS.R")
 > loc <- myinitGRASS(gisBase = "/usr/local/grass-6.4.0svn", home = 
tempdir())
 > loc
gisdbase    /tmp/RtmpuIbthk
location    file147a6845
mapset      file5b1a448
rows        1
columns     1
north       1
south       0
west        0
east        1
nsres       1
ewres       1
projection  NA


The new lines I have are:

[wdmccoy at boreas rgrass]$ diff myinitGRASS.R~ myinitGRASS.R
1c1
< initGRASS <-
---
 > myinitGRASS <-
69c69
<             Sys.setenv(PATH = paste(Sys.getenv("PATH"), ":",
---
 >             Sys.setenv(PATH = paste(
71c71
<                 "/scripts", sep = ""))
---
 >                 "/scripts:", Sys.getenv("PATH"), sep = ""))
76,77c76,77
<             Sys.setenv(LD_LIBRARY_PATH = 
paste(Sys.getenv("LD_LIBRARY_PATH"),
<                 ":", Sys.getenv("GISBASE"), "/lib", sep = ""))
---
 >             Sys.setenv(LD_LIBRARY_PATH = paste(Sys.getenv("GISBASE"),
 >                 "/lib:", Sys.getenv("LD_LIBRARY_PATH"), sep = ""))


Thanks everyone for your help,
Bill


-- 
William D. McCoy
Geosciences
University of Massachusetts
Amherst, MA 01003


More information about the grass-stats mailing list