-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Bug]: Build break in LLVM v19 #3045
Comments
I've just tried to build dlib and
|
I am using Emscripten v4.0.0 to build ONNXRuntime, while dlib is an indirect dependency. I checked the toolset version. The LLVM binaries version is 322eb1a92e6d4266184060346616fa0dbe39e731: The versions of compiler-rt, libcxx, libcxxabi, and libunwind is 19.1.6 according to ChangeLog. Full build log is here. |
I am new here, any help which I can provide? |
If you would like to help, please follow the steps below:
The DLib source will be located at You should be able to see the build error. Please let me know if you have any questions regarding setting up environment. |
@fs-eire hey thanks for the steps, I will take a look today and get back .. |
Hi ! 🙂 Getting the same issue here while trying the following with Emscripten
Which gives
I tried rolling back the repo to the last commit where i tried this and it worked 44689c1, but this seems to fail as well with the same errors. So I believe this issue is related to Emscripten. |
@michel-mexique do you mean that an older version of emscripten can compile dlib successfully, or do you mean that emscripten v4.0.1 can compile an older version of dlib successfully? |
I failed to compile an older version of dlib (that worked before) on the latest version of emscripten so maybe try rolling back versions of emscripten ? |
This is expected. I think latest EMSDK uses newer LLVM so this is why it fails. The reason in one sentence is: dlib uses You can check the description of this issue for more details. |
Yes seems to be related to release of emscripten 4.0.0 on Jan 14. Will roll back to 3.1.74. Thank you ! |
Well, latest dlib compiles on emscripten 3.1.74. No idea how to fix this long term but that will do for today. |
Rolling back the version to 3.1.74 is not a "fix". It is a "workaround", but unfortunately this workaround does not work for me. I need to use latest EMSDK in onnxruntime build, because version v4.0.1 contains a compiler fix that is needed in onnxruntime. In my understanding, a correct fix should be updating the code of I know this may not be easy to fix and WebAssembly may be not considered as a very important usage for dlib. But eventually this need to be fixed, as future version of other compiler may deprecate it too. |
You can probably just find/replace it to |
I tried that, but as explained in the issue summary:
It is not easy as a one liner. |
### Description Upgrade EMSDK to v4.0.3 ### File Size Comparison: Baseline: e666503 [[Build]](https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1613209) This change: bb9f747 [[Build]](https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1613180) |File | Baseline | This Change | Diff | |--|--|---|---| | ort-wasm-simd-threaded.jsep.mjs | 49,240 | 44,230 | -5,010 | | ort-wasm-simd-threaded.jsep.wasm | 22,921,505 | 21,236,866 | -1,684,639 | | ort-wasm-simd-threaded.mjs | 25,539 | 20,890 | -4,649 | | ort-wasm-simd-threaded.wasm | 11,771,161 | 10,942,193 | -828,968 | | ort.min.mjs | 345,608 | 345,608 | 0 | | ort.bundle.min.mjs | 392,960 | 388,426 | -4,534 | ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> - EMSDK 3.1.62-3.1.74 is not working because of an linker issue (wasm-ld) that causes out-of-memory or crash. - EMSDK > 3.1.69 requires a change as a post-process of the generated JS file otherwise it will fails onnxruntime-web (as a NPM package) to be consumed in user's web application because of an unexpected webpack behavior. - EMSDK >= 4.0.1 fixes the out-of-memory issue but brought new issues causes build break of an indirect dependency of ORT (ORT -> ORT-extensions -> dlib). - EMSDK 4.0.3 introduces a change that allows a previous workaround to be removed. In this PR, all of the above issues are addressed: - the linker issue (wasm-ld) is fixed in 4.0.1+ - the post-process is added in `onnxruntime_webassembly.cmake` as a `POST_BUILD` event of target `onnxruntime_webassembly`. It's done by a Node.js script that uses Regex match and replace. - `dlib` not working with EMSDK v4: - the issue is tracked at davisking/dlib#3045 - Currently no active user is using ORT extension. In this PR, removed ORT extension from the build. - file `gen_struct_info.py` is moved from `${DAWN_EMSCRIPTEN_TOOLCHAIN}/tools/maint` to `${DAWN_EMSCRIPTEN_TOOLCHAIN}/tools`. This helped to remove the patch.tgz for emscripten. This change also requires a change in Dawn, so patched the change needed for Dawn in this PR.
|
Nice, thanks. PR looks good. Running CI on it now. |
What Operating System(s) are you seeing this problem on?
Other (plase, specify in the Steps to Reproduce)
dlib version
19.24.6
Python version
No response
Compiler
clang 19
Expected Behavior
Build pass.
Current Behavior
in unicode/unicode.h,
unichar
is defined touint32
, andstd::char_traits<unichar>
is used but the template instantiation failed because LLVM libc++ v19 deprecated this behavior:https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals
Simply replacing
using unichar = uint32;
tousing unichar = char32_t;
does not fix this build error because it causes other code to fail (eg serialize.h)Steps to Reproduce
Build with Clang 19
Anything else?
No response
The text was updated successfully, but these errors were encountered: