I have a very simple cython code which use prange, which works fine in linux. However, when I try to do it in Windows. I encountered a problem that it can be compiled but cannot be imported:
ImportError: DLL load failed: This application has failed to start because the a
pplication configuration is incorrect. Reinstalling the application may fix this
problem.
Moreover, in windows I cannot from cython.parallel import threadlocal?! strange...
Is there anyone can point a direction?
System works fine: linux64, compiler gcc, packages: Python 2.7, cython 0.16
system has problem: Win64, compiler: MSVC VS2008, packages: Python 2.7, cython 0.16
Here is my simple cython pyx:
cimport cython
from cython.parallel import prange
def f(int n):
cdef int i
cdef int sum = 0
for i in prange(n, nogil=True):
sum += i
print sum
Here is my setup.py:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy as np
setup(
cmdclass = {'build_ext': build_ext},
include_dirs = [np.get_include()],
ext_modules = [Extension("pcython1", ["pcython1.pyx"],extra_compile_args=['/openmp',],),]
)
/openmp, bothrangeandprangework. With it, neither of them works.MS visual studiobut only theVC++ redustributable, it works fine... Confused... And the CPU loads are completely different betweenrangeandprangeversion. So the openMP is working, just it cannot work on the system with the debug dlls installed, I guess.