/vs2010_build.txt
http://gmpy.googlecode.com/ · Plain Text · 82 lines · 61 code · 21 blank · 0 comment · 0 complexity · 53ab554507abd80c8885e79420819748 MD5 · raw file
- Building GMPY2 on Windows
- =========================
-
- Note 1
- ------
- Visual Studio 2010 is used to compile GMPY2. Since no objects that use the C
- runtime are passed between Python and GMPY2, there shouldn't be any issues
- using a different compiler. (At least, I think so....)
-
- Note 2
- ------
- To avoid creating a large number of spurious errors, it's best to disable
- parallel builds in Visual Studio. To change this option, goto
- "Tools">"Options">"Projects and Solutions">"Build and Run".
-
- 1) Download and unzip MPIR. To follow these instructions, the unzipped files
- should be located in C:\src\mpir. Follow the instructions in:
- C:\src\mpir\build.vc10\readme.txt
-
- 2) Download and unzip MPFR. To follow these instructions, the unzipped files
- should be located in C:\src\mpfr.
-
- 3) Download and install the VS 2010 solution files for MPFR from:
- http://gladman.plushost.co.uk/oldsite/computing/gmp4win.php
-
- 4) Create the following directories:
-
- > mkdir c:\src\32
- > mkdir c:\src\32\lib
- > mkdir c:\src\32\include
- > mkdir c:\src\64
- > mkdir c:\src\64\lib
- > mkdir c:\src\64\include
-
- 5) Download and unzip GMPY2. To follow these instructions, the unzipped files
- should be located in C:\src\gmpy2-2.0.0a2.
-
- 6) Open C:\src\mpir\build.vc10\mpir.sln. Choose "Release"/"Win32" or
- "Release"/"x64" as appropriate. Then use "Build">"Configuration Manager"
- to select the desired CPU option. Then "Build Solution". Copy the library
- files to C:\src\32 or C:\src\64.
-
- For 32-bit build
- > copy c:\src\mpir\build.vc10\lib\Win32\Release\mpir.??b c:\src\32\lib
- > copy c:\src\mpir\build.vc10\lib\Win32\Release\mpir.h c:\src\32\include
-
- For 64-bit build
- > copy c:\src\mpir\build.vc10\lib\x64\Release\mpir.??b c:\src\64\lib
- > copy c:\src\mpir\build.vc10\lib\x64\Release\mpir.h c:\src\64\include
-
- 7) Open C:\src\mpfr\build.vc10\lib_mpfr.sln. Choose "Release"/"Win32" or
- "Release"/"x64" and then "Build Solution". Copy the library files to
- C:\src\32 or C:\src\64.
-
- For 32-bit build
- > copy c:\src\mpfr\build.vc10\lib\Win32\Release\mpfr.??b c:\src\32\lib
- > copy c:\src\mpfr\mpfr.h c:\src\32\include
-
- For 64-bit build
- > copy c:\src\mpfr\build.vc10\lib\x64\Release\mpfr.??b c:\src\64\lib
- > copy c:\src\mpfr\mpfr.h c:\src\64\include
-
- 8) The final compilation of GMPY2 is done from the command prompt.
-
- 1a) Configure the environment for 64-bit builds.
- "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
-
- 1b) Configure the environment for 32-bit builds.
- "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
-
- 2) Convince setup.py to use the SDK tools.
- set MSSdk=1
- set DISTUTILS_USE_SDK=1
-
- 3) Build and install gmpy2.
- python setup.py build_ext -Ddir=c:\src\32 install
-
- -- or --
- python setup.py build_ext -Ddir=c:\src\64 install
-
- 4) (Optional) Build an installer.
- python setup.py bdist_wininst