I am trying to build a source using python
's distutils
. I have created a simple setup.py
following an example, and building it as suggested works fine:
python setup.py build
Now it is possible to build a source with a desired compiler; a list of compilers can be found as
python setup.py build_ext --inplace --help-compiler
List of available compilers:
--compiler=bcpp Borland C++ Compiler
--compiler=cygwin Cygwin port of GNU C Compiler for Win32
--compiler=emx EMX port of GNU C Compiler for OS/2
--compiler=mingw32 Mingw32 port of GNU C Compiler for Win32
--compiler=msvc Microsoft Visual C++
--compiler=unix standard UNIX-style compiler
However, if I try to use, for example, the mingw32
compiler as follows
python setup.py build --compiler=mingw32
I get the following error output:
building 'demo' extension
creating build
creating build/temp.linux-i686-2.7
gcc -mno-cygwin -mdll -O -Wall -DMAJOR_VERSION=1 -DMINOR_VERSION=0 -I/usr/local/include -I/usr/include/python2.7 -c demo.c -o build/temp.linux-i686-2.7/demo.o
cc1: error: unrecognized command line option ‘-mno-cygwin’
cc1: error: unrecognized command line option ‘-mdll’
error: command 'gcc' failed with exit status 1
What is the cause for this problem? Am I doing something wrong? Do I need to specify something else? Am I using wrong versions (Ubuntu 12.04, python 2.7.3, Distutils 1.0a4)?Do I need to 'remove' the offending options?