/vs2010_build.txt

http://gmpy.googlecode.com/ · Plain Text · 82 lines · 61 code · 21 blank · 0 comment · 0 complexity · 53ab554507abd80c8885e79420819748 MD5 · raw file

  1. Building GMPY2 on Windows
  2. =========================
  3. Note 1
  4. ------
  5. Visual Studio 2010 is used to compile GMPY2. Since no objects that use the C
  6. runtime are passed between Python and GMPY2, there shouldn't be any issues
  7. using a different compiler. (At least, I think so....)
  8. Note 2
  9. ------
  10. To avoid creating a large number of spurious errors, it's best to disable
  11. parallel builds in Visual Studio. To change this option, goto
  12. "Tools">"Options">"Projects and Solutions">"Build and Run".
  13. 1) Download and unzip MPIR. To follow these instructions, the unzipped files
  14. should be located in C:\src\mpir. Follow the instructions in:
  15. C:\src\mpir\build.vc10\readme.txt
  16. 2) Download and unzip MPFR. To follow these instructions, the unzipped files
  17. should be located in C:\src\mpfr.
  18. 3) Download and install the VS 2010 solution files for MPFR from:
  19. http://gladman.plushost.co.uk/oldsite/computing/gmp4win.php
  20. 4) Create the following directories:
  21. > mkdir c:\src\32
  22. > mkdir c:\src\32\lib
  23. > mkdir c:\src\32\include
  24. > mkdir c:\src\64
  25. > mkdir c:\src\64\lib
  26. > mkdir c:\src\64\include
  27. 5) Download and unzip GMPY2. To follow these instructions, the unzipped files
  28. should be located in C:\src\gmpy2-2.0.0a2.
  29. 6) Open C:\src\mpir\build.vc10\mpir.sln. Choose "Release"/"Win32" or
  30. "Release"/"x64" as appropriate. Then use "Build">"Configuration Manager"
  31. to select the desired CPU option. Then "Build Solution". Copy the library
  32. files to C:\src\32 or C:\src\64.
  33. For 32-bit build
  34. > copy c:\src\mpir\build.vc10\lib\Win32\Release\mpir.??b c:\src\32\lib
  35. > copy c:\src\mpir\build.vc10\lib\Win32\Release\mpir.h c:\src\32\include
  36. For 64-bit build
  37. > copy c:\src\mpir\build.vc10\lib\x64\Release\mpir.??b c:\src\64\lib
  38. > copy c:\src\mpir\build.vc10\lib\x64\Release\mpir.h c:\src\64\include
  39. 7) Open C:\src\mpfr\build.vc10\lib_mpfr.sln. Choose "Release"/"Win32" or
  40. "Release"/"x64" and then "Build Solution". Copy the library files to
  41. C:\src\32 or C:\src\64.
  42. For 32-bit build
  43. > copy c:\src\mpfr\build.vc10\lib\Win32\Release\mpfr.??b c:\src\32\lib
  44. > copy c:\src\mpfr\mpfr.h c:\src\32\include
  45. For 64-bit build
  46. > copy c:\src\mpfr\build.vc10\lib\x64\Release\mpfr.??b c:\src\64\lib
  47. > copy c:\src\mpfr\mpfr.h c:\src\64\include
  48. 8) The final compilation of GMPY2 is done from the command prompt.
  49. 1a) Configure the environment for 64-bit builds.
  50. "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
  51. 1b) Configure the environment for 32-bit builds.
  52. "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
  53. 2) Convince setup.py to use the SDK tools.
  54. set MSSdk=1
  55. set DISTUTILS_USE_SDK=1
  56. 3) Build and install gmpy2.
  57. python setup.py build_ext -Ddir=c:\src\32 install
  58. -- or --
  59. python setup.py build_ext -Ddir=c:\src\64 install
  60. 4) (Optional) Build an installer.
  61. python setup.py bdist_wininst