added support for cmake "find_package"#8919
Conversation
|
@snnn I have a question are this compile definitions needs to be public? onnxruntime/cmake/CMakeLists.txt Line 1080 in acd9db7 also, in some headers, headers are not included relative to root dir, like: So what should be done about this? |
|
also is this file: eigen_common_wrapper.h is intended to be used by user or this private header as this header file include and there are also this "core/framework/data_transfer.h" "core/framework/allocatormgr.h" "core/framework/prepacked_weights_container.h" "core/framework/TensorSeq.h" "core/framework/config_options.h" "core/framework/session_options.h" "core/common/path.h" "core/platform/ort_mutex.h" "core/platform/threadpool.h" this files which are not exported but included in some headers.
|
e8803ce to
d5dcbb2
Compare
|
"onnxruntime_config.h" is a tricky thing. The idea was borrowed from autoconf, which is quite old. And it assumes that you won't do "build-once, run everywhere" such things. So the content of config.h is based on your current system's configuration. If you won't copy the generated file to another file, then it's totally fine to install it to /usr/include . |
|
ok, and what about other headers, like
|
|
If they need be in the right place, please help us move them. |
|
Why is this closed? I was looking for a proper CMake export. I was going to write it myself but realized this PR already does it. Now this one is closed. Does that mean the project does not want to merge it? |
|
@ongun-kanat i got distracted to some other project, but now I am back and cleaning commits |
|
@snnn Hey I saw now we have a NuGet package with tensorrt support, I wanted to ask right now Cmake install a lot of header files but in the NuGet package, there are only a few, do we want the same number of header in cmake to install as in NuGet or other headers are also useful. |
Is this for static link to onnxruntime or dynamic link? |
|
@snnn Hey, this pr is ready for shared libs. Can you review it or ask someone else to review it if you dont have time. |
|
/azp run Python packaging pipeline |
|
No pipelines are associated with this pull request. |
|
/azp run Zip-Nuget-Java-Nodejs Packaging Pipeline |
|
No pipelines are associated with this pull request. |
|
/azp run Python packaging pipeline |
|
No pipelines are associated with this pull request. |
|
/azp run Zip-Nuget-Java-Nodejs Packaging Pipeline |
|
No pipelines are associated with this pull request. |
|
I don't have enough React Native knowledge to fix these 2 remaining issues. Can anyone help with this? |
It is fine since other jobs have same failure in the React pipeline. I think it is not related to this change. |
Yeah, the react native pipeline is currently failing due to some other checked-in changes. We are working on a fix for that. It's not a required CI, won't affect this pr merge. |
The changes in PR #8919 overwrote the PUBLIC_HEADER property value of the `onnxruntime` target with a list that did not include EP-specific headers. We should probably be using a consistent set of header files across packages anyway.
|
It seems that the target onnxruntime does not contain providers, which causes onnxruntime_providers.dll and onnxruntime_provider_cuda.dll to be lost when copying the target to the root directory. |
|
@QiuYilin Libs of providers should be installed if the "install" target is built in "CMAKE_INSTALL_LIBDIR". Just that the provider's cmake targets are not exported, I initially tried to do it but some of the providers had PUBLIC dependencies which were creating issues. |
|
@prateek9623 can you or someone else please explain, why the header structure had to be changed?.. In But now, since in Do we now have to use something like this in our code: #ifdef ORT_SHARED
# include <onnxruntime/onnxruntime_cxx_api.h>
#else
# include <onnxruntime/core/session/onnxruntime_cxx_api.h>
#endif, or am I missing something? |
The changes in PR microsoft#8919 overwrote the PUBLIC_HEADER property value of the `onnxruntime` target with a list that did not include EP-specific headers. We should probably be using a consistent set of header files across packages anyway.
|
@prateek9623 @snn could the cmake files be added to the tar.gz file so that people can download ort and link to it without having to clone the repo? |
|
I agree with @thiagocrepaldi |

Description:
Adds support for cmake find_package.
Motivation and Context
As mentioned in issue #7150 onnxruntime doesn't have support for CMake find_package, this PR adds that and also adds the CMake package version file. Now anyone can link onnxruntime like this:
this also simplifies 3124