This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: unable to specify another compiler
Type: Stage:
Components: Distutils Versions: Python 2.2
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, doko, loewis
Priority: normal Keywords:

Created on 2003-07-04 09:04 by doko, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Messages (5)
msg16862 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2003-07-04 09:04
[forwarded from http://bugs.debian.org/197537]

Assume, python was built using `gcc' (version 3.3), but
an extension module needs to be built using `gcc-2.95',
because the library it depends on is still built by
g++-2.95, which has another ABI than g++-3.3.

I'm unable (or fail to see how) I can overwrite the
compiler used by distutils.
msg16863 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-07-05 16:25
Logged In: YES 
user_id=21627

This is not a bug. The C compiler can be replaced by either
setting the CC/CXX environment variable, or by modifying
distutils.sysconfig._config_vars. Notice that replacing the
C compiler may result in an inoperable module, if mixing
different compilers is not supported in the system.
msg16864 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2003-07-05 19:25
Logged In: YES 
user_id=60903

Doesn't work for me. I can reproduce this at least for the
python-apt package on Debian

(apt-get source python-apt)

CC=gcc-2.95 /usr/bin/python setup.py build

gcc still gets used.
msg16865 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-07-06 10:14
Logged In: YES 
user_id=21627

Please try this with python2.3 instead. See
Lib/distutils/sysconfig.py:customize_compiler. 2.3 has a block

        if os.environ.has_key('CC'):
            cc = os.environ['CC']
        if os.environ.has_key('CXX'):
            cxx = os.environ['CXX']

which was added through patch #588809. Regrouping this as
2.2.3 issue.

I'm assigning this to Andrew for consideration whether the
patch should be backported. As this is, strictly speaking, a
new feature, it might not be eligible for back-porting.

Meanwhile, modifying setup.py to read

from distutils.sysconfig import parse_makefile, get_config_vars

config_vars = get_config_vars()
config_vars['CC'] = 'gcc-2.95'

employs the other approach of configuration.
msg16866 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2004-05-05 17:24
Logged In: YES 
user_id=11375

At this point it doesn't seem likely there will be another
2.2.x release,
so backporting the fix isn't worthwhile.
History
Date User Action Args
2022-04-10 16:09:43adminsetgithub: 38790
2003-07-04 09:04:04dokocreate