microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
13.51k stars 2.76k forks source link

[Build] Unable to build onnxruntime from source (with oneDNN EP) #20971

Open shreya-um opened 1 month ago

shreya-um commented 1 month ago

Describe the issue

Getting error error: package directory 'onnxruntime/backend' does not exist for command python3 setup.py bdist_wheel

Urgency

Urgent, I have deadlines for my Thesis submission.

Target platform

Linux, x86 6bits

Build script

Im trying to build onnxruntime from source Im following commands from https://onnxruntime.ai/docs/build/inferencing.html.

I ran build cmd ./build.sh --use_dnnl --config Release --build_shared_lib --parallel --compile_no_warning_as_error --skip_submodule_sync

Output - 100% tests passed, 0 tests failed out of 7

when I ran cmd python3 setup.py bdist_wheel Im getting error error: package directory 'onnxruntime/backend' does not exist

Error / output

error: package directory 'onnxruntime/backend' does not exist

Visual Studio Version

No response

GCC / Compiler Version

No response

jywu-msft commented 3 weeks ago

try using --build_wheel instead i.e. ./build.sh --use_dnnl --config Release --skip_tests --build_wheel --parallel --compile_no_warning_as_error --skip_submodule_sync

with your commandline above, you needed to build the python bindings with --enable_pybind and then you can build the wheel after that. (but you need to do it in your build directory)

--build_wheel conveniently does both within the build script. so it's easier to run the commandline example I have above. note that --skip_tests skips running tests, so that failing python tests doesn't prevent the build from succeeding.