distutils gcc unix

Chris Liechti cliechti at gmx.net
Sat Jul 27 13:46:19 EDT 2002


Michiel Jan Laurens de Hoon <mdehoon at ims.u-tokyo.ac.jp> wrote in
news:3D42D972.2060607 at ims.u-tokyo.ac.jp: 

> Sorry ... it seems that distutils ignores the CC environment variable 
> (see below). This was done on cygwin.

there is a note somewhere in the docs that you can use --compiler=mingw32 
(which works with gcc/cygwin) the doc also says how to use the borland 
compiler.
i always have trouble to find the respecive note, but i _know_ it's 
somewhere in the docs that get installed with python. :-(

> 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
>> 
>> 
> 
> 



-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list