Extending Python with C: Can I specify another C compiler?

Gerhard Häring gh at ghaering.de
Wed Jun 4 12:25:28 EDT 2008


spectrumdt at gmail.com wrote:
>   Hello.
> 
>   I am trying to extend my Python program with some C code. [...]
>   Anyway, my question is this: When compiling my C code to include in
> Python, using a Python script with the function
> distutils.core.setup... can I choose which C compiler to use? On my
> system it defaults to gcc, but I would like to use mpicc instead (C
> compiler for MPI, Message Passing Interface). [...]

Try:

$ export CC=mpicc
$ python setup.py build

HTH,

-- Gerhard




More information about the Python-list mailing list