This page describes the simplest way to cross-build the OpenVisualizer simulation module for a Windows host from a Debian Linux x86_64 (64-bit) host. The cross-build supports both 32-bit (x86) and 64-bit (x86_64) Windows hosts. We base the build on the MinGW-w64 toolchain. We also incorporated the script from the SCons CrossCompilingMingw page as 'site_scons/site_tools/crossMingw64.py'.
To get started, first install the mingw-w64 distro package.
Rather than cross-compile Python, as we did for the x86-linux cross-build, we simply extract the shared library and include files from Python's Windows installer. Alternatively, we could build from source using the python-a-mingw-us project.
To extract from the installer:
$ 7z e ../python-2.7.6.msi python && 7z e python *.h python*.dll
With the Python library and headers in place, we now can build the simulation module. We must specify the architecture for the build, and the location of the extracted Python files. The example command line below provides an x86_64 build, where the Python files for that architecture were placed in ~/opt/python-win64.
$ scons board=python toolchain=gcc simhost=amd64-windows simhostpy=~/opt/python-win64 oos_openwsn |
The resulting library, 'oos_openwsn.pyd', is in the 'firmware/openos/projects/common' directory.