ggventurini / python-deltasigma

A port of the MATLAB Delta Sigma Toolbox based on free software and very little sleep
python-deltasigma.io
Other
86 stars 54 forks source link

simple test work fine under windows10 with opencblas. #71

Open buaabyl opened 5 years ago

buaabyl commented 5 years ago

I install mingw-w64 with gcc version 9.1.0 (Rev3, Built by MSYS2 project) and mingw-openblas.

Compile ok with this Makefile:

OPENBLAS    = openblas
PYTHON_INC  = C:\Python36\include
PYTHON_LIB  = C:\Python36\Libs
NUMPY_INC   = C:\Python36\Lib\site-packages\numpy\core\include

CFLAGS  = /nologo \
          /I $(PYTHON_INC) \
          /I $(NUMPY_INC) \
          /I $(OPENBLAS)/include 

LDFLAGS = /nologo \
          /libpath:$(PYTHON_LIB) \
          /libpath:$(OPENBLAS)

all:
    cython -3 _simulateDSM_cblas.pyx 
    cl $(CFLAGS) /c \
        _simulateDSM_cblas.c 
    link $(LDFLAGS) /DLL \
        /out:_simulateDSM_cblas.pyd \
        _simulateDSM_cblas.obj \
        python36.lib libopenblas.lib
    rm _simulateDSM_cblas.obj _simulateDSM_cblas.exp _simulateDSM_cblas.lib

libopenblas.lib generated from gendef.exe

And I found that _simulateDSM.py ignore cblas extend pyd under windows:

try:
    if 'nt' in os.name:
        # if somebody actually goes through the trouble of compiling
        # it on Windows, we'll make available a patch to re-enable it.
        # In most cases now, users only get error messages from BLAS
        # not being available.
        raise ImportError('CBLAS extension disabled on Windows')

When I put all together, the extension works.

My question is: How to make sure this is correct?