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

[Build] Mismatched library directory in linux-x64 package: lib and lib64 #22267

Open
zchrissirhcz opened this issue Sep 30, 2024 · 10 comments
Open
Labels
build build issues; typically submitted using template

Comments

@zchrissirhcz
Copy link

Describe the issue

Mismatched library directory: lib and lib64

image

Urgency

No response

Target platform

linux-x64

Build script

CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)
project(x)

set(onnxruntime_DIR /mnt/d/dbg/a87/onnxruntime-linux-x64-1.19.2/lib/cmake/onnxruntime)
find_package(onnxruntime REQUIRED)
cmake -S . -B build

Error / output

image

zz@localhost:/mnt/d/dbg/a87/test$ cmake -S . -B build
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /mnt/d/dbg/a87/onnxruntime-linux-x64-1.19.2/lib/cmake/onnxruntime/onnxruntimeTargets.cmake:84 (message):
  The imported target "onnxruntime::onnxruntime" references the file

     "/mnt/d/dbg/a87/onnxruntime-linux-x64-1.19.2/lib64/libonnxruntime.so.1.19.2"

  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

     "/mnt/d/dbg/a87/onnxruntime-linux-x64-1.19.2/lib/cmake/onnxruntime/onnxruntimeTargets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /mnt/d/dbg/a87/onnxruntime-linux-x64-1.19.2/lib/cmake/onnxruntime/onnxruntimeConfig.cmake:26 (include)
  CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!

Visual Studio Version

No response

GCC / Compiler Version

No response

@zchrissirhcz zchrissirhcz added the build build issues; typically submitted using template label Sep 30, 2024
Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Oct 30, 2024
@zchrissirhcz
Copy link
Author

Not stale.

@github-actions github-actions bot removed the stale issues that have not been addressed in a while; categorized by a bot label Oct 31, 2024
@hytxx
Copy link

hytxx commented Nov 12, 2024

I encountered the same issue. Is there a solution?

@zchrissirhcz
Copy link
Author

There is an official repo for onnxruntime inference examples, which, actually not using find_package() for onnxruntime.

https://github.com/microsoft/onnxruntime-inference-examples

@zchrissirhcz
Copy link
Author

@snnn Could you please help find a proper engineer for that fix?

@hytxx
Copy link

hytxx commented Nov 12, 2024

There is an official repo for onnxruntime inference examples, which, actually not using find_package() for onnxruntime.有一个官方的 onnxruntime 推理示例仓库,实际上并没有对 onnxruntime 使用 find_package()。

https://github.com/microsoft/onnxruntime-inference-examples

Yes, I also saw it under the demo, using include_dir and lib_dir directly.

This is how I used it.

# Set ONNX Runtime include and library directories
set(onnxruntime_include_dir "/home/xxx/software/onnxruntime-linux-x64-gpu-1.20.0/include")
set(onnxruntime_lib_dir "/home/xxx/software/onnxruntime-linux-x64-gpu-1.20.0/lib")
# Add ONNX Runtime library
find_library(ONNXRUNTIME_LIB onnxruntime PATHS ${onnxruntime_lib_dir})
if(NOT ONNXRUNTIME_LIB)
    message(FATAL_ERROR "ONNX Runtime library not found.")
endif()

@zchrissirhcz
Copy link
Author

I guess the CMAKE_INSTALL_LIBDIR variable is related, but I don't exactly know how each released .zip is generated.

I find that -DCMAKE_INSTALL_LIBDIR=$LIBDIR in .sh script files, and LIBDIR is lib for some linux distro and lib64 for other linux distros.

@snnn

@zchrissirhcz
Copy link
Author

@apsonawane

@apsonawane
Copy link
Contributor

Hello @zchrissirhcz, we recently released 1.20.0 can you try this version to see if it works?

Thanks

@zchrissirhcz
Copy link
Author

zchrissirhcz commented Nov 15, 2024

Hi @apsonawane , I just tried 1.20.0 as you suggested, it reproduced, the find_package(onnruntime REQUIRED) still gives error

Image

My corresponding CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)
project(use_onnxruntime)

set(onnxruntime_DIR /home/zz/pkgs/onnxruntime-linux-x64-1.20.0/lib/cmake/onnxruntime)
find_package(onnxruntime REQUIRED)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template
Projects
None yet
Development

No branches or pull requests

3 participants