onnxruntime fails to build on amd64 and arm64

Bug #2092286 reported by Mateus Rodrigues de Morais
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
onnxruntime (Ubuntu)
Fix Released
Undecided
Mateus Rodrigues de Morais

Bug Description

The package onnxruntime is currently FTBFS on amd64 and arm64.

```
[980/991] : && /usr/bin/c++ -g -O3 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/onnxruntime-1.19.2+dfsg-2 -Wdate-time -D_FORTIFY_SOURCE=3 -ffunction-sections -fdata-sections -Wno-restrict -DCPUINFO_SUPPORTED -O2 -g -DNDEBUG -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -Wl,-rpath='$ORIGIN' -Wl,--dependency-file=CMakeFiles/onnxruntime_global_thread_pools_test.dir/link.d CMakeFiles/onnxruntime_global_thread_pools_test.dir/<<PKGBUILDDIR>>/onnxruntime/test/global_thread_pools/test_main.cc.o CMakeFiles/onnxruntime_global_thread_pools_test.dir/<<PKGBUILDDIR>>/onnxruntime/test/global_thread_pools/test_inference.cc.o -o onnxruntime_global_thread_pools_test -Wl,-rpath,/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu libonnxruntime_mocked_allocator.a libonnxruntime_test_utils.a libonnxruntime_common.a -lcpuinfo /usr/lib/x86_64-linux-gnu/libgtest.a /usr/lib/x86_64-linux-gnu/libgmock.a libonnxruntime.so.1.19.2 -ldl /usr/lib/x86_64-linux-gnu/libgtest.a /usr/lib/x86_64-linux-gnu/libonnx_proto.so.1 /usr/lib/x86_64-linux-gnu/libprotobuf.so && :
FAILED: onnxruntime_global_thread_pools_test
: && /usr/bin/c++ -g -O3 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/onnxruntime-1.19.2+dfsg-2 -Wdate-time -D_FORTIFY_SOURCE=3 -ffunction-sections -fdata-sections -Wno-restrict -DCPUINFO_SUPPORTED -O2 -g -DNDEBUG -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -Wl,-rpath='$ORIGIN' -Wl,--dependency-file=CMakeFiles/onnxruntime_global_thread_pools_test.dir/link.d CMakeFiles/onnxruntime_global_thread_pools_test.dir/<<PKGBUILDDIR>>/onnxruntime/test/global_thread_pools/test_main.cc.o CMakeFiles/onnxruntime_global_thread_pools_test.dir/<<PKGBUILDDIR>>/onnxruntime/test/global_thread_pools/test_inference.cc.o -o onnxruntime_global_thread_pools_test -Wl,-rpath,/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu libonnxruntime_mocked_allocator.a libonnxruntime_test_utils.a libonnxruntime_common.a -lcpuinfo /usr/lib/x86_64-linux-gnu/libgtest.a /usr/lib/x86_64-linux-gnu/libgmock.a libonnxruntime.so.1.19.2 -ldl /usr/lib/x86_64-linux-gnu/libgtest.a /usr/lib/x86_64-linux-gnu/libonnx_proto.so.1 /usr/lib/x86_64-linux-gnu/libprotobuf.so && :
/usr/bin/ld: libonnxruntime_test_utils.a(file_util.cc.o): in function `testing::internal::FormatForComparison<int, int>::Format[abi:cxx11](int const&)':
/usr/include/gtest/gtest-printers.h:380:(.text._ZN11onnxruntime4test18DeleteFileFromDiskEPKc+0x50): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > testing::PrintToString<int>(int const&)'
/usr/bin/ld: /usr/include/gtest/gtest-printers.h:380:(.text._ZN11onnxruntime4test18DeleteFileFromDiskEPKc+0x5f): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > testing::PrintToString<int>(int const&)'
collect2: error: ld returned 1 exit status
```

Tags: patch
Changed in onnxruntime (Ubuntu):
assignee: nobody → Mateus Rodrigues de Morais (mateus-morais)
status: New → In Progress
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix-amd64-arm64-ftbfs.patch" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Mateus Rodrigues de Morais (mateus-morais) wrote (last edit ):
Revision history for this message
Mateus Rodrigues de Morais (mateus-morais) wrote :

Fixed by disabling LTO and O3 optimization.

PPA test build available at: https://launchpad.net/~mateus-morais/+archive/ubuntu/webrtc-audio-processing

Revision history for this message
Mateus Rodrigues de Morais (mateus-morais) wrote :
Revision history for this message
Simon Quigley (tsimonq2) wrote :

This seems reasonable for Ubuntu, but I'm not sure dpkg has -O3 in Debian. See https://launchpad.net/ubuntu/+source/dpkg/1.22.11ubuntu2 - I'm not the Debian maintainer, but it's somewhat likely it'll be rejected.

No big deal, uploading your change to Ubuntu.

Changed in onnxruntime (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package onnxruntime - 1.19.2+dfsg-2ubuntu1

---------------
onnxruntime (1.19.2+dfsg-2ubuntu1) plucky; urgency=medium

  * d/rules: disable O3 optimization and LTO to fix FTBFS on amd64 and arm64
    (LP: #2092286)

 -- Mateus Rodrigues de Morais <email address hidden> Thu, 19 Dec 2024 15:50:38 -0300

Changed in onnxruntime (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.