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] CMake Fails to Find Non-LTS Abseil Library (Download Triggered) #21976

Closed
mudream4869 opened this issue Sep 4, 2024 · 6 comments · Fixed by #22365
Closed

[Build] CMake Fails to Find Non-LTS Abseil Library (Download Triggered) #21976

mudream4869 opened this issue Sep 4, 2024 · 6 comments · Fixed by #22365
Labels
build build issues; typically submitted using template

Comments

@mudream4869
Copy link
Contributor

Describe the issue

CMake cannot locate a locally installed Abseil library that is not an LTS (Long-Term Support) version. As a result, the build process proceeds to download the Abseil library automatically.

Ref: Abseil will only give a version in lts branch.

Urgency

Not Urgent - Workaround in Place:

Currently, the issue of CMake downloading Abseil despite a local installation is not considered urgent. A temporary workaround has been implemented by removing the version check from the FetchContent_Declare command. This allows CMake to use the locally installed Abseil library without triggering the download.

Target platform

ubuntu 24.04

Build script

cmake -GNinja \
      -DCMAKE_BUILD_TYPE=Release \
      -Donnxruntime_BUILD_UNIT_TESTS=ON \
      -Donnxruntime_USE_AVX=ON \
      -Donnxruntime_BUILD_SHARED_LIB=ON \
      -DPYTHON_EXECUTABLE=$(which python3) \
      -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS \
      -DONNX_USE_PROTOBUF_SHARED_LIBS=ON \
      ../onnxruntime-1.19.0/cmake

Error / output

The provided output lists the contents of the CMake dependency download folder (build/_deps).

$ ls -al build/_deps | grep abs
drwxr-xr-x  4 mudream mudream 4096 Sep  4 04:33 abseil_cpp-build
drwxr-xr-x  6 mudream mudream 4096 Sep  4 04:33 abseil_cpp-src
drwxr-xr-x  4 mudream mudream 4096 Sep  4 04:33 abseil_cpp-subbuild

This indicates that CMake has successfully downloaded the Abseil library.

Visual Studio Version

No response

GCC / Compiler Version

No response

@mudream4869 mudream4869 added the build build issues; typically submitted using template label Sep 4, 2024
@RyanUnderhill
Copy link
Member

@yuslepukhin, in case you have any ideas on this?

@snnn
Copy link
Member

snnn commented Sep 5, 2024

So, the easiest fix would be upgrading ABSL to a released version?

@mudream4869
Copy link
Contributor Author

mudream4869 commented Sep 16, 2024

So, the easiest fix would be upgrading ABSL to a released version?

Applying to the latest abseil LTS version seems to work. Unittest pass on ubuntu 24.04.

@snnn
Copy link
Member

snnn commented Sep 16, 2024

Thanks. I will make a PR.

@Manamama
Copy link

Manamama commented Sep 22, 2024

A related problem:
absl::demangle_rust error in ONNX Runtime build on Droid, Termux.
Only compiling and installing newest abseil from:
https://github.com/abseil/abseil-cpp/ worked.

Ref:
~/downloads/onnxruntime $ apt list | grep abseil WARNING: apt does not have a stable CLI interface. Use with caution in scripts. abseil-cpp/stable,now 20240116.2-1 aarch64 [installed,automatic] ~/downloads/onnxruntime $

Operating System:

  • Name: Android 11 aarch64, Linux, 4.14.186+ (Termux)
  • Kernel: 4.14.186+
  • Shell: /data/data/com.termux/files/usr/bin/bashso
    uname -a
    Linux localhost 4.14.186+ SMP PREEMPT arch64 Android
    (Termux)

@Manamama
Copy link

Manamama commented Sep 22, 2024

Update: many other updates are needed for Termux now:

apt install boost-headers

Eigen needs to be cloned and hand compiled to get:
eigen/stable,now 3.4.0 aarch64 [installed]

export BUILD_MLAS_NO_ONNXRUNTIME=ON
A newish gcc...

snnn added a commit that referenced this issue Oct 10, 2024
### Description
Resolve #21976 .  
 
ABSL generally does not have forward/backward compatibility. Our code is
only compatible with one fixed LTS version. So it's important to fix the
version number there when using find_package to detect an installed
version.
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
4 participants