Skip to content

Fix pkgconfig issues in the official binary releases - #32328

Open
Nirbheek Chauhan (nirbheek) wants to merge 2 commits into
microsoft:mainfrom
nirbheek:release-pcfile
Open

Fix pkgconfig issues in the official binary releases#32328
Nirbheek Chauhan (nirbheek) wants to merge 2 commits into
microsoft:mainfrom
nirbheek:release-pcfile

Conversation

@nirbheek

Copy link
Copy Markdown

Description

includedir and prefix needed changing in the libonnxruntime.pc file when included in the official binary release. The commit messages describe the two changes that were needed.

Motivation and Context

You cannot consume the official binary releases using pkgconfig, since the include dir was wrong and the prefix was hard-coded.

Copilot AI balanced review requested due to automatic review settings August 30, 2026 06:49
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates official binary packaging to make libonnxruntime.pc match the packaged directory layout and support relocation.

Changes:

  • Rewrites the pkg-config include directory.
  • Replaces the hard-coded installation prefix with a relative prefix.
Suppressed comments (1)

tools/ci_build/github/linux/copy_strip_binary.sh:25

  • pcfiledir is the directory containing this file (<archive>/lib/pkgconfig), not the archive root. Since the template derives libdir and includedir from prefix, this value expands them to nonexistent lib/pkgconfig/lib and lib/pkgconfig/include paths. Go up two levels so the generated flags resolve within the extracted package.
sed -i.bak 's|^prefix=.*|prefix=${pcfiledir}|' "$ARTIFACT_NAME/lib/pkgconfig/libonnxruntime.pc"

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/ci_build/github/linux/copy_strip_binary.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread tools/ci_build/github/linux/copy_strip_binary.sh
copy_strip_binary.sh moves the includes from include/onnxruntime to
include, and the libdir from lib64 to lib, but it wasn't updating the
pc file to match.
The prefix was being hard-coded to /usr/local. Change it to
${pcfiledir} which makes it relocatable.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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