distutils gcc unix

Michiel Jan Laurens de Hoon mdehoon at ims.u-tokyo.ac.jp
Sat Jul 27 13:33:38 EDT 2002


Sorry ... it seems that distutils ignores the CC environment variable 
(see below). This was done on cygwin. On Unix, the CC variable was also 
ignored using setenv CC gcc, and also with set CC=gcc. Here distutils 
defaulted to the standard cc compiler. I am guessing that it took the 
compiler name from the Makefile in /lib/python2.2/config.
Any ideas?
Thanks a lot for your help.

--Michiel.

$ export CC=bcc32
mdehoon at GINSENG ~/Software/Cluster
$ echo $CC
bcc32
mdehoon at GINSENG ~/Software/Cluster
$ bcc32
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
mdehoon at GINSENG ~/Software/Cluster
$ python setup.py build
running build
running build_py
creating build
creating build/lib.cygwin-1.3.12-i686-2.2
creating build/lib.cygwin-1.3.12-i686-2.2/Pycluster
copying Pycluster/__init__.py -> build/lib.cygwin-1.3.12-i686-2.2/Pycluster
running build_ext
building 'Pycluster.cluster' extension
creating build/temp.cygwin-1.3.12-i686-2.2
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DUSE_DL_IMPORT 
-Iranlib/src -I/usr/include/python2.2 -c cluster.c -o 
build/temp.cygwin-1.3.12-i686-2.2/cluster.o
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -DUSE_DL_IMPORT 
-Iranlib/src -I/usr/include/python2.2 -c clustermodule.c -o 
build/temp.cygwin-1.3.12-i686-2.2/clustermodule.o
... and so on


Martin v. Loewis wrote:

> Michiel Jan Laurens de Hoon <mdehoon at ims.u-tokyo.ac.jp> writes:
> 
> 
>>Thanks for your reply. I am having some difficulties setting the CC
>>environment variable, probably due to some peculiarities of our Unix
>>system. But if I solve that and set CC=gcc, would distutils know about
>>it? 
>>
> 
> Yes, they use the compiler identified by this variable.
> 
> 
>>I would think that distutils would choose the compiler options for
>>the regular cc compiler, but substitute gcc for CC when the actual
>>compilation starts, thus ending up with the wrong compiler
>>options. Or am I missing something here? Does distutils check for
>>the CC environment variable?
>>
> 
> Yes, it does. As for the options: For most purposes, the options of cc
> and gcc are identical. In the few places where they differ, distutils
> know about the differences.
> 
> Regards,
> Martin
> 
> 




More information about the Python-list mailing list