Closed blacklightpy closed 6 months ago
I don't think this Linux distribution and musl lib are being supported. @ilya-lavrenov to offer more insights. Thanks!
The condition here is that the project lists only Linux as a dependency, but actually also has a dependency on GLIBC, which is an implementation of the system C API or libc.
What you refer to as Linux distributions are actually GNU/Linux style system distributions, where Linux is only the kernel.
GNU was developed at a time when there were no free UNIX operating systems like BSD. By the time they had completed a POSIX userspace, Linus Torvalds had created the Linux kernel, and the GNU team added compatibility with Linux as its kernel, and that's how the idea of GNU/Linux distributions was made (in contrast to complete OS projects like BSD or Android).
So GNU/Linux is a stand in for any kind of OS that consists of a POSIX userland paired with the Linux kernel (pretty much in the same manner as JCB, Kleenex or Band-Aid). Most distros like Ubuntu and RHEL use the GNU glibc, while there are others that use musl libc.
The name Linux is more widely used to describe these systems because people found GNU/Linux weird to pronounce, and many people also hated the Richard Stallman, the founder of GNU and FSF, and did not want to associate with it.
Many distributions like Ubuntu and RHEL also use systemd software suite as the Initialization System and Service Manager, which often comes as a hard dependency, but OpenVINO is less likely to have dependencies on it, as it is a low-level framework.
Perhaps compatibility with musl should be added as a patch downstream, but it can certainly be helpful if any hard dependencies can be removed. Alpine Linux OCI image is popularly used as a base for containers because it's lightweight, due to its use of musl libc and Busybox system utilities.
@blacklightpy is it possible to use some docker image on typical glib-based Linux (let's say Ubuntu 22.04) to reproduce the issue with musl libc?
I'll try that.
glibc is not mandatory for OpenVINO. I think you can add detection of musl libc version in a similar way and add second path to OpenVINO cmake scripts.
In the container, I get
/home/openvino/build# cmake --build . --parallel -v
Change Dir: '/home/openvino/build'
Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile -j
gmake: Makefile: No such file or directory
gmake: *** No rule to make target 'Makefile'. Stop.
My CMake configure command was cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_SYSTEM_TBB=ON -DENABLE_AVX2=OFF -DENABLE_AVX512F=OFF ..
and that phase worked.
EDIT: The CMake configure was incomplete, let me see.
EDIT: Fixed it, somehow the files in the plugins/intel_cpu/thirdparty/mlas
submodule directory was deleted, and that caused an error.
which docker image do you use?
Ubuntu 24.04.
How can I use musl libc in Ubuntu 24.04?
You cannot use musl directly in Ubuntu because it provides the libc.so
and other important libraries. You'll have to use an Alpine Linux or Void Linux container.
Void Linux: ghcr.io/void-linux/void-musl
Alpine Linux: alpine
EDIT: I'll get the dependency lists needed for XBPS (package manager) if you're testing Void.
The dependencies are:
sudo xbps-install ca-certificates file base-devel ninja scons ccache cmake pkgconf git shellcheck patchelf fdupes gzip tbb-devel pugixml-devel ocl-icd-devel OpenCL-Headers rapidjson libva-devel snappy-devel python3-pip python3-virtualenv python3-setuptools python3-devel python3-pybind11 libffi-devel python3-enchant wget flatbuffers-devel git-lfs enchant2-devel json-c++
EDIT:
sudo xbps-install -Sy
would be sudo apt update
(should run before installing),
and
sudo xbps-install -u
would be sudo apt upgrade
(might need, being a rolling release distro).
Also you should use enter with /bin/dash
to use the shell, because it doesn't come with bash
preinstalled. (Quirks: you cannot press up arrow to go back in command history in dash
)
And for clear
command, you'll need to install ncurses
.
Also my build inside the Ubuntu container failed like:
gmake[2]: Leaving directory '/home/openvino/build'
[ 1%] Built target opencv_c_wrapper
/usr/bin/ranlib /home/openvino/bin/intel64/Release/libmlas.a
gmake[2]: Leaving directory '/home/openvino/build'
[ 1%] Built target mlas
gmake[2]: Leaving directory '/home/openvino/build'
gmake[1]: *** [CMakeFiles/Makefile2:2988: thirdparty/gflags/gflags/CMakeFiles/gflags_nothreads_static.dir/all] Error 2
gmake[2]: Leaving directory '/home/openvino/build'
gmake[1]: *** [CMakeFiles/Makefile2:3014: thirdparty/protobuf/protobuf/cmake/CMakeFiles/libprotobuf-lite.dir/all] Error 2
gmake[2]: Leaving directory '/home/openvino/build'
gmake[1]: *** [CMakeFiles/Makefile2:5815: src/plugins/intel_npu/thirdparty/level-zero/source/CMakeFiles/ze_loader.dir/all] Error 2
gmake[1]: Leaving directory '/home/openvino/build'
gmake: *** [Makefile:156: all] Error 2
But I don't think this has anything to do with musl, since it links to glibc.
The dependencies are:
sudo xbps-install ca-certificates file base-devel ninja scons ccache cmake pkgconf git shellcheck patchelf fdupes gzip tbb-devel pugixml-devel ocl-icd-devel OpenCL-Headers rapidjson libva-devel snappy-devel python3-pip python3-virtualenv python3-setuptools python3-devel python3-pybind11 libffi-devel python3-enchant wget flatbuffers-devel git-lfs enchant2-devel json-c++
EDIT:
sudo xbps-install -Sy
would besudo apt update
(should run before installing), andsudo xbps-install -u
would besudo apt upgrade
(might need, being a rolling release distro).
Could you please support of these dependencies to https://github.com/openvinotoolkit/openvino/blob/master/install_build_dependencies.sh ? Based on it, I will try to compile OpenVINO.
@blacklightpy I've made initial support in PR https://github.com/openvinotoolkit/openvino/pull/24428 Could you please try?
@ilya-lavrenov it passed configuration stage and started building.
@ilya-lavrenov building in parallel crashed by compositor, and building in TTY also would not let me do anything else. I'll have to retry with just 2 cores, but it'll probably take some time. Meanwhile I've added the dependency lists to your fork in my PR as requested.
@ilya-lavrenov building in parallel crashed by compositor, and building in TTY also would not let me do anything else. I'll have to retry with just 2 cores, but it'll probably take some time. Meanwhile I've added the dependency lists to your fork in my PR as requested.
I've merged your PR, thank you. Do you think it's also worth to add branch for Alpine Linux? As I see, it uses different package manager and we would like to have support for it. Could you please try adding it?
Sure, lemme see. I like tracking down package names.
I saw that you added OpenCL-CLHPP
, python3-pip
and python3-wheel
. Missing out python3-pip
was a mistake on my part, but I didn't see python3-wheel
required in the other distros' dependency lists.
Anyways, I've added it to Alpine Linux's dependency list too.
@blacklightpy thank you. Could you please send PR directly to OpenVINO official repo? My PR was merged to master
Alright
OpenVINO Version
Master Branch
Operating System
Other (Please specify in description)
Hardware Architecture
x86 (64 bits)
Target Platform
Build issue description
Code doesn't build on musl, as it is hardcoded to GLIBC at many points.
I'm using Void Linux musl libc edition.
musl libc is also used in Alpine Linux.
pipx install openvino
isn't working for me either, as it says no matching distribution found or something of that sort. I guess I'll use the container image in the meantime.Here are the references:
Build script or step-by-step to reproduce
Do CMake. It won't configure.
Relevant log output
Issue submission checklist