You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a cross-platform project, where I have to build ORT 1.15.1 from source on both Windows x64 and Linux AMD64.
ORT build process went smoothly on both platforms without any issues, however, I had an issue on Ubuntu 22.04 when tried to build a benchmark executable that was meant to test the ORT C++ API:
On windows x64 the executable ran successfully.
On Ubuntu 22.04 (GCC 11.4) the linker raised the following error:
[100%] Linking CXX executable ../../../onnxbenchmark
/usr/bin/ld: warning: libre2.so.9, needed by /home/mustafa/tmp/install/lib/libonnxruntime.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /home/mustafa/tmp/install/lib/libonnxruntime.so: undefined reference to `re2::RE2::RE2(re2::StringPiece const&, re2::RE2::Options const&)'
/usr/bin/ld: /home/mustafa/tmp/install/lib/libonnxruntime.so: undefined reference to `re2::RE2::~RE2()'
/usr/bin/ld: /home/mustafa/tmp/install/lib/libonnxruntime.so: undefined reference to `re2::RE2::Match(re2::StringPiece const&, unsigned long, unsigned long, re2::RE2::Anchor, re2::StringPiece*, int) const'
collect2: error: ld returned 1 exit status
make[2]: *** [apps/tools/onnxbenchmark/CMakeFiles/onnxbenchmark.dir/build.make:151: onnxbenchmark] Error 1
make[1]: *** [CMakeFiles/Makefile2:2920: apps/tools/onnxbenchmark/CMakeFiles/onnxbenchmark.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
When I checked the build tree of ORT on Windows, src/built-artifacts of re2 were in BUILD_DIR/onnxruntime/build/_deps, however, in the build tree on Ubuntu none of them was there.
Moreover, when I checked the ORT build log on Ubuntu, it turned out that re2 is not populated like the other deps even though it's present in onnxruntime-src/cmake/deps.txt: load_ort_deps_ubuntu_2204.txt
Finds a pre-installed re2 in /home/mustafa/anaconda3/lib/cmake/re2, but still wondering why pre-installed deps didn't link successfully unlike deps built from source
Finding re2 explicitly find_package(re2 REQUIRED) and link it against my executable target_link_libraries(EXEC re2::re2) solved my issue.
But is it meant to be like that? I mean should ORT users track the build log and figure out what pre-installed 3d-party deps were used when building ORT from source and link them manually against all targets that use ORT?
By default ORT prefers to pick up the libs that have been preinstalled in the library. However, in many cases(especially with anaconda) the installed lib might be broken. In these cases, users need to build ONNX runtime with FETCHCONTENT_TRY_FIND_PACKAGE_MODE=NEVER
Describe the issue
I'm working on a cross-platform project, where I have to build ORT 1.15.1 from source on both Windows x64 and Linux AMD64.
ORT build process went smoothly on both platforms without any issues, however, I had an issue on Ubuntu 22.04 when tried to build a benchmark executable that was meant to test the ORT C++ API:
When I checked the build tree of ORT on Windows, src/built-artifacts of
re2
were inBUILD_DIR/onnxruntime/build/_deps
, however, in the build tree on Ubuntu none of them was there.Moreover, when I checked the ORT build log on Ubuntu, it turned out that
re2
is not populated like the other deps even though it's present inonnxruntime-src/cmake/deps.txt
:load_ort_deps_ubuntu_2204.txt
Urgency
No response
Target platform
Linux AMD64
Build script
Error / output
Visual Studio Version
VS2019
GCC / Compiler Version
11.4
The text was updated successfully, but these errors were encountered: