ort-builder icon indicating copy to clipboard operation
ort-builder copied to clipboard

MSVC Debug Build, Win Build System & opt. onnxruntime v1.6.2

Open timbencker opened this issue 2 years ago • 5 comments

Hey, thank you very much for the repository, has been really helpful!

Since the static linking of minSizeRelease to a debug build doesn't work for MSVC, I've been working on a Debug Build for Windows. and created a build system for windows which automates all required steps and additionally provides options to build:

  • 1.16.2 / 1.14.1 in MinSizeRel or Debug

It also:

  • Checks if the Python version is compatible with the selected ONNX Runtime version and, if not, prompts the user for an alternative Python path.
  • Downloads and extracts the chosen ONNX Runtime version, if not already present.
  • Creates and activates a Python virtual environment for the build process.
  • Then triggers the build process for the chosen ONNX Runtime version, with the specified build type (Debug or MinSizeRel).

For the build process itself, I've created an additional build-win_debug.bat and renamed build_win.bat to build-win_minSizeRel.bat.

Since different files will be created depending on the ONNX Runtime version and build type:

  • Instead of extracting to /onnxruntime/, I extract to /onnxruntime-1.16.2/ so users can test different onnxruntime versions.
  • And export the libraries to: .\win-libs\%ONNXRT_FOLDER%-win-x86_64_%CMAKE_BUILD_TYPE%.lib (ONNXRT_FOLDER being either onnxruntime-1.14.1 or onnxruntime-1.16.2)

This makes switching the onnxruntime.lib version in the Plugin CMake pretty easy, but differs from the way you have set up the onnxruntime folder/output libraries currently.

I thought I'd check in about how you would approach this or prefer it to be set up, before I make a pull request.

timbencker avatar Nov 19 '23 19:11 timbencker

This all sounds good to me! Please make a PR and we'll take it from there

olilarkin avatar Nov 24 '23 16:11 olilarkin

Excellent! Im pretty busy with work right now, but will try to make a pr next week :)

timbencker avatar Dec 02 '23 18:12 timbencker

as you probably saw i just updated the macOS scrips

olilarkin avatar Dec 02 '23 18:12 olilarkin

Perhaps a single script with an argument for the CMake build config would be preferable than two.

olilarkin avatar Dec 02 '23 18:12 olilarkin

Hey, I think i've actually done most of the needed stuff here:

https://github.com/olilarkin/ort-builder/commit/75941a43af10985c3dd0ce37b3a90a37a6207509

olilarkin avatar Dec 02 '23 23:12 olilarkin