[GRASS-dev] Calling GRASS from outside: cannot open shared object file

Vaclav Petras wenzeslaus at gmail.com
Fri May 9 06:31:23 PDT 2014


On Fri, May 9, 2014 at 9:12 AM, Markus Neteler <neteler at osgeo.org> wrote:

> On Fri, May 9, 2014 at 11:52 AM, Moritz Lennert
> <mlennert at club.worldonline.be> wrote:
> > On 09/05/14 10:59, Markus Neteler wrote:
> >>
> >> Hi,
> >>
> >> I get it running (on Linux, winGRASS untested) when setting up the
> >> LD_LIBRARY_PATH at system level:
> >>
> >> su
> >> echo "`grass71 --config path`/lib" > /etc/ld.so.conf.d/grass71.conf
> >> ldconfig
> >> exit
> >>
> >> # run as normal user:
> >> python python_test_ctypes.py
> >> ...
> >> precip_annual at user1
> >> /home/neteler/grassdata/nc_spm_08_grass7
> >>
> >> Works.
> >> The issue is that we cannot easily enforce the users to add a file in
> >> /etc/ld.so.conf.d/ since it requires admin rights.
> >>
> >> Suggestions?
> >
> >
> > Doesn't this work:
> >
> > export LD_LIBRARY_PATH= export LD_LIBRARY_PATH=$(grass71 --config
> path)/lib
> > python python_test_ctypes.py
>
> Yes this works:
>
> export LD_LIBRARY_PATH=$(grass71 --config path)/lib
> python python_test_ctypes.py
>
> also this:
> export LD_LIBRARY_PATH=`grass71 --config path`/lib
> python python_test_ctypes.py
>
> nice, I could have tried that earlier :)
>
> I'm not sure if this is something I want to do each time before starting
the script, especially when I'm setting all the paths inside the script
during imports and then I call `grass.script.setup.init` function.

Now we just need similar instructions for Windows and MacOSX.
>

Again, this is only a workaround. I don't think that we want to explain
working with shared/dynamic libraries on all platforms to all scripting
GRASS users.

I would like to know if it is possible to manage this inside `grass.lib` or
through `grass.script.setup.init`.

Vaclav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140509/b0886264/attachment.html>


More information about the grass-dev mailing list