Xpra: Ticket #373: gmp and mpfr build for win32 - needed for pycrypto fastmath

Can be dealt with as part of #300

Tue, 16 Jul 2013 05:52:49 GMT - Antoine Martin: status, milestone changed

Tue, 16 Jul 2013 06:26:45 GMT - Antoine Martin: description changed

Wed, 16 Oct 2013 08:41:21 GMT - Antoine Martin: attachment set

session info dialog showing availability of pycrypto's fastmath

Wed, 16 Oct 2013 08:41:49 GMT - Antoine Martin: owner, status changed

This solution works for me: Building PyCrypto with fastmath (gmp or mpir) via pip on Windows (remove existing version before installing - and remember to use "export VAR=value" syntax in the mingw32 shell!)

You can verify it is installed with:

C:\Python27\Python.exe -c "from Crypto.PublicKey import _fastmath;print(_fastmath);"

And as of r4511, it is also shown on session info as "(fastmath available)": /raw-attachment/ticket/373/session-info-showfastmath.png

Please confirm and close.

Tue, 10 Dec 2013 00:04:25 GMT - Smo: status changed; resolution set

Followed the same solution that worked for you. Compiled and Installed with minor issues.

There was an issue with the test units but doesn't seem to affect anything. Will reopen this ticket if I find a problem.

Thu, 17 Jul 2014 16:55:13 GMT - Antoine Martin:


Thu, 24 Jul 2014 13:54:34 GMT - Antoine Martin:

Was easier to rebuild with an up to date mingw32 environment and the libgmp it can install.

In a mingw shell:

mingw-get.exe update
mingw-get.exe upgrade
mingw-get.exe install mingw32-libgmp

Then in the pycrypto source directory, just:

/c/Python27/python.exe setup.py build -c mingw32
/c/Python27/python.exe setup.py test
/c/Python27/python.exe setup.py install

Note: this does not seem to work for Python 3.3 and 3.4, where the resulting module causes crashes at runtime

Note: as of version 0.12.x, you can also verify the presence of pycrypto's fastmath with Network_info.exe:

C:\Program Files\Xpra>Network_info.exe
Network interfaces found:
* {0F7E7AF4-D168-429C-86D0-0687BA76F4A5}
* MS TCP Loopback interface
Protocol Capabilities:
* bencode              : True
* bencode.version      : Cython, 0.11
* digest               : hmac, xor
* lz4                  : True
* mmap                 : True
* pycrypto.fastmath    : True
* pycrypto.version     : 2.6.1
* rencode              : True
* rencode.version      : Cython, 1.0.2
* yaml                 : False

PS: you may need to patch some of the mingw header files if you encounter off64_t and off_t errors, see here: mingw bug 2024: 'off64_t' does not name a type

Fri, 25 Jul 2014 15:48:56 GMT - Antoine Martin:

For Python 3.x:

(and verify that it found gmp)

Note: for some reason, the fastmath pyd needs to find the libgmp-3.dll.dll (and fails no matter what it seems..)

Nasty workaround:

(and verify that it found gmp)

Sat, 23 Jan 2021 04:53:23 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/373