Distutils spawn on unix acting strange

Travis Oliphant oliphant at ee.byu.edu
Thu Mar 10 20:05:07 EST 2005


I have a normal looking setup.py file with a single extension module.  
When distutils runs (python setup.py build),  the module compiles fine, 
but an error is issued that seems to indicate that gcc is being called 
with a "blank" input file (and gives an error). 

It appears that the spawn process inside of distutils is generating two 
calls: one that succeeds in compiling the module (it takes a while to 
compile) and another that is giving an error. 

Here is a typical output:

unning install
running build
running build_py
creating build
creating build/lib.linux-i686-2.3
creating build/lib.linux-i686-2.3/ndarray
copying Lib/numeric.py -> build/lib.linux-i686-2.3/ndarray
copying Lib/numeric_version.py -> build/lib.linux-i686-2.3/ndarray
copying Lib/numerictypes.py -> build/lib.linux-i686-2.3/ndarray
copying Lib/array_printer.py -> build/lib.linux-i686-2.3/ndarray
copying Lib/__init__.py -> build/lib.linux-i686-2.3/ndarray
running build_ext
building 'ndarray/multiarray' extension
creating build/temp.linux-i686-2.3
creating build/temp.linux-i686-2.3/Src
cc -fno-strict-aliasing -DNDEBUG -O2 -fomit-frame-pointer -pipe 
-march=i586 -mtune=pe            ntiumpro -g -fPIC 
-DSIZEOF_LONG_DOUBLE=12 -IInclude -I/usr/include/python2.3 -c 
Src/m            ultiarraymodule.c -o 
build/temp.linux-i686-2.3/Src/multiarraymodule.o
cc: : No such file or directory
[snip]
error: command 'cc' failed with exit status 1

The error is apparently coming from cc (gcc) which states "no such file 
or directory", but there is no file given so apparently cc is being 
called with a "blank" file (not just no file, but a "blank" file). 

The trouble is, the module is actually compiling fine (I can run python 
setup.py install again and
it finds the recent build and goes forward).  I also don't get the 
mysterious errror when I just cut-and-paste the
compile line.

I am very confused.  Has anyone seen this or anything like this before?  
Any help appreciated.

-Travis Oliphant




More information about the Python-list mailing list