Bundling Python extensions that depend on C libraries

Marco Pesenti Gritti mpgritti at gmail.com
Sat Dec 8 06:07:11 EST 2007


On Dec 8, 2007 9:59 AM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> On Dec 8, 2007, at 1:15 , Asheesh Laroia wrote:
>
> > I'd like to bundle a Python C extension and use it from my
> > activity.  This
> > requires Python to dlopen() a shared library whose path can change
> > depending on where the activity is installed, but also whose path is
> > different than on my desktop where I built the .xo.
> >
> > Initially I tried to set os['LD_LIBRARY_PATH'] from within Python,
> > but I
> > learned this would not affect the running application
> > <http://hathawaymix.org/Weblog/2004-12-30>.
> >
> > In the Log Viewer, I read:
> >
> > <type 'exceptions.ImportError'>: liblicense.so.0: cannot open shared
> > object file: No such file or directory
> >
> > I tried changing my activity.info to read, in part (all on one line):
> >
> > exec = LD_LIBRARY_PATH=/home/olpc/Activities/License.activity/built/
> > lib
> > sugar-activity ccactivity.LicensingActivity -s
> >
> > but the error persisted.
> >
> > I know this is a sort of strange thing to do, but what's a
> > reasonable way
> > to do it?  Thanks, as always!
>
> Not strange at all. I argued before that Sugar should in fact set
> LD_LIBRARY_PATH before executing an activity:
>
> http://lists.laptop.org/pipermail/sugar/2007-November/003883.html

Makes a lot of sense to me. Please open a ticket if you haven't already...

Thanks,
Marco



More information about the Devel mailing list