diff options
author | Jose <jose@zeroc.com> | 2016-02-26 20:46:27 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-02-26 20:46:27 +0100 |
commit | 62cba8cd46a535585a4422daab489f114feab6f3 (patch) | |
tree | c77e9cec24a570b06024a3c6a1552b8e6eb20ec6 /python/BuildInstructionsWindows.md | |
parent | updating changelog for ICE-6844 (diff) | |
download | ice-62cba8cd46a535585a4422daab489f114feab6f3.tar.bz2 ice-62cba8cd46a535585a4422daab489f114feab6f3.tar.xz ice-62cba8cd46a535585a4422daab489f114feab6f3.zip |
Windows msbuild build updates
Diffstat (limited to 'python/BuildInstructionsWindows.md')
-rw-r--r-- | python/BuildInstructionsWindows.md | 90 |
1 files changed, 62 insertions, 28 deletions
diff --git a/python/BuildInstructionsWindows.md b/python/BuildInstructionsWindows.md index 50e5f209ba5..cda472622e8 100644 --- a/python/BuildInstructionsWindows.md +++ b/python/BuildInstructionsWindows.md @@ -12,52 +12,85 @@ Ice for Python is expected to build and run properly on Windows and was extensively tested using the operating systems and compiler versions listed for our [supported platforms][2]. +The build requires the [Ice Builder for Visual Studio][8], you must install +version 4.2.0 or greater to build Ice. + ### Python Versions -Ice for Python supports Python versions 2.6, 2.7, 3.3 or 3.4. Note however that -your Python installation must have been built with a C++ compiler that is +Ice for Python supports Python versions 2.6, 2.7, 3.3, 3.4 or 3.5. Note however +that your Python installation must have been built with a C++ compiler that is compatible with the one used to build Ice for C++. -### Ice Development Kit - -You will need the Ice development kit for C++, which you can install as a binary -distribution or compile from source yourself. - ## Building the Python Extension The Python interpreter is readily available on Windows platforms. You can build it yourself using Microsoft Visual C++, or obtain a binary distribution from the -Python web site. The Python 3.4.x binary distribution is compiled with Visual -C++ 10, and you should use this binary distribution if you want to compile the -Ice extension with Visual C++ 10. +Python web site. The Python 3.5.x binary distribution is compiled with Visual +C++ 14, and you should use this binary distribution if you want to compile the +Ice extension with Visual C++ 14. + +Open a command prompt for example, when using Visual Studio 2015, you have +several alternatives: + +- VS2015 x86 Native Tools Command Prompt +- VS2015 x64 Native Tools Command Prompt -Open a command prompt that supports command-line compilation with Visual C++. -For example, you can execute the Visual C++ batch file `vcvars32.bat` to -configure your environment. Alternatively, you can start a Visual Studio Command -Prompt by selecting the appropriate entry from the Visual Studio program group -in your Start menu. +Using the first configurations produces 32-bit binaries, while the second +configurations produce 64-bit binaries. Change to the Ice for Python source subdirectory: > cd python -If you have not built Ice for C++ from the `cpp` subdirectory, set `ICE_HOME` -to the directory of your Ice for C++ installation. For example: +You must built Ice for C++ from the `cpp` subdirectory, if you have not done so +review cpp\BuildInstructionsWindows.md first. + +Building the extension: + + > MSbuild msbuild\ice.proj + +This will build the extension in `Release` configuration and using the command +prompt default platform, for `x64` platform the extension will be placed in +`python\x64\Release\IcePy.pyd` and for `Win32` platform the extension will be +paced in `python\Win32\Release\IcePy.pyd`. + +If you want to build a debug version of the extension you can to so by setting +the MSBuild `Configuration` property to `Debug`: - > set ICE_HOME=C:\Ice + > MSbuild msbuild\ice.proj /p:Configuration=Debug -Edit `config\Make.rules.mak` and review the settings. In particular you must set -`CPP_COMPILER` to the appropriate compiler. +The debug version of the extension for `x64` platform will be placed in +`python\x64\Debug\IcePy_d.pyd` and for `Win32` platform it will be placed in +`python\Win32\Debug\IcePy_d.pyd`. -Run nmake: +> *For Debug builds a debug version of the Python interpreter must be installed.* - > nmake /f Makefile.mak +The supported values for the `Configuration` property are `Debug` and `Release`. -Upon completion, the Ice extension is created as `python\IcePy.pyd`. +If you wan to build the extension for other platform that the command prompt default +platform, you need to set the MSbuild `Platform` property, the supported values for +this property are `Win32` and `x64`. -> *Normally you should build with `OPTIMIZE=yes`. If you wish to build a debug -version of the Ice extension, set `OPTIMIZE=no`. In this case, you will also -need to build a debug version of the Python interpreter from sources.* +The following command will build the extension `x64` platform binaries with `Release` +configuration: + + > MSbuild msbuild\ice.proj /p:Configuration=Release /p:Platform=x64 + +And the next command will build the extension `Win32` platform binaries with `Release` +configuration: + + > MSbuild msbuild\ice.proj /p:Configuration=Release /p:Platform=Win32 + +> *When using the MSBuild Platform property the build platform doesn't depend on the +command prompt default platform* + +The build will use a default Python location defined in `python\msbuild\ice.props`, +it can be override by setting the `PythonHome` MSBuild property. + +The following command will use Python installation from `C:\Python35-AMD64` instead of +the default location: + + > MSbuild msbuild\ice.proj /p:Configuration=Release /p:Platform=x64 /p:PythonHome=C:\Python35-AMD64 ## Configuring your Environment for Python @@ -68,13 +101,14 @@ setting the `PYTHONPATH` environment variable to contain the necessary subdirectory. For example, if the Ice for Python extension is installed in `C:\Ice`, you could configure your environment as follows: - > set PYTHONPATH=C:\Ice\python + > set PYTHONPATH=C:\Ice\python;C:\Ice\python\Win32\Release + ## Running the Python Tests After a successful build, you can run the tests as follows: - $ python allTests.py + $ python allTests.py --mode=Release --x86 If everything worked out, you should see lots of `ok` messages. In case of a failure, the tests abort with `failed`. |