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

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <casevh@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'skip:` 10': 0.07; 'working:': 0.07; '#define': 0.09; '#undef': 0.09; 'setup.py': 0.09; 'to:addr:comp.lang.python': 0.09; 'library': 0.13; 'binary': 0.13; '"python': 0.15; 'honor': 0.15; 'config.h': 0.16; 'declaration': 0.16; 'install"': 0.16; 'modified.': 0.16; 'cc:addr :python-list': 0.16; 'looked': 0.16; 'wrote:': 0.18; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'specify': 0.24; 'windows': 0.26; 'figure': 0.26; 'looks': 0.27; 'cc:addr:gmail.com': 0.28; 'made.': 0.29; 'worked': 0.29; 'installed': 0.29; 'cc:addr:python.org': 0.29; 'skip:p 30': 0.29; 'installer': 0.30; 'file.': 0.31; 'does': 0.32; "isn't": 0.33; 'there': 0.33; 'header:User-Agent:1': 0.33; 'file': 0.34; 'copied': 0.34; 'directory.': 0.34; 'option.': 0.34; 'copying': 0.35; 'install': 0.35; 'received:209.85.160': 0.36; 'cc:2**1': 0.36; 'created': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'subject:with': 0.37; 'received:209.85': 0.38; 'monday,': 0.38; 'files': 0.39; 'header': 0.39; 'received:209': 0.39; 'march': 0.61; 'below': 0.62; 'from:no real name:2**0': 0.64; 'received:209.85.160.184': 0.67; 'received:mail- gy0-f184.google.com': 0.67; 'taylor': 0.67; 'brand': 0.76; 'successful.': 0.93
Newsgroups comp.lang.python
Date Mon, 12 Mar 2012 20:59:38 -0700 (PDT)
In-Reply-To <mailman.595.1331584711.3037.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=24.21.140.143; posting-account=0vXMwQoAAADCTO6LSb66apqOI0WiEK9C
References <CAO+9iGc2mNLuBEm6S4jyrOJi8=6ardnHsewwBY=SswKbCiMskw@mail.gmail.com> <mailman.5444.1328452841.27778.python-list@python.org> <35da69c3-edcc-4466-8a0d-70237c88af3b@qv4g2000pbc.googlegroups.com> <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>
User-Agent G2/1.0
X-Google-Web-Client true
MIME-Version 1.0
Subject Re: PyCrypto builds neither with MSVC nor MinGW
From casevh@gmail.com
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Cc python-list@python.org, Case Van Horsen <casevh@gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.600.1331611187.3037.python-list@python.org> (permalink)
Lines 48
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1331611187 news.xs4all.nl 6874 [2001:888:2000:d::a6]:35541
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:21553

Show key headers only | 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