[Insight-developers] dl.RTLD_NOW|dl.RTLD_GLOBAL mess

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Apr 16 07:02:02 EDT 2008


On Wed, Apr 16, 2008 at 12:36 PM, Gaëtan Lehmann
<gaetan.lehmann at jouy.inra.fr> wrote:
>
>  Le 16 avr. 08 à 12:27, Mathieu Malaterre a écrit :
>
>
>
> > Hi there,
> >
> >  I was having some issue loading the 'dl' module on debian/etch
> > AMD64. Apparently it is not shipped anymore. Since I only need two
> > values (dl.RTLD_NOW and dl.RTLD_GLOBAL), I came up with an alternate
> > solution as explained on:
> >
> > http://docs.python.org/lib/module-sys.html
> >
> >  Simply do:
> >
> >
> >  try:
> >   import dl
> >  except ImportError:
> >   # try the DLFCN instead ?
> >   try:
> >     import DLFCN as dl
> >
> > As far as I understand DLFCN can be found on more system than dl.
> > Could someone please confirm on let say Darwin system ?
> >
>
>  on mac os 10.5:
>
>  2> import DLFCN as dl
>  ---------------------------------------------------------------------------
>  ImportError                               Traceback (most recent call last)
>
>  /Users/glehmann/src/contrib-itk/<ipython console> in <module>()
>
>  ImportError: No module named DLFCN
>
>
>  Do you really need to change anything in WrapITK to make it run on linux 64
> bits?
>  I made some tests quite a long time ago, and it was working perfectly, and
> I ran this morning a segmentation procedure with ITK which has used 5.4 GB
> of ram and about 15 different filters on a RHEL 4 64 bits without any
> problem.

I did not like the fact that dl.RTLD_NOW & dl.RTLD_GLOBAL were
hardcoded. So python is seriously broken because

help(sys.setdlopenflags)

talks about setting:

  sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)

but -apparently- there is nothing that comes close to providing those
values at least on Darwin, right ?

-- 
Mathieu


More information about the Insight-developers mailing list