/ windows_build.txt
windows_build.txt
1 Assumptions 2 =========== 3 4 The solution files for MPIR, MPFR, and MPC support VS 2015/2017. 5 However, if VS 2008 and/or VS 2010 is installed, the "Platform 6 Toolset" setting can be used to select a specific compiler: 7 - v90 = VS 2008, Python 2.6 and 2.7 8 - v100 = VS 2010, Python 3.3 and 3.4 9 - v140 = VS 2015, Python 3.5, 3.6, and 3.7 10 - v141 = VS 2017 11 12 Assumes MPIR is placed in c:\src\mpir. (No version number.) 13 Assumes MPFR is placed in c:\src\mpfr. (No version number.) 14 Assumes MPC is placed in c:\src\mpc. (No version number.) 15 Assumes gmpy2 is placed in c:\src\gmpy2. (No version number.) 16 Assumes vsyasm is installed. 17 18 Compatibility note for vsyasm 19 ============================= 20 21 VS 2015/2017 change the platform identifier for 32-bit builds from 22 "win32" to "Win32". To work around the issue with vsyasm v1.3.0, edit 23 the "vsyasm.props" file. After the following line: 24 25 <CommandLineTemplate>"$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] </CommandLineOptions> 26 27 add this line: 28 29 <CommandLineTemplate Condition="'$(Platform)' == 'Win32'">"$(YasmPath)"vsyasm.exe -Xvc -f win32 [AllOptions] [AdditionalOptions] [Inputs] </CommandLineOptions> 30 31 32 Compiling MPIR 33 ============== 34 35 cd c:\src\mpir\build.vc10 36 python mpir_config.py 37 # enter 3 (Pentium 3) and 18 (AMD K8) 38 39 Start Visual Studio 2010 and open c:\src\mpir\build.vc10\mpir.sln. 40 Select "Release" and "Win32" 41 Open "lib_mpir_p3" properties 42 - Change "Platform Toolset" if needed. 43 - Change "Character Set" to "Not Set". (Probably not needed.) 44 - Change "Optimization" to "/O2". (Set uniformly in MPFR and MPC too.) 45 - Change "Runtime Library" to "Multi-threaded DLL /MD". 46 - Change "Buffer Security Check" to "No". 47 Select "Build" 48 - Ignore preinv* warnings (I think) 49 - Ignore *_ux and *_sx warnings if using v90 toolset (i.e. VS2008). 50 51 Select "Release" and "x64" 52 Open "lib_mpir_k8" properties 53 - Change "Platform Toolset" if needed. 54 - Change "Character Set" to "Not Set". (Probably not needed.) 55 - Change "Optimization" to "/O2". (Set uniformly in MPFR and MPC too.) 56 - Change "Runtime Library" to "Multi-threaded DLL /MD". 57 - Change "Buffer Security Check" to "No". 58 Select "Build" 59 - Ignore preinv* warnings (I think) 60 - Ignore *_ux and *_sx warnings if using v90 toolset (i.e. VS2008). 61 62 Compiling MPFR 63 ============== 64 65 Start Visual Studio 2010 and open c:\src\mpfr\build.vc10\lib_mpfr.sln. 66 Select "Release" and "Win32" 67 Open "lib_mpfr" properties 68 - Change "Platform Toolset: if needed. 69 - Change settings to match MPIR except "Enable Fiber-Safe Optimizations" should 70 be set. 71 Select "Build" 72 73 Select "Release" and "x64" 74 Open "lib_mpfr" properties 75 - Change "Platform Toolset: if needed. 76 - Change settings to match MPIR except "Enable Fiber-Safe Optimizations" should 77 be set. 78 Select "Build" 79 80 Compiling MPC 81 ============= 82 83 Start Visual Studio 2010 and open c:\src\mpfr\build.vc10\mpc.sln. 84 Select "Release" and "Win32" 85 Open "mpc_lib" properties 86 - Change "Platform Toolset: if needed. 87 - Change remaining settings to match MPIR. 88 Select "Build" 89 90 Select "Release" and "x64" 91 Open "lib_mpfr" properties 92 - Change "Platform Toolset: if needed. 93 - Change remaining settings to match MPIR. 94 Select "Build" 95 96 Copy the library files 97 ====================== 98 99 The header files will be copied c:\src\BB\vsNNNN\include and the library files 100 will be copied to c:\src\BB\vsNNNN\lib where BB is 32 or 64, and NNNN is 2008 101 or 2010. 102 103 32-bit, VS 2008 104 105 cd c:\src 106 xcopy /y c:\src\mpir\lib\Win32\Release\*.h c:\src\32\vs2008\include\ 107 xcopy /y c:\src\mpir\lib\Win32\Release\*.lib c:\src\32\vs2008\lib\ 108 xcopy /y c:\src\mpfr\lib\Win32\Release\*.h c:\src\32\vs2008\include\ 109 xcopy /y c:\src\mpfr\lib\Win32\Release\*.lib c:\src\32\vs2008\lib\ 110 xcopy /y c:\src\mpc\lib\Win32\Release\*.h c:\src\32\vs2008\include\ 111 xcopy /y c:\src\mpc\lib\Win32\Release\*.lib c:\src\32\vs2008\lib\ 112 113 64-bit, VS 2008 114 115 cd c:\src 116 xcopy /y c:\src\mpir\lib\x64\Release\*.h c:\src\64\vs2008\include\ 117 xcopy /y c:\src\mpir\lib\x64\Release\*.lib c:\src\64\vs2008\lib\ 118 xcopy /y c:\src\mpfr\lib\x64\Release\*.h c:\src\64\vs2008\include\ 119 xcopy /y c:\src\mpfr\lib\x64\Release\*.lib c:\src\64\vs2008\lib\ 120 xcopy /y c:\src\mpc\lib\x64\Release\*.h c:\src\64\vs2008\include\ 121 xcopy /y c:\src\mpc\lib\x64\Release\*.lib c:\src\64\vs2008\lib\ 122 123 32-bit, VS 2010 124 125 cd c:\src 126 xcopy /y c:\src\mpir\lib\Win32\Release\*.h c:\src\32\vs2010\include\ 127 xcopy /y c:\src\mpir\lib\Win32\Release\*.lib c:\src\32\vs2010\lib\ 128 xcopy /y c:\src\mpfr\lib\Win32\Release\*.h c:\src\32\vs2010\include\ 129 xcopy /y c:\src\mpfr\lib\Win32\Release\*.lib c:\src\32\vs2010\lib\ 130 xcopy /y c:\src\mpc\lib\Win32\Release\*.h c:\src\32\vs2010\include\ 131 xcopy /y c:\src\mpc\lib\Win32\Release\*.lib c:\src\32\vs2010\lib\ 132 133 64-bit, VS 2010 134 135 cd c:\src 136 xcopy /y c:\src\mpir\lib\x64\Release\*.h c:\src\64\vs2010\include\ 137 xcopy /y c:\src\mpir\lib\x64\Release\*.lib c:\src\64\vs2010\lib\ 138 xcopy /y c:\src\mpfr\lib\x64\Release\*.h c:\src\64\vs2010\include\ 139 xcopy /y c:\src\mpfr\lib\x64\Release\*.lib c:\src\64\vs2010\lib\ 140 xcopy /y c:\src\mpc\lib\x64\Release\*.h c:\src\64\vs2010\include\ 141 xcopy /y c:\src\mpc\lib\x64\Release\*.lib c:\src\64\vs2010\lib\ 142 143 32-bit, VS 2015 144 145 cd c:\src 146 xcopy /y c:\src\mpir\lib\Win32\Release\*.h c:\src\32\vs2015\include\ 147 xcopy /y c:\src\mpir\lib\Win32\Release\*.lib c:\src\32\vs2015\lib\ 148 xcopy /y c:\src\mpfr\lib\Win32\Release\*.h c:\src\32\vs2015\include\ 149 xcopy /y c:\src\mpfr\lib\Win32\Release\*.lib c:\src\32\vs2015\lib\ 150 xcopy /y c:\src\mpc\lib\Win32\Release\*.h c:\src\32\vs2015\include\ 151 xcopy /y c:\src\mpc\lib\Win32\Release\*.lib c:\src\32\vs2015\lib\ 152 153 64-bit, VS 2015 154 155 cd c:\src 156 xcopy /y c:\src\mpir\lib\x64\Release\*.h c:\src\64\vs2015\include\ 157 xcopy /y c:\src\mpir\lib\x64\Release\*.lib c:\src\64\vs2015\lib\ 158 xcopy /y c:\src\mpfr\lib\x64\Release\*.h c:\src\64\vs2015\include\ 159 xcopy /y c:\src\mpfr\lib\x64\Release\*.lib c:\src\64\vs2015\lib\ 160 xcopy /y c:\src\mpc\lib\x64\Release\*.h c:\src\64\vs2015\include\ 161 xcopy /y c:\src\mpc\lib\x64\Release\*.lib c:\src\64\vs2015\lib\ 162 163 Compile gmpy2 164 ============= 165 166 c:\32\Python26\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2008 bdist_wininst 167 c:\32\Python27\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2008 bdist_wininst 168 c:\32\Python33\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2010 bdist_wininst 169 c:\32\Python34\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2010 bdist_wininst 170 c:\32\Python35\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2015 bdist_wininst 171 c:\32\Python36\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2015 bdist_wininst 172 c:\32\Python37\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2015 bdist_wininst 173 174 c:\64\Python26\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2008 bdist_wininst 175 c:\64\Python27\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2008 bdist_wininst 176 c:\64\Python33\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2010 bdist_wininst 177 c:\64\Python34\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2010 bdist_wininst 178 c:\64\Python35\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2015 bdist_wininst 179 c:\64\Python36\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2015 bdist_wininst 180 c:\64\Python37\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2015 bdist_wininst 181 182 183 184