How to install Python package from source on Windows

Steve D'Aprano steve+python at pearwood.info
Thu May 18 13:11:44 EDT 2017


On Thu, 18 May 2017 11:38 pm, bartc wrote:

> > Speaking of user-hostile experiences, why do you need separate source
> > files for 32- and 64-bit builds? Why isn't it just a build option?
> >
> > I've never heard of people using separate source code for 32- and 64-bit
> > releases. I can understand pre-built binaries coming in two flavours,
> > but that's a pretty hostile experience to have different source files
> > for 32-bit. How do you keep them in sync?
> 
> This is just a consequence of not using C language for the original 
> source.

I'm not interested in excuses. A poor workman blames his tools, which is
ironic considering that in this case you've built your own tools to your
own specification.

Don't you think its a bit hypocritical to be criticising Python's source
code for being so complex given the complexity of your own build? You
expect your users to READ THE SOURCE CODE to find out how to buid the code!



[...]
> OK, same url but with '32' instead:
> 
>         https://github.com/bartg/langs/blob/master/qlang/qcc32.c
>         https://github.com/bartg/langs/blob/master/qlang/pcc32.c

Guh, github is so *painfully* slow. Slower than a wet week. "Waiting for
assets-cdn.github.com..." gods, even *scrolling* on the one page is like
being dragged through molasses...

Buggered if I can even work out how to download this. I thought Github was
supposed to be easy to use? Apparently it's the bee's knees for chatting
with other developers and showing pictures of them and their cat, but if
you want to download the source and build it, you're out of luck.

(I must say, Google might be evil, but I really miss Google Code. *They*
understood how to build an easy-to-use web interface.)

I'm not the only one having this problem:

https://duckduckgo.com/html/?q=how%20to%20download%20code%20from%20github

Dear gods, I'm reduced to getting technical advice from a WordPress site...

Okay, apparently I have to find the top level of the repository, and
append ".git" to the URL...

...there's no qlang repository... ah this looks like it:

https://github.com/bartg/langs.git

Finally:

git clone https://github.com/bartg/langs.git


That works! Now, using my awesome deductive powers from 20+ years of using
Linux, I realise that I must cd into the the "langs" directory. Good thing
I'm not a beginner, hey?

Where's your build documentation? I tried reading the README file, but it
was useless. qlang/readme.md was just as useless.

qlang/Instructions.md has some vague instructions for building the 64-bit
version. Using my awesome powers of deduction, I reckon that changing 64 to
32 should work...


Quote:
    ### Download Q compiler as qcc64.c, Q interpreter as pcc.64

Well, I cloned the entire repo. Does that count as downloading? Do I need to
rename the files? Who the hell knows?


Quote:
    Compile both using the instructions at the top of the source, 

What? I have to **read the source code** to find out how to build it? And
this is your idea of a good, pleasant, user experience?

Seems a bit hypocritical, don't you think? Expecting people to go spelunking
into your undocumented mystery language source code to work out how to
build it from source, and then turning around and complaining that Python's
build process:

PCbuild\build.bat -e -d


is too complicated.


Anyway, let's continue. Quote:

    but typically:


Okay, let's give the defaults a go, and see if they work.

    gcc -m64 -O3 qcc64.c -oqcc -lm         # Linux
    gcc -m64 -O3 pcc64.c -opcc -lm


Adjusting each 64 to 32:


[steve at ando langs]$ gcc -m32 -O3 qcc32.c -oqcc -lm
gcc: qcc32.c: No such file or directory

Oh that's a good start :-( Let me try again:

[steve at ando langs]$ gcc -m32 -O3 qlang/qcc32.c -oqcc -lm
qlang/qcc32.c:13808:23: warning: integer constant is so large that it is
unsigned
qlang/qcc32.c: In function ‘do_tag’:
qlang/qcc32.c:13808: warning: this decimal constant is unsigned only in ISO
C90


Hmmm, that's a bit scary... I mean, Python is used by millions of people. I
can afford to trust it even if it generates warnings, because if they were
serious, somebody would have noticed by now. But a single-user project from
somebody I don't know? I'm less inclined to trust code I don't know that
generates warnings I don't understand.

But okay, let's continue:

[steve at ando langs]$ gcc -m32 -O3 pcc32.c -opcc -lm
gcc: pcc32.c: No such file or directory


Oops, forgot to adjust the path.

[steve at ando langs]$ gcc -m32 -O3 qlang/pcc32.c -opcc -lm
[steve at ando langs]$


That at least completed without any warnings. Hmmm... that reminds me...


[steve at ando langs]$ gcc -Wall -m32 -O3 qlang/pcc32.c -opcc -lm

[wall of text]

Holy mother of perl! Look at all those warnings! Uninitialised variables,
unsafe dereferencing of type-punned pointers, missing parentheses, unused
variables and labels, confusion between int and longint...

Yeah, no, sorry Bart, I don't know you or C well enough to trust this
program not to eat my computer. I won't be running it any time soon.

It builds, but the instructions were hard to find and unclear once I found
them, the entire process was difficult and scary and gave me no confidence
that your code is safe to run.

Maybe it is, but I'm not brave enough to run it on my computer.


-- 
Steve
Emoji: a small, fuzzy, indistinct picture used to replace a clear and
perfectly comprehensible word.




More information about the Python-list mailing list