Hi,
I've read almost every post related to problems with cython and openmp but couldn't come up with the solution to my problem.
My current setup:
OS: Windows 8.1 64 bit
Python version: Anaconda Python 2.7.6 64 bit
GCC version: 4.9.2 (was manually upgraded, see below)
Compiling .pyx files works fine if not used with openmp.
The problem is: I'm trying to compile simple cython module that uses prange from cython.parallel. The setup.py file contents are:
cymodule = 'cython_openmp'
extensions = [
Extension(cymodule, [cymodule + '.pyx'],
include_dirs=[numpy.get_include()],
extra_compile_args=["-fopenmp"],
extra_link_args=["-fopenmp"])
]
setup(
ext_modules = cythonize(extensions)
)
The default anaconda environment won't let me to compile this as it's shipped with no-openmp version of MinGW. In order to get openmp support I followed these steps:
2. Unzipped the archive and replaced original Anaconda/MinGW folder with the archive's contents (this gives me 4.9.2 version of GCC instead of original 4.7.0)
No matter what, running python setup.py build_ext always gives me following errors:
\Anaconda\Scripts\gcc.bat -DMS_WIN64 -shared -s build\temp.win-amd64-2.7\Release\cython_openmp.o build\te
mp.win-amd64-2.7\Release\cython_openmp.def -L\Anaconda\libs -L\Anaconda\PCbuild\amd64 -lpy
thon27 -lmsvcr90 -o build\lib.win-amd64-2.7\cython_openmp.pyd -fopenmp
/Anaconda/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/lib/../lib/dllcrt2
.o:crtdll.c:(.text+0xb): undefined reference to `malloc'
======/ same dllcrt2 path /======
.o:crtdll.c:(.text+0xbd): undefined reference to `_amsg_exit'
======/ same dllcrt2 path /======
.o:crtdll.c:(.text+0x1d3): undefined reference to `free'
======/ same dllcrt2 path /======
.o:crtdll.c:(.text+0x249): undefined reference to `_initterm'
======/ same dllcrt2 path /======
.o:crtdll.c:(.text+0x258): undefined reference to `_amsg_exit'
======/ same dllcrt2 path /======
.o:crtdll.c:(.text+0x270): undefined reference to `_initterm'
/Anaconda/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/bin/ld.exe:
/Anaconda/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/lib/../lib/dllcrt2.o:
bad reloc address 0x0 in section `.pdata'
collect2.exe: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
I couldn't find anything similar to this on the internet and feel lost here. Any help on this is more than appreciated.
Thanks!
Evgeny