Skip to content
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

[cmake] Export multi targets in static build #11063

Conversation

JackBoosY
Copy link
Contributor

@JackBoosY JackBoosY commented Mar 31, 2022

Description:
Since onnxruntime supports option onnxruntime_BUILD_SHARED_LIB, so I assume this library supports static build, but no libraries are exported in static build. So add the code to export the internal targets(libraries):

  • onnxruntime_common
  • onnxruntime_flatbuffers
  • onnxruntime_framework
  • onnxruntime_graph
  • onnxruntime_mlas
  • onnxruntime_optimizer
  • onnxruntime_session
  • onnxruntime_util
  • onnxruntime_providers_nuphar
  • onnxruntime_providers_vitisai
  • onnxruntime_coreml_proto
  • onnxruntime_providers_coreml
  • onnxruntime_providers_nnapi
  • onnxruntime_providers_rknpu
  • onnxruntime_providers_dml
  • onnxruntime_providers_acl
  • onnxruntime_providers_armnn
  • onnxruntime_providers_tvm
  • onnxruntime_providers

In files:

  • onnxruntime_session.cmake
  • onnxruntime_optimizer.cmake
  • onnxruntime_providers.cmake
  • onnxruntime_framework.cmake
  • onnxruntime_graph.cmake
  • onnxruntime_util.cmake
  • onnxruntime_mlas.cmake
  • onnxruntime_common.cmake
  • onnxruntime_flatbuffers.cmake

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.

@JackBoosY
Copy link
Contributor Author

cc @snnn

I don't know if these targets are enough.

@snnn
Copy link
Member

snnn commented Mar 31, 2022

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, Linux Nuphar CI Pipeline, Linux OpenVINO CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, Windows CPU CI Pipeline

@snnn
Copy link
Member

snnn commented Mar 31, 2022

/azp run Windows GPU CI Pipeline, Windows GPU TensorRT CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, onnxruntime-python-checks-ci-pipeline, orttraining-linux-ci-pipeline, orttraining-linux-gpu-ci-pipeline, orttraining-ortmodule-distributed

@azure-pipelines
Copy link

Azure Pipelines successfully started running 7 pipeline(s).

@azure-pipelines
Copy link

Azure Pipelines successfully started running 9 pipeline(s).

@snnn
Copy link
Member

snnn commented Mar 31, 2022

See: https://github.com/microsoft/onnxruntime/blob/master/cmake/onnxruntime.cmake#L162 . It lists most of our targets. So we have:

  1. onnxruntime_session
  2. onnxruntime_optimizer
  3. onnxruntime_providers
  4. onnxruntime_framework
  5. onnxruntime_graph
  6. onnxruntime_util
  7. onnxruntime_mlas
  8. onnxruntime_common
  9. onnxruntime_flatbuffers

@snnn
Copy link
Member

snnn commented Apr 1, 2022

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, Linux Nuphar CI Pipeline, Linux OpenVINO CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, Windows CPU CI Pipeline

@snnn
Copy link
Member

snnn commented Apr 1, 2022

/azp run Windows GPU CI Pipeline, Windows GPU TensorRT CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, onnxruntime-python-checks-ci-pipeline, orttraining-linux-ci-pipeline, orttraining-linux-gpu-ci-pipeline, orttraining-ortmodule-distributed

@azure-pipelines
Copy link

Azure Pipelines successfully started running 7 pipeline(s).

@azure-pipelines
Copy link

Azure Pipelines successfully started running 9 pipeline(s).

@JackBoosY
Copy link
Contributor Author

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, Linux Nuphar CI Pipeline, Linux OpenVINO CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, Windows CPU CI Pipeline

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 11063 in repo microsoft/onnxruntime

@snnn
Copy link
Member

snnn commented Apr 2, 2022

/azp run Windows GPU TensorRT CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, onnxruntime-python-checks-ci-pipeline, orttraining-linux-ci-pipeline, orttraining-linux-gpu-ci-pipeline, orttraining-ortmodule-distributed

@snnn
Copy link
Member

snnn commented Apr 2, 2022

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, Linux Nuphar CI Pipeline, Linux OpenVINO CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, Windows CPU CI Pipeline, Windows GPU CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@azure-pipelines
Copy link

Azure Pipelines successfully started running 10 pipeline(s).

@snnn snnn merged commit ea004e9 into microsoft:master Apr 4, 2022
@JackBoosY JackBoosY deleted the dev/jack/export-static-targets-in-static-build branch April 6, 2022 02:16
seddonm1 pushed a commit to seddonm1/onnxruntime that referenced this pull request May 15, 2022
* [cmake] Export multi targets in static build

* Install more components in static build, format some code

* Fix code pos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants