On Wed, Sep 8, 2010 at 2:32 AM,  <[email protected]> wrote:
> Dear Shapely-Developers,
>
> First: thank you for Shapely!
> I have to install Shapely on a cluster (scientific linux), where i don't have 
> root privilegs. Python, as well as libgeos_c are installed (from source) 
> under $HOME/local/lib and $HOME/local/bin. The first is in $LD_LIBRARY_PATH 
> and the latter in $PATH. Unfortunatly ctypes.find_library seems to fail under 
> these circumstances. Can you fix geos.py to fall back to the any *nix 
> variant, for loading libgeos_c, if find_library does not find the library?
>
> A possible solution (working for me) could be changing line 28-32 in geos.py 
> to (inspired by your code line 83-92):
>
> if sys.platform == 'linux2':
>    lib = find_library('geos_c')
>    if lib is None:
>        try:
>            _lgeos = CDLL('libgeos_c.so.1')
>        except (OSError, ImportError):
>            _lgeos = CDLL('libgeos_c.so')
>        except:
>            raise
>    else:
>        _lgeos = CDLL(lib)
>    free = CDLL(find_library('c')).free
>    free.argtypes = [c_void_p]
>    free.restype = None
>
>
> Thank you,
>
> Philipp

Hi Philipp,

You are very welcome! I'm glad you like it.

I won't rule out the change you suggested, but first I'd like to make
sure that we can't solve this by sorting your library path. I am
routinely testing and deploying Shapely using zc.buildout and
modifying LD_LIBRARY_PATH so that Shapely (in a virtualenv) can find a
specific, local libgeos_c.so (also built from source). Without any
root privileges or system-wide installs. Can you check that
$HOME/local/lib and $HOME/local/bin are at the head of LD_LIBRARY_PATH
and PATH?

Cheers,

--
Sean
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to