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

Fix Build Failure Due to Nsync Not Being Found Correctly #20980

Closed
wants to merge 1 commit into from

Conversation

jordanozang
Copy link

Description

When fetching nsync via FetchContent_Declare, force it to be downloaded instead of attempting to find an installed CMake package first.

Motivation and Context

While nsync 1.26 and lower did not export CMake targets, versions from 1.27 onwards do. Also, some package maintainers chose to create CMake targets as part of their distribution for previous versions. If these are installed on the user's system, onnxruntime will currently fail to build. This is because onnxruntime is incompatible with these targets and instead expects the library to be provided as a subdirectory in the _deps folder. Preventing cmake from searching system paths for the targets solves this build failure.

This is the error I was getting:

CMake Error at onnxruntime.cmake:225 (target_link_libraries):
  Target "onnxruntime" links to:

    nsync::nsync_cpp

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

I think the planned solution had been #20413, but it looks like it was too difficult to remove nsync without affecting existing functionality.

@snnn
Copy link
Member

snnn commented Jun 10, 2024

I will remove this dependency by the next release (1.19.0)

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