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
What Determines Which Strings Are Interned and When
When Are Objects Garbage Collected in Python
Tkinter Vanishing Photoimage Issue
Differencebetween .Quit and .Quit in Pygame
How Does This Input Work with the Python 'Any' Function
How to Get Most Informative Features for Scikit-Learn Classifiers
Matplotlib Legend Markers Only Once
Pandas Dataframe Concat VS Append
Super() Raises "Typeerror: Must Be Type, Not Classobj" for New-Style Class
How to Add a Custom Ca Root Certificate to the Ca Store Used by Pip in Windows
Best Way to Format Integer as String with Leading Zeros
Processing Single File from Multiple Processes