On 8/9/06, Albert Strasheim <[EMAIL PROTECTED]> wrote:
Next caveat: on Windows, shared libraries aka DLLs, typically have a .dll
extension. However, Python extensions have a .pyd extension.

We have a utility function in NumPy called ctypes_load_library which handles
finding and loading of shared libraries with ctypes. Currently, shared
library extensions (.dll, .so, .dylib) are hardcoded in this function.

I propose we modify this function to look something like this:

def ctypes_load_library(libname, loader_path, distutils_hack=False):
    ...

If distutils_hack is True, instead of the default mechanism (which is
currently hardcoded extensions), ctypes_load_library should do:

import distutils.config
so_ext = distutils.sysconfig.get_config_var('SO')

to figure out the extension it should use to load shared libraries. This
should make it reasonably easy for people to build shared libraries with
distutils and use them with NumPy and ctypes.

Wouldn't it make more sense to just rename the .pyd generated by distutils to .dll or .so?  Especially since the .pyd generated by distutils won't actually be a python extension module.   This renaming could be automated by a simple python script that wraps distutils.  The addition of the init{modulename} function could also be done by that script.

--bb

-------------------------------------------------------------------------
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