Sujet : Re: Python recompile
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.c comp.lang.pythonDate : 04. Mar 2025, 19:16:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vq7g1p$1vmg5$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla Thunderbird
On 04/03/2025 17:42, Kaz Kylheku wrote:
On 2025-03-04, Muttley@DastardlyHQ.org <Muttley@DastardlyHQ.org> wrote:
On Tue, 4 Mar 2025 09:57:16 +0000
Richard Heathfield <rjh@cpax.org.uk> wibbled:
On 04/03/2025 09:23, Muttley@DastardlyHQ.org wrote:
because plenty of compilation issues are caused by code issues.
>
Undoubtedly true, and equally undoubtedly irrelevant in this
case. Were it relevant, the OP would by now have shown us the
problem code.
>
So what you're saying is you can't troubleshoot linking problems. Do you
get someone else to compile your code for you?
Python is not "your code" for any value of "your" referring to any
regular here in comp.lang.c.
A compiler is a compiler, a linker is a linker. Troubleshooting both is part
of the development process of any competent C dev. But we know already you
don't consider that to be the case because its beyond your abilities.
Troubleshooting an open source package build problem is often a complex
problem that in most cases requires direct access to the environment
where the problem is happening.
The CPython source bundle doesn't come with any makefiles. The first step appears to be to run a 35,000-line 'configure' script. Part of its job appears to be generate the necessary makefiles. I see options like "-fPIC" inside it set according to platform type and other settings.
Maybe the OP was trying to build it independently. I tried it once on Windows; I was told by the people at comp.lang.python that it was a piece of cake; it wasn't. (I notice this is cross-posted there; I will keep that in.)
On Windows, CPython must be built via MSVC, not gcc.
That involving installing VS20xx, a 6GB download, which itself first needed a 4GB .NET update. Then I needed GIT. Then SVN. Then MSBUILD tools. Then something else...
Whatever I fixed, it always found something else to fail on. After several hours and a lot of downloads, I gave up.
It's actually a case of porting. When Python does not build in some OS
distro with certain compilers, that's a kind of porting challenge.
Yet CPython exists on Windows; it must work for somebody!
I'd been interested in fiddling with the source to make it faster, but the first thing I discovered was that on Linux, CPython makes use of gcc's extensions to use computed-gotos for its dispatch loop.
MSVC doesn't have that feature, so on Windows, CPython is a little bit slower than on Linux as it has to use a regular 'switch', because the developers couldn't manage to build it with gcc on Windows.