microsoft / microsoft/onnxruntime

[Build] Inconsistent naming of lib directories

Open
#23,642 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build contributions welcome
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

Describe the issue

The official release for linux (onnxruntime-linux-x64-xxx.tgz) contains folder 'lib' with .so files. Yet, file lib/cmake/onnxruntime/onnxruntimeTargets-release.cmake refers to this location as 'lib64' in command:

set_target_properties(onnxruntime::onnxruntime PROPERTIES
  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib64/libonnxruntime.so.1.20.1"
  IMPORTED_SONAME_RELEASE "libonnxruntime.so.1"
  )

This produces CMake error when CMakeLists.txt contains find_package(onnxruntime CONFIG)

Urgency

No response

Target platform

Linux x64

Build script

Basic CMakeLists.txt to reproduce this fault may look like this:

cmake_minimum_required(VERSION 3.15)

project(test)

find_package(onnxruntime CONFIG)

and is executed:

$ cmake </path/to/CMakeLists.txt> -DCMAKE_PREFIX_PATH=</path/to/onnxruntime/release>

Error / output

CMake Error at /home/ubuntu/libs/onnxruntime-linux-x64-1.20.1/lib/cmake/onnxruntime/onnxruntimeTargets.cmake:84 (message):
The imported target "onnxruntime::onnxruntime" references the file

 "/home/ubuntu/libs/onnxruntime-linux-x64-1.20.1/lib64/libonnxruntime.so.1.20.1"

but this file does not exist. Possible reasons include:

  • The file was deleted, renamed, or moved to another location.

  • An install or uninstall procedure did not complete successfully.

  • The installation package was faulty and contained

    "/home/ubuntu/libs/onnxruntime-linux-x64-1.20.1/lib/cmake/onnxruntime/onnxruntimeTargets.cmake"

but not all the files it references.

Call Stack (most recent call first):
/home/ubuntu/libs/onnxruntime-linux-x64-1.20.1/lib/cmake/onnxruntime/onnxruntimeConfig.cmake:26 (include)
CMakeLists.txt:5 (find_package)

Visual Studio Version

No response

GCC / Compiler Version

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/cmake/onnxruntime/onnxruntimeTargets-release.cmake and compare its referenced lib64 path with the lib directory in the official Linux release archive. Reproduce the issue using the provided CMakeLists.txt and CMAKE_PREFIX_PATH. Done means find_package(onnxruntime CONFIG) succeeds without referencing a nonexistent library path.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, linux
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.