PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/win_x64_sdk_build.txt

http://gmpy.googlecode.com/
Plain Text | 87 lines | 62 code | 25 blank | 0 comment | 0 complexity | f6f1f19ec054454c041ba4c0361d3b37 MD5 | raw file
 1        Building MPIR and GMPY using the Windows SDK tools
 2
 3It is possible to build MPIR and GMPY from source on a Microsoft Windows
 4platform using the command-line compiler that is included with the Microsoft
 5Platform SDK. I've documented the process for a 64-bit build. The operating
 6system was Windows XP x64. The process isn't difficult but assumes some
 7familiarity with the command line.
 8
 91)  You should have an program for processing .zip and .tar.gz archives.
10
112)  Python should be installed on your system and the installation
12    directory should be added to your system's PATH environment variable.
13
143)  Install .NET Framework 2.0 or later. (This is required for the
15    installer used by the SDK.)
16
174)  Install the Microsoft Windows SDK. I used "Microsoft Windows SDK for
18    Windows 7 and .NET Framework 3.5 Service Pack 1". It can be found at
19    "http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx". Use the
20    version appropriate for your system: X86 for a 32-bit system or AMD64
21    for a 64-bit system.
22
235)  Download the current version of the YASM assembler. It can be found at
24    "http://www.tortall.net/projects/yasm/". Again, use the version approp-
25    riate for your system.
26
27    The executable must be renamed to "yasm.exe" and copied to the SDK
28    installation directory, typically:
29
30    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin
31
326)  Create a directory to use for the build process. I used C:\src.
33
34    mkdir c:\src
35
367)  Download the GMPY and MPIR source code. This example uses
37    gmpy-1.12.zip and mpir-2.1.1.tar.gz. They should be unzipped
38    (or untarred) into c:\src. There should be c:\src\gmpy-1.12
39    and c:\src\mpir-2.1.1 directories in c:\src.
40
418)  The file "yasm.rules" must be copied from
42
43    c:\src\mpir-2.1.1\build.vc9\
44
45    to
46
47    C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCProjectDefaults
48
499)  Open a command window and enter the following commands:
50
51    rem Configure the environment for 64-bit builds.
52    rem Use "vcvars32.bat" for a 32-bit build.
53    "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
54
55    rem Build mpir first.
56    cd C:\src\mpir-2.1.1\build.vc9
57
58    rem Check contents of configure.bat to see allowed options. Verify that
59    rem all tests pass.
60    rem 64-bit binaries were built with --cpu-k8.
61    configure
62    make
63    make check
64
65    rem Copy the required to a convenient location for gmpy.
66    rem The files are located in "lib\Win32\release" for 32-bit
67    rem build.
68    mkdir c:\src\lib
69    mkdir c:\src\include
70    xcopy /Y lib\x64\release\*.h c:\src\include\*.*
71    xcopy /Y lib\x64\release\*.??b c:\src\lib\*.*
72
73    rem Done with mpir, now build gmpy.
74    cd c:\src\gmpy-1.12
75
76    rem Convince setup.py to use the SDK tools.
77    set MSSdk=1
78    set DISTUTILS_USE_SDK=1
79
80    rem Build and install gmpy.pyd
81    python setup.py build_ext -DMPIR -Ic:\src\include -Lc:\src\lib install
82
83    rem Run the test suite
84    python test\gmpy_test.py
85
86    rem (Optional) Build an installer, located in c:\src\gmpy-1.12\dist.
87    python setup.py bdist_wininst