-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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] re2
not compiled when statically building with onnxruntime_BUILD_UNIT_TESTS=OFF
#22513
Comments
re2
not compiled when statically building with onnxruntime_BUILD_UNIT_TESTS=OFF
I just checked https://github.com/microsoft/onnxruntime/blob/main/cmake/external/onnxruntime_external_deps.cmake, re2 doesn't seem to be optional. It should always get built. Sorry I have no idea how it would happen. |
Do you have more logs? Can you set FETCHCONTENT_TRY_FIND_PACKAGE_MODE to NEVER? |
@snnn Setting FETCHCONTENT_TRY_FIND_PACKAGE_MODE to NEVER seemingly didn't change anything. I also double checked that Here is the entire build log of the original command I posted. Here is the entire build log of the original command I posted without disabling tests. Looking at the explicit dependencies, Can you reproduce the issue? |
I tried the command on Linux(sorry I don't have a Mac machine). It did not have any problem. I noticed that you didn't generate a dynamic onnxruntime lib. So, your application needs to link to all onnxruntime's internal libraries and their dependencies(including re2). That's a lot. |
Could you consider using vcpkg? #21348. If vcpkg works, then it can help build all the dependencies and ensure ORT and your app using the dependency versions. |
Describe the issue
I have compiled
onnxruntime
with the following command (on linux):./build.sh --cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF --config Release --parallel --compile_no_warning_as_error --skip_submodule_sync --update --build --build_dir build/linux
When linking this to a rust library (via ort), there seems to be an issue where, if the flag
--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF
is given,re2
isn't compiled (only when building a static library, apparently, it gets built when building the shared library).Urgency
No response
Target platform
Linux x86_64
Build script
./build.sh --cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF --config Release --parallel --compile_no_warning_as_error --skip_submodule_sync --update --build --build_dir build/linux
Error / output
There is no error at build time, linking downstream fails as described above.
Visual Studio Version
No response
GCC / Compiler Version
No response
The text was updated successfully, but these errors were encountered: