Assumptions
===========

The solution files for MPIR, MPFR, and MPC support VS 2015/2017.
However, if VS 2008 and/or VS 2010 is installed, the "Platform
Toolset" setting can be used to select a specific compiler:
   - v90  = VS 2008, Python 2.6 and 2.7
   - v100 = VS 2010, Python 3.3 and 3.4
   - v140 = VS 2015, Python 3.5, 3.6, and 3.7
   - v141 = VS 2017

Assumes MPIR is placed in c:\src\mpir. (No version number.)
Assumes MPFR is placed in c:\src\mpfr. (No version number.)
Assumes MPC is placed in c:\src\mpc. (No version number.)
Assumes gmpy2 is placed in c:\src\gmpy2. (No version number.)
Assumes vsyasm is installed.

Compatibility note for vsyasm
=============================

VS 2015/2017 change the platform identifier for 32-bit builds from
"win32" to "Win32". To work around the issue with vsyasm v1.3.0, edit
the "vsyasm.props" file. After the following line:

<CommandLineTemplate>"$(YasmPath)"vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] </CommandLineOptions>

add this line:

<CommandLineTemplate Condition="'$(Platform)' == 'Win32'">"$(YasmPath)"vsyasm.exe -Xvc -f win32 [AllOptions] [AdditionalOptions] [Inputs] </CommandLineOptions>


Compiling MPIR
==============

cd c:\src\mpir\build.vc10
python mpir_config.py
# enter 3 (Pentium 3) and 18 (AMD K8)

Start Visual Studio 2010 and open c:\src\mpir\build.vc10\mpir.sln.
Select "Release" and "Win32"
Open "lib_mpir_p3" properties
- Change "Platform Toolset" if needed.
- Change "Character Set" to "Not Set". (Probably not needed.)
- Change "Optimization" to "/O2". (Set uniformly in MPFR and MPC too.)
- Change "Runtime Library" to "Multi-threaded DLL /MD".
- Change "Buffer Security Check" to "No".
Select "Build"
- Ignore preinv* warnings (I think)
- Ignore *_ux and *_sx warnings if using v90 toolset (i.e. VS2008).

Select "Release" and "x64"
Open "lib_mpir_k8" properties
- Change "Platform Toolset" if needed.
- Change "Character Set" to "Not Set". (Probably not needed.)
- Change "Optimization" to "/O2". (Set uniformly in MPFR and MPC too.)
- Change "Runtime Library" to "Multi-threaded DLL /MD".
- Change "Buffer Security Check" to "No".
Select "Build"
- Ignore preinv* warnings (I think)
- Ignore *_ux and *_sx warnings if using v90 toolset (i.e. VS2008).

Compiling MPFR
==============

Start Visual Studio 2010 and open c:\src\mpfr\build.vc10\lib_mpfr.sln.
Select "Release" and "Win32"
Open "lib_mpfr" properties
- Change "Platform Toolset: if needed.
- Change settings to match MPIR except "Enable Fiber-Safe Optimizations" should
  be set.
Select "Build"

Select "Release" and "x64"
Open "lib_mpfr" properties
- Change "Platform Toolset: if needed.
- Change settings to match MPIR except "Enable Fiber-Safe Optimizations" should
  be set.
Select "Build"

Compiling MPC
=============

Start Visual Studio 2010 and open c:\src\mpfr\build.vc10\mpc.sln.
Select "Release" and "Win32"
Open "mpc_lib" properties
- Change "Platform Toolset: if needed.
- Change remaining settings to match MPIR.
Select "Build"

Select "Release" and "x64"
Open "lib_mpfr" properties
- Change "Platform Toolset: if needed.
- Change remaining settings to match MPIR.
Select "Build"

Copy the library files
======================

The header files will be copied c:\src\BB\vsNNNN\include and the library files
will be copied to c:\src\BB\vsNNNN\lib where BB is 32 or 64, and NNNN is 2008
or 2010.

32-bit, VS 2008

cd c:\src
xcopy /y c:\src\mpir\lib\Win32\Release\*.h c:\src\32\vs2008\include\
xcopy /y c:\src\mpir\lib\Win32\Release\*.lib c:\src\32\vs2008\lib\
xcopy /y c:\src\mpfr\lib\Win32\Release\*.h c:\src\32\vs2008\include\
xcopy /y c:\src\mpfr\lib\Win32\Release\*.lib c:\src\32\vs2008\lib\
xcopy /y c:\src\mpc\lib\Win32\Release\*.h c:\src\32\vs2008\include\
xcopy /y c:\src\mpc\lib\Win32\Release\*.lib c:\src\32\vs2008\lib\

