How to install Python package from source on Windows

Chris Angelico rosuav at gmail.com
Tue May 16 19:24:19 EDT 2017


On Wed, May 17, 2017 at 9:01 AM, bartc <bc at freeuk.com> wrote:
> On 16/05/2017 23:33, Chris Angelico wrote:
>>
>> On Wed, May 17, 2017 at 8:17 AM, bartc <bc at freeuk.com> wrote:
>
>
>> Then you are stuck in your own little bubble. That's fine as long as
>> you never try to foist your software OR your system on anyone else.
>> The rest of us collaborate with other people.
>
>
> Other people who MUST have VS2015, otherwise nothing doing! Funny sort of
> collaboration.

No, I collaborate with people who use gcc and clang too. You don't
HAVE to use MSVC.

>> Sure, you can download a snapshot without git. How would you
>> contribute some changes upstream?
>
>
> I thought the OP wanted to use a particular package not maintain it. This is
> what those who supply open source seem to forget: most people just want to
> build and use the software, not rewrite it!

You're a programmer, not an end user, and you're saying that you don't
even know what git is.

> And for that purpose, the method of distribution and building can be
> considerably simpler.

You mean like wheel files? Yeah, whodathunk. They don't need a C
compiler or anything.

>> How many combinations of compiler, standard library, operating system,
>> and CPU architecture do you support? Again, you're stuck in your own
>> petty little bubble and have no clue what it takes to build a big
>> project.
>
>
> What do you mean what /I/ support?

Your programs. Anything you release. On how many of those combinations
do they work?

>> You don't, because you've never used CPUs with different endianness,
>> or C standard libraries that vary in what functions they support, or
>> OSes that vary in the semantics of process starting and termination.
>> The rest of us do.
>
>
> And it sounds like the CPython developers have never used a compiler other
> than gcc or MSVC, and the latter only reluctantly.

gcc, clang, msvc. That's three major compilers, at least one of which
is available on every major platform in use today. And at least one of
which is available on minor platforms too (gcc on OS/2, for instance,
which Python used to support until recently).

>> Seems somewhere in between. It's wilful ignorance.
>
>
> On whose part? I can understand that (likely younger) people are so used to
> working with large-scale tools where the details are hidden away, then they
> find it inconceivable that it is possible to do without.

How many CPUs have you compiled your code on? OSes? And how
complicated is the code?

> Anyway wasn't it you who suggested using TCC? This is a compiler that was
> advertised as being only 100KB in size. (It might have been once, but is
> nearer 200KB now.)

Not me, no. I'm too familiar with the hassles of mixing and matching
mallocs to recommend this.

> But since this is all apparently so easy for everyone else here accept me,
> let one of them do this experiment: get CPython source code, compile it with
> an alternative small compiler (Tiny C is one), and see how it compares with
> CPython compiled with gcc or MSVC.
>
> It should be a piece of cake, yes?
>

Well, let's see. What C standard does TCC support? What standard
library does it provide? If it supports all of C99 and links against
(say) GNU libc, then it's probably going to be fairly straight-forward
to compile CPython. If it supports C99 but has its own libc, you might
have to detect features to find out what you can and can't do with
it... yaknow, how the configure script does. That's what it's for. And
if TCC doesn't support C99, you may have major hassles. Specifically,
this is what you need:

https://www.python.org/dev/peps/pep-0007/#c-dialect

The specifications are laid out without naming compilers, other than a
passing reference to MSVC (since, as a general rule, the other
compilers support a lot more). You would be able to use TCC but only
if it's up to scratch.

ChrisA



More information about the Python-list mailing list