Compiling with Cython and Mingw Produces Gcc: Error: Unrecognized Command Line Option '-Mno-Cygwin'

Compiling with cython and mingw produces gcc: error: unrecognized command line option '-mno-cygwin'

It sounds like GCC 4.7.0 has finally removed the deprecated -mno-cygwin option, but distutils has not yet caught up with it. Either install a slightly older version of MinGW, or edit distutils\cygwinccompiler.py in your Python directory to remove all instances of -mno-cygwin.

Compiling pygraphviz: Unrecognized command line option '-mno-cygwin'

See this answer: https://stackoverflow.com/a/6035864/1516291

In short, you may need to modify distutils\cygwinccompiler.py in your python installation dir to remove traces of -mno-cygwin.

Can't compile Cython code - unrecognized command line option '-mno-cygwin'

Per the Windows installation instructions of Cython, the recommended compiler is free Visual C++ 2008 Express, which can be installed from the offline installation Visual Studio 2008 Express iso.

Alternatively Cython can use the MinGW and its gcc, although this is a reportedly more difficult route.

From the output included in your question, Cython is trying to use the MinGW installation included with the Strawberry Perl distribution.

My recommendation is to install Visual C++ 2008 Express, which from my experience works best for compiling Cython or other Python C extension modules.

how to remedy mno cygwin error?

The current cygwin gcc compiles only for cygwin itself.

-mno-cygwin is an obsolete flag from gcc 3.x time that allowed the cygwin compiler to compile mingw (not cygwin) programs.

The switch was removed long time ago and true cross compilers

mingw64-x86_64-gcc-core

mingw64-i686-gcc-core

cygwin-mingw

were made available

Latest update:

https://sourceware.org/ml/cygwin-announce/2016-11/msg00020.html

Windows - pip install with mingw - Fails - cc1.exe: error: unrecognized command line option '-mno-cygwin'

-mno-cygwin in Python\Lib\distutils\cygwinccompiler.py causes this problem: see Compiling with cython and mingw produces gcc: error: unrecognized command line option '-mno-cygwin' or http://korbinin.blogspot.com/2013/03/cython-mno-cygwin-problems.html.

My Python distribution (Anaconda)'s cygwinccompiler.py does not have that though. Anyway, after removing all -mno-cygwin in the definition of the Mingw32CCompiler class you should be able to compile.

Building QuantLib python bindings on windows 7: 'unrecognized command line option '-mno-cygwin''

The answer is that Python 2.6 distutils hasn't caught up with MinGW (source). I now get another error, but that's for another question.



Related Topics



Leave a reply



Submit