Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] "error: package directory 'onnxruntime/backend' does not exist" on MacOS/arm64 #22942

Closed
bluejack opened this issue Nov 25, 2024 · 3 comments
Labels
build build issues; typically submitted using template platform:web issues related to ONNX Runtime web; typically submitted using template

Comments

@bluejack
Copy link

bluejack commented Nov 25, 2024

Describe the issue

Using the documentation here:

https://onnxruntime.ai/docs/build/inferencing.html

I want to build a python wheel with custom code.

I run the macos build process without problem; all tests succeed.

I install protobufs, as directed.

I execute:

export ONNX_ML=1
python3 setup.py bdist_wheel

And then it fails with:

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

Which it does not.

That directory structure:

ReformatSource.ps1         lora
ReformatSourcePython.bat   python
VSCodeCoverage.runsettings test
__init__.py                tool
contrib_ops                wasm
core

Urgency

No response

Target platform

MacOs ARM

Build script

./build.sh --config RelWithDebInfo --build_shared_lib --parallel --compile_no_warning_as_error --skip_submodule_sync --cmake_extra_defines CMAKE_OSX_ARCHITECTURES=arm64

Followed by:

export ONNX_ML=1
python3 setup.py bdist_wheel

Error / output

running bdist_wheel
running build
running build_py
copying onnxruntime/__init__.py -> build/lib/onnxruntime
error: package directory 'onnxruntime/backend' does not exist

Visual Studio Version

No response

GCC / Compiler Version

Apple clang version 15.0.0 (clang-1500.3.9.4) Target: arm64-apple-darwin23.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@bluejack bluejack added the build build issues; typically submitted using template label Nov 25, 2024
@github-actions github-actions bot added the platform:web issues related to ONNX Runtime web; typically submitted using template label Nov 25, 2024
@bluejack
Copy link
Author

I am trying a similar build on linux to see if the problem is me being stupid or osmething about the macos build process.

@fs-eire fs-eire removed the platform:web issues related to ONNX Runtime web; typically submitted using template label Nov 26, 2024
@fs-eire fs-eire changed the title [Build] [Build] "error: package directory 'onnxruntime/backend' does not exist" on MacOS/arm64 Nov 26, 2024
@github-actions github-actions bot added the platform:web issues related to ONNX Runtime web; typically submitted using template label Nov 26, 2024
@skottmckay
Copy link
Contributor

--build_wheel will build the wheel. It will be in the dist directory under the build output directory.

I'd also suggest using --arm64 instead of doing that via CMAKE_OSX_ARCHITECTURES.

@bluejack
Copy link
Author

bluejack commented Nov 26, 2024

--build_wheel will build the wheel. It will be in the dist directory under the build output directory.

I'd also suggest using --arm64 instead of doing that via CMAKE_OSX_ARCHITECTURES.

Thanks Skott.

Note that --build_wheel fails all the python tests, but DOES build a successful wheel for RelWithDebInfo ; but does not build a successful wheel for Release

I guess that's progress?

UPDATE -- the tests failing was user error; retrying the Release version now to see if that was user error also. If so, I will close this issue & appreciate the guidance Skott McKay!

UPDATE: yes, it is building correctly now. On to the next thing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template platform:web issues related to ONNX Runtime web; typically submitted using template
Projects
None yet
Development

No branches or pull requests

3 participants