Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 1.81 KB

build_windows.md

File metadata and controls

55 lines (38 loc) · 1.81 KB

Build Python Package on Windows

Prerequisites

Chocolatey

Install chocolatey with instruction in Official page

Then, install required tools with following command.

    choco install cmake git visualstudio2019-workload-vctools visualstudio2019buildtools

Note: Please make sure Microsoft Visual Studio is installed in the path of C:\program files (x86) and the path exists in C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat and C:\Program Files "("x86")"\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin.

Install python3.9.13 or 3.10.8. You can refer to the following command.

    choco install -y python3 --version=3.10.8

We use chocolatey to make the configuration as easy as possible(recommended). If you can't or don't want to use chocolatey, please do so yourself.

Install and set the environment variables appropriately.

Build python package

You can build windows binary with following command.

    git clone https://github.com/sony/nnabla.git
    cd nnabla
    build-tools\msvc\build_cpplib.bat
    build-tools\msvc\build_wheel.bat PYTHON_VERSION

The PYTHON_VERSION we tested is 3.9 and 3.10.

Then you can run test with following.

    build-tools\msvc\test.bat PYTHON_VERSION

FAQ

  • Q. The compiled library and executable run on a compiled PC, but it does not work on another PC.
    • Confirm that the Microsoft Visual C++ 2019 Redistributable is installed on target PC.