PageRenderTime 23ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

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