[Numpy-discussion] npymath on Windows

Carl Kleffner cmkleffner at gmail.com
Fri Jan 2 07:36:39 EST 2015


Hi,

without further testing; this approach may help:

(1) create a shared library with all symbols from libnpymath.a:
$ gcc -shared -o libnpymath.dll -Wl,--whole-archive libnpymath.a
-Wl,--no-whole-archive  -lm

(2) create a def file:
gendef libnpymath.dll

There are now two files created by mings-w64 tools: libnpymath.dll,
libnpymath.def

(3) create import libs for MSVC: first open a new command Window with the
VC command prompt:
> lib /machine:i386 /def:libnpymath.def      (for 64bit use: /machine:X64)
Microsoft (R) Library Manager Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

   Creating library libnpymath.lib and object libnpymath.exp

libnpymath.dll, libnpymath.lib and libnpymath.exp should be sufficient for
MSVC. libnpymath.dll has to be deployed.

-- carlkl


2015-01-01 21:34 GMT+01:00 Sturla Molden <sturla.molden at gmail.com>:

> On 28/12/14 17:17, David Cournapeau wrote:
>
> > This is not really supported. You should avoid mixing compilers when
> > building C extensions using numpy C API. Either all mingw, or all MSVC.
>
> That is not really good enough. Even if we build binary wheels with
> MinGW (see link) the binary npymath library should be useable from MSVC.
>
> https://github.com/numpy/numpy/pull/5328
>
>
> Sturla
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150102/5ff6734d/attachment.html>


More information about the NumPy-Discussion mailing list