Skip to content

[BUILD] OIIO Windows Build System Maintainer #3816

Description

@robinrowe
  • OIIO Windows Maintainer Build Notes *

These notes are for the OIIO Windows maintainer (Robin Rowe) for making improvements and fixes to build system. To document what we're doing. If you have suggestions for Windows build improvements, you may add them to this ticket.

** Overview **

We build on Windows and CI test on Windows -- though just one entry in the test matrix is Windows, it doesn't include all dependencies and so lots of features probably go untested, so some beefing up to do there. Build all dependencies. More CI matrix cases to cover other compiler versions.

** Windows Maintainer Instructions **

Go to https://github.com/OpenImageIO/oiio and "watch" the project, to get email alerts as PRs and Issues are filed. And the OIIO mail list: http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Build from source on Windows has many issues with documentation at https://github.com/OpenImageIO/oiio/blob/master/INSTALL.md
It's wrong and outdated. The Windows section needs a complete rewrite once we settle on the best strategy for building dependencies.

In general, the OIIO build scripts work really well and do cross-platform builds. It assumes that all the major dependencies are already installed and accessible, so automating downloading and building dependencies is a goal. Perhaps using cmaker DownloadProject.

Also see https://stackoverflow.com/questions/37091735/building-openimage-io-on-windows

** Windows Package Management **

An issue that comes up all the time is that it's a big pain for inexperienced users to build for Windows, mostly because there are lots of dependencies to cover the many image formats. One cheat is that it's in VcPkg, so if you're already on the VcPkg train, you can just rely on that. But it's harder if you want to build a different version than is in VcPkg, or build with different options, or do development on it. So building from scratch instead of dependencies is still really awkward -- surely some set of much better step by step instructions, or maybe some auxiliary scripts that can largely automate the dependency downloads and builds, would go a long, long way. Without a windows box (or expertise) of my own, I'm just not the one to even evaluate whether beefed up install instructions are hitting the right marks for typical Windows users. I don't know if it's practical or wise, but many people want OIIO but don't really even wish to build from scratch if not necessary, so it may be at least worth thinking about whether it makes sense to host a pre-built binary of major releases?

DownloadProject with cmaker tweaks:

https://gitlab.com/robinrowe/cmaker/-/tree/master/cmaker_lib/DownloadProject

Not yet integrated with cmaker. Plan is that there will be a cmaker command such:

    $ cd my_project_directory
    $ cmaker_depends.sh zlib libjpeg libpng

And that will be all we need to configure our project's cmake build system to fetch and build the relevant 3rd party libs. Magic.

Cmaker DownloadProject will cache per git tag or tarball URL. Won't download what it already has. Then cmake will then detect what is already built, not rebuild lib. What happens if pulling git master for a lib, where sources change? After downloading dependencies, we may switch into Airplane Mode and work disconnected until we tell DownloadProject to check whether dependency sources have changed (by deleting a special generated build file, much like deleting CMakeCache.txt to force recompile).

If cmaker doesn't seem the best approach to downloading and installing dependencies, there's also https://github.com/cpp-best-practices/cmake_template with using CPM https://github.com/cpm-cmake/CPM.cmake. The OIIO project has several hand-crafted bash scripts for doing download/build for CI (or for users) at https://github.com/OpenImageIO/oiio/tree/master/src/build-scripts. Not well tested on Windows.

** Windows Testing and Debugging **

Windows maintainer to monitor:

(a) the PRs, just skimming and being on the lookout for if any of the developers are doing things that seem unwise for windows in particular but don't know it. Maybe we pass CI, but are still digging a hole for ourselves that we don't see because OIIO are primarily Linux users.

(b) issue and mail list triage where users are asking about specific Windows build or to overcome problems to tell them how to get unstuck.

Robin Rowe, April 22nd, 2023

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions