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: using gcc on cygwin for config
Type: Stage:
Components: Distutils Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: akuchling, jlt63, mdehoon, nnorwitz
Priority: normal Keywords: patch

Created on 2003-02-06 06:46 by mdehoon, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
config.py.diff mdehoon, 2003-02-06 06:48
Messages (12)
msg42688 - (view) Author: Michiel de Hoon (mdehoon) * Date: 2003-02-06 06:46
On Cygwin, I noticed that distutils tries to use the cc
compiler instead of the gcc compiler for the config
step, resulting in an error. Instead, for the build
step the correct compiler (gcc) is being used.

For the build step, build_clib.py and build_ext.py
contain a call to customize_compiler after the call to
new_compiler. The call to customize_compiler causes gcc
to be used on cygwin. In config.py, however, this call
to customize_compiler after the call to new_compiler is
missing.

Adding the call to customize_compiler after the call to
new_compiler in config.py solves this problem, and the
config step then runs correctly on Cygwin.

BTW, I noticed that in version 1.44.6.3 of sysconfig.py
in CVS, the function get_python_version is missing,
causing errors in the build step. This is the latest
committed version of sysconfig.py. So I used version
1.56 instead (which was committed earlier than
1.44.6.3, but has a higher version number ??).


Michiel de Hoon
University of Tokyo, Human Genome Center
msg42689 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-02-07 22:55
Logged In: YES 
user_id=33168

Jason, can you provide any input about the issues w/Cygwin?
msg42690 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2003-02-10 15:54
Logged In: YES 
user_id=86216

> On Cygwin, I noticed that distutils tries to use the cc 
> compiler instead of the gcc compiler for the config 
> step, resulting in an error.

Please excuse my ignorance, but what is the "config
step?" How would one invoke the config step? Sorry,
but I'm only lightly versed in distutils.

> Instead, for the build 
> step the correct compiler (gcc) is being used.

The build step seems to work fine under Cygwin Python
2.2.2 and CVS.
msg42691 - (view) Author: Michiel de Hoon (mdehoon) * Date: 2003-02-10 16:06
Logged In: YES 
user_id=488897

The config step is where you do
python setup.py config
where you can do some test compilations before doing "python
setup.py build". Basically it works the same as
autoconf/automake's configure scripts. The code for the
config is in distutils/command/config.py. If you want to try
it out, you can go to my website
http://bonsai.ims.u-tokyo.ac.jp/~mdehoon, download pygist,
unpack, and run "python setup.py config". You'll notice that
it won't work on cygwin, as it tries to use cc instead of gcc.
--Michiel.
msg42692 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2003-02-10 16:56
Logged In: YES 
user_id=86216

OK, now I get it. Thanks for you help. 

I can reproduce the problem under Cygwin
too. Now the question is, where is the right
place to fix this?

Under Red Hat 8.0, I get the following:

$ ls -il /usr/bin/cc /usr/bin/c++ /usr/bin/g++
 328451 -rwxr-xr-x    4 root     root        80780 Sep  3 
23:03 /usr/bin/c++
 328396 lrwxrwxrwx    1 root     root            3 Oct 21 
10:04 /usr/bin/cc -> gcc
 328451 -rwxr-xr-x    4 root     root        80780 Sep  3 
23:03 /usr/bin/g++

Under Cygwin, I get the following:

$ ls -il /usr/bin/cc /usr/bin/c++ /usr/bin/g++
ls: /usr/bin/cc: No such file or directory
 423677 lrwxrwxrwx    1 Administ Domain U       18 Dec  3 
08:22 /usr/bin/c++ -> g++.exe
 423679 -rwxrwxrwx    1 Administ Domain U    89600 Nov 14 
17:37 /usr/bin/g++

So from the above, we can see that a symlink from cc
to gcc could be considered missing under Cygwin.

I will ask the Cygwin gcc maintainer to add this symlink.
If the request is granted, will you consider this issue
resolved?
msg42693 - (view) Author: Michiel de Hoon (mdehoon) * Date: 2003-02-10 17:13
Logged In: YES 
user_id=488897

OK thanks for your help. Adding a symlink would work, but I
am not sure if it is the best solution. For the build step,
distutils uses gcc automatically and doesn't need a symlink
from cc. I think it is best if the config step mimics the
build step as closely as possible, and having one solution
for the build step and another for the config step might
break things. For the patch that I submitted, I compared the
config and the build step to find out where one chooses gcc
and the other cc. The patch contains only one or two lines,
and lets the config step choose gcc in the same way as the
build step. Would that be OK with you? Or do you think there
might be some problem with the patch I submitted?
--Michiel.
msg42694 - (view) Author: Jason Tishler (jlt63) * (Python triager) Date: 2003-02-10 20:40
Logged In: YES 
user_id=86216

> Adding a symlink would work, but I
> am not sure if it is the best solution.

Maybe both should be done?

> Would that be OK with you?

The patch is fine by me since it fixes Cygwin
and I assume any other Unix (if any) without a
/usr/bin/cc.

> Or do you think there might be some problem
> with the patch I submitted?

No, I don't think that there will be problems
with your patch. However, I cannot approve
patches. I can only submit them like you. :,)

Neal, should someone from distutils take
a look-see. Or, is it OK for me to apply?
msg42695 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-02-10 20:55
Logged In: YES 
user_id=33168

amk, could you take a quick look at this patch to distutils?
msg42696 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2003-02-18 01:21
Logged In: YES 
user_id=11375

The patch looks fine; I'll apply it.
msg42697 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2003-02-18 01:37
Logged In: YES 
user_id=11375

Applied as revision 1.17 of config.py; thanks!

Re-assigned to Neal, because I'm not sure if the bug can be closed now or not.
msg42698 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-02-18 05:54
Logged In: YES 
user_id=33168

Michiel, if there is anything else that needs to be done,
please add a comment to this patch.  I think everything is
done, so I'm closing it.
msg42699 - (view) Author: Michiel de Hoon (mdehoon) * Date: 2003-02-18 06:12
Logged In: YES 
user_id=488897

I tried the updated version in CVS and tested it with
Cygwin. It works fine. Thanks.
--Michiel.
History
Date User Action Args
2022-04-10 16:06:35adminsetgithub: 37922
2003-02-06 06:46:55mdehooncreate