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

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Apr 16 10:11:09 EDT 2008


Le 16 avr. 08 à 13:02, Mathieu Malaterre a écrit :
> 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 ?
>

There is a module dl on mac now, but I think it wasn't there with  
python 2.4.

Gaëtan

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.mandriva.org
http://www.itk.org  http://www.clavier-dvorak.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20080416/ca9d61ea/attachment.pgp>


More information about the Insight-developers mailing list