Charm installation on mingw step-by-step

696 views
Skip to first unread message

Marcos Portnoi

unread,
May 4, 2015, 4:36:26 PM5/4/15
to charm-...@googlegroups.com
After storms, computer assassination threats and attempts that would break everything but the kitchen stove, here's how I successfully installed Charm Crypto on mingw running on Windows 8.1 Pro and Anaconda3 Python.

What I used:
  • Anaconda Python 3.4 32 bits (the 64-bit version caused problems with mingw 32-bit version, and I did not even attempt mingw 64 bits).
  • GMP 6.0.0.a. (bz2).
  • OpenSSL (openssl-1.0.2a.tar.gz).
  • PBC (pbc-0.5.14.tar.gz).
  • Charm Crypto (Charm-Crypto-0.43_Python3.tar.gz (Python 3.x Source)).
  • MinGW 32 bits (version of April 2015).
  • Windows 8.1 Pro 64 bits.
What I did:
  • Download and install Anaconda Python on Windows.
  • Download and install mingw.
    • Select several things on mingw, including msys, but do not include any GMP library. I attempted excluding OpenSSL libraries, but some of them seem necessary for gcc, which will fail at gmp compile time.
  • Open mingw shell.
  • Install GMP per Charm page (http://jhuisi.github.io/charm/install_source.html).
  • Install OpenSSL per Charm page.
  • Install PBC per Charm page.
  • Before installing Charm, need to include libpython34.a in Anaconda Python, otherwise it will not compile. Do:
    • Open Anaconda Command Shell.
    • Type:  "conda install libpython"
  • Alternatively, or if you do not use Anaconda Python, then build libpython34.a as such:

[build]
compiler=mingw32


    • Next, use pexports to export the python dll symbols. (this library is found within Anaconda3 directory). Use the following command (adjust python path as necessary):

pexports /c/Users/youruser/Anaconda3/python34.dll >python34.def


(install pexports from mingw tool if not there)


    • Then, use the following command to build an import library.

dlltool -D python34.dll -d python34.def -l libpython34.a


    • Move libpython34.a to /mingw/lib and to /c/Users/youruser/Anaconda3/libs. 
    • Important! Remove or rename pydistutils.cfg, otherwise next steps will fail.

  • Now Charm install per Charm page (configure, make, make install).
  • Test. Run Anaconda Python from within mingw shell (>spyder); running Anaconda outside mingw shell loses some seemingly important path variables and Charm libraries will not run properly (in particular, the core/benchmark library will never be found if running python outside mingw shell).
  • Done!
Reply all
Reply to author
Forward
0 new messages