Albert Strasheim wrote:
> Hello all
>
>   
>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:numpy-
>> [EMAIL PROTECTED] On Behalf Of David Cournapeau
>> Sent: 18 August 2006 06:55
>> To: Discussion of Numerical Python
>> Subject: [Numpy-discussion] ctypes: how does load_library work ?
>>
>> <snip>
>> That works OK, but to avoid the platform dependency, I would like to use
>> load_library from numpy: I just replace the cdll.LoadLibrary by :
>>
>> _hello = N.ctypeslib.load_library('hello', '.')
>>
>> which does not work. The python interpreter returns a strange error
>> message, because it says hello.so.so is not found, and it is looking for
>> the library in the directory usr/$(PWD), which does not make sense to
>> me. Is it a bug, or am I just not understanding how to use the
>> load_library function ?
>>     
>
> load_library currently assumes that library names don't have a prefix. We
> might want to rethink this assumption on Linux and other Unixes.
>   
I think it needs to be modified for linux and Solaris at least, where 
the prefix lib is put in the library name. When linking, you use -lm, 
and not -llibm. In dlopen, you use the full name (libm.so).

After a quick look at ctypes reference doc, it looks like there are some 
function to search a library, maybe this can be used ?

Anyway, this is kind of nickpicking, as ctypes is really a breeze to 
use. To be able to do the whole wrapping in pure python is great, thanks !

David

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to