64-bit, VS 2008

cd c:\src
xcopy /y c:\src\mpir\lib\x64\Release\*.h c:\src\64\vs2008\include\
xcopy /y c:\src\mpir\lib\x64\Release\*.lib c:\src\64\vs2008\lib\
xcopy /y c:\src\mpfr\lib\x64\Release\*.h c:\src\64\vs2008\include\
xcopy /y c:\src\mpfr\lib\x64\Release\*.lib c:\src\64\vs2008\lib\
xcopy /y c:\src\mpc\lib\x64\Release\*.h c:\src\64\vs2008\include\
xcopy /y c:\src\mpc\lib\x64\Release\*.lib c:\src\64\vs2008\lib\

32-bit, VS 2010

cd c:\src
xcopy /y c:\src\mpir\lib\Win32\Release\*.h c:\src\32\vs2010\include\
xcopy /y c:\src\mpir\lib\Win32\Release\*.lib c:\src\32\vs2010\lib\
xcopy /y c:\src\mpfr\lib\Win32\Release\*.h c:\src\32\vs2010\include\
xcopy /y c:\src\mpfr\lib\Win32\Release\*.lib c:\src\32\vs2010\lib\
xcopy /y c:\src\mpc\lib\Win32\Release\*.h c:\src\32\vs2010\include\
xcopy /y c:\src\mpc\lib\Win32\Release\*.lib c:\src\32\vs2010\lib\

64-bit, VS 2010

cd c:\src
xcopy /y c:\src\mpir\lib\x64\Release\*.h c:\src\64\vs2010\include\
xcopy /y c:\src\mpir\lib\x64\Release\*.lib c:\src\64\vs2010\lib\
xcopy /y c:\src\mpfr\lib\x64\Release\*.h c:\src\64\vs2010\include\
xcopy /y c:\src\mpfr\lib\x64\Release\*.lib c:\src\64\vs2010\lib\
xcopy /y c:\src\mpc\lib\x64\Release\*.h c:\src\64\vs2010\include\
xcopy /y c:\src\mpc\lib\x64\Release\*.lib c:\src\64\vs2010\lib\

32-bit, VS 2015

cd c:\src
xcopy /y c:\src\mpir\lib\Win32\Release\*.h c:\src\32\vs2015\include\
xcopy /y c:\src\mpir\lib\Win32\Release\*.lib c:\src\32\vs2015\lib\
xcopy /y c:\src\mpfr\lib\Win32\Release\*.h c:\src\32\vs2015\include\
xcopy /y c:\src\mpfr\lib\Win32\Release\*.lib c:\src\32\vs2015\lib\
xcopy /y c:\src\mpc\lib\Win32\Release\*.h c:\src\32\vs2015\include\
xcopy /y c:\src\mpc\lib\Win32\Release\*.lib c:\src\32\vs2015\lib\

64-bit, VS 2015

cd c:\src
xcopy /y c:\src\mpir\lib\x64\Release\*.h c:\src\64\vs2015\include\
xcopy /y c:\src\mpir\lib\x64\Release\*.lib c:\src\64\vs2015\lib\
xcopy /y c:\src\mpfr\lib\x64\Release\*.h c:\src\64\vs2015\include\
xcopy /y c:\src\mpfr\lib\x64\Release\*.lib c:\src\64\vs2015\lib\
xcopy /y c:\src\mpc\lib\x64\Release\*.h c:\src\64\vs2015\include\
xcopy /y c:\src\mpc\lib\x64\Release\*.lib c:\src\64\vs2015\lib\

Compile gmpy2
=============

c:\32\Python26\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2008 bdist_wininst
c:\32\Python27\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2008 bdist_wininst
c:\32\Python33\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2010 bdist_wininst
c:\32\Python34\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2010 bdist_wininst
c:\32\Python35\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2015 bdist_wininst
c:\32\Python36\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2015 bdist_wininst
c:\32\Python37\python.exe setup.py build_ext --force --mpir --static=c:\src\32\vs2015 bdist_wininst

c:\64\Python26\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2008 bdist_wininst
c:\64\Python27\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2008 bdist_wininst
c:\64\Python33\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2010 bdist_wininst
c:\64\Python34\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2010 bdist_wininst
c:\64\Python35\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2015 bdist_wininst
c:\64\Python36\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2015 bdist_wininst
c:\64\Python37\python.exe setup.py build_ext --force --mpir --static=c:\src\64\vs2015 bdist_wininst




