[Numpy-discussion] numpy.distutils, windows dll vs lib

Robert Kern robert.kern@gmail....
Fri Mar 16 00:25:32 CDT 2007


David Cournapeau wrote:

> I don't use the library for linking: I only need to be able to load it 
> dynamically through ctypes. What I did is simply overriding the 
> calc_info method, in which I try to detect both library and header 
> files. For the library, I do the following:
> 
> # Look for the shared library
> sndfile_libs    = self.get_libs('sndfile_libs', self.libname)
> lib_dirs        = self.get_lib_dirs()
> for i in lib_dirs:
>     tmp = self.check_libs(i, sndfile_libs)
>     if tmp is not None:
>         info    = tmp
>         break
>     else:
>         return
> 
> When I look at the system_info.check_libs code, it looks like it is 
> trying to look for any extension, and the first found is returned... But 
> this is not what I get, and I am not sure to see what I am doing wrong.

Well, since the first line of that method is this:

  exts = self.library_extensions()

I conclude that if you were to override that method to return only ['.dll'],
then your code will work.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


More information about the Numpy-discussion mailing list