Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21553

Re: PyCrypto builds neither with MSVC nor MinGW

Newsgroups comp.lang.python
Date 2012-03-12 20:59 -0700
References (3 earlier) <CAO+9iGdiBnoEUH=L7QemOjPm_d-5PQYiECUBqT86JX=LDLQ8UA@mail.gmail.com> <CANerV6mip=4q5ZJFu00g7wvSAV4cBk6soDTc+x=bHKfVWt+4ZQ@mail.gmail.com> <CAO+9iGfmMmLyRH-CXcToz0KuT_AAAiko=N0XNPPnxpfpTuXKrg@mail.gmail.com> <CANerV6kNxt1eM1pj=fAp_161q363iOxRQ7Wo_3pPTXumjqXRsw@mail.gmail.com> <mailman.595.1331584711.3037.python-list@python.org>
Subject Re: PyCrypto builds neither with MSVC nor MinGW
From casevh@gmail.com
Message-ID <mailman.600.1331611187.3037.python-list@python.org> (permalink)

Show all headers | View raw


On Monday, March 12, 2012 1:38:29 PM UTC-7, Alec Taylor wrote:
> On a brand new Windows install now, with a brand new VS8 installed
> with new YASM and MPIR in c:\usr\src\include and c:\usr\src\lib.
> 
> But it still isn't working:
> 
This was a little challenging. I looked through the setup.py to figure out what assumptions their build process made. First, the file pycrypto-2.5\src\inc-msvc\config.h must be modified. Below is the file I used:

config.h
===================================================================
/* Define to 1 if you have the declaration of `mpz_powm', and to 0 if you
   don't. */
#define HAVE_DECL_MPZ_POWM 1

/* Define to 1 if you have the declaration of `mpz_powm_sec', and to 0 if you
   don't. */
#define HAVE_DECL_MPZ_POWM_SEC 0

/* Define to 1 if you have the `gmp' library (-lgmp). */
#undef HAVE_LIBGMP

/* Define to 1 if you have the `mpir' library (-lmpir). */
#define HAVE_LIBMPIR 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
===================================================================

Although I was able to specify an include directory for mpir.h with -Ic:\usr\include, I was not able specify a lib directory with -Lc:\usr\lib. It looks like setup.py does not honor the -L option. So I finally gave up and just copied the mpir.h file into my Python27\include directory and the mpir.lib file into my Python27\libs directory. 

After copying the files "python setup.py install" was successful. I created a binary installer with "python setup.py bdist-wininst".

There may be a cleaner way to build PyCrypto, but these steps worked for me.

casevh

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PyCrypto builds neither with MSVC nor MinGW Alec Taylor <alec.taylor6@gmail.com> - 2012-02-06 01:40 +1100
  Re: PyCrypto builds neither with MSVC nor MinGW casevh <casevh@gmail.com> - 2012-02-06 15:27 -0800
    Re: PyCrypto builds neither with MSVC nor MinGW Alec Taylor <alec.taylor6@gmail.com> - 2012-02-08 16:37 +1100
    Re: PyCrypto builds neither with MSVC nor MinGW Case Van Horsen <casevh@gmail.com> - 2012-02-08 02:48 -0800
    Re: PyCrypto builds neither with MSVC nor MinGW Alec Taylor <alec.taylor6@gmail.com> - 2012-02-08 23:24 +1100
    Re: PyCrypto builds neither with MSVC nor MinGW Case Van Horsen <casevh@gmail.com> - 2012-02-08 04:31 -0800
    Re: PyCrypto builds neither with MSVC nor MinGW Alec Taylor <alec.taylor6@gmail.com> - 2012-03-13 07:38 +1100
      Re: PyCrypto builds neither with MSVC nor MinGW casevh@gmail.com - 2012-03-12 20:59 -0700
        Re: PyCrypto builds neither with MSVC nor MinGW Alec Taylor <alec.taylor6@gmail.com> - 2012-03-13 15:57 +1100
        Re: PyCrypto builds neither with MSVC nor MinGW Alec Taylor <alec.taylor6@gmail.com> - 2012-03-13 17:09 +1100
        Re: PyCrypto builds neither with MSVC nor MinGW Alec Taylor <alec.taylor6@gmail.com> - 2012-03-14 20:47 +1100
        Re: PyCrypto builds neither with MSVC nor MinGW bikewave <pmfenton33@gmail.com> - 2012-08-22 11:21 -0700
        Re: PyCrypto builds neither with MSVC nor MinGW Dave Angel <d@davea.name> - 2012-08-22 14:39 -0400
      Re: PyCrypto builds neither with MSVC nor MinGW casevh@gmail.com - 2012-03-12 20:59 -0700
    Re: PyCrypto builds neither with MSVC nor MinGW Alec Taylor <alec.taylor6@gmail.com> - 2012-03-13 08:21 +1100

csiph-web