ortex icon indicating copy to clipboard operation
ortex copied to clipboard

Missing onnxruntime on Mac stops build

Open mwhitworth opened this issue 1 year ago • 3 comments

After the upgrade to ort-2.0.0-rc.0 (d00092f), building on an Intel Mac results in:

== Compilation error in file lib/ortex/native.ex ==
** (File.CopyError) could not copy from "/Users/mwhitworth/personal/ortex/_build/dev/lib/ortex/priv/native/libonnxruntime.so" to "/Users/mwhitworth/personal/ortex/_build/dev/lib/ortex/priv/native/libonnxruntime.so.1.17.0": no such file or directory

It appears - even though copy-dylibs is a feature automatically set on ort now, that no such file exists in the directory

mwhitworth avatar Jun 01 '24 08:06 mwhitworth

This might be fixed by one or more of the commits in https://github.com/elixir-nx/ortex/pull/28

mwhitworth avatar Jun 01 '24 08:06 mwhitworth

As a workaround, from https://github.com/elixir-nx/ortex/pull/28/commits/4352926261df5ab74a65cf0b59db53f14fdb50a8 - adding:

"-C", "link-arg=-fapple-link-rtlib",

to the linker flags in native/.ortex/.cargo/config.toml, and commenting out Ortex.Util.copy_ort_libs ensures all tests pass

mwhitworth avatar Jun 01 '24 09:06 mwhitworth

We've been tracking this in main, unfortunately it's caused by a change in how upstream ort downloads the libraries on build (as you noticed). We've decided to wait until ort has stabilized on their 2.0 API changes before making the necessary changes since there's been some thrash in the 2.0rc releases.

Long term, I think we'll bring libonnxruntime downloading into ortex (along with rustler precompiled binaries) to have more control over which versions are built and fetched.

I'll leave this ticket open until those changes are made, but anyone who comes across this issue (and needs features in ortex main) can follow the same steps you outlined here and from the #28.

mortont avatar Jun 03 '24 21:06 mortont

We've fixed this in main, going to close this issue but if it didn't solve your issue feel free to reopen.

mortont avatar Nov 19 '24 18:11 mortont