I am trying to build a special version of OpenOCD on AlmaLinux running in Docker.
I have build instructions for this version of OpenOCD on Ubuntu, including a number of packages to be installed first:
apt install autoconf automake autotools-dev bc bison build-essential curl dejagnu expect flex gawk gperf libtool patchutils texinfo pkg-config libudev-dev libhidapi-dev libusb-1.0-0-dev
When I simply replace apt install
by yum install
, some packages are not found:
- autotools-dev
- build-essential
- libudev-dev
- libhidapi-dev
- libusb-1.0-0-dev
I understand that the repositories for AlmaLinux are not identical to those for Ubuntu. However, I have no clue how to find the corresponding packages for AlmaLinux; I am not even sure that they exist.
So, how can I find these packages? Or do I need to compile them from source?
Headers are in *-devel
packages, rather than in *-dev
.
What is in “build-essential”? You want the packages that provide those tools.
Thanks for the -devel
hint.
-
libudev-devel
exists, so that is now fixed.
-
autotools-devel
, libhidapi-devel
and libusb-1.0-0-devel
don’t seem to exist, at least not in the default repositories
-
build-essential
documentation (from apt show build-essential
):
This package contains an informational list of packages which are
considered essential for building Debian packages. This package also
depends on the packages on that list, to make it easy to have the
build-essential packages installed.
Depends: libc6-dev | libc-dev, gcc (>= 4:9.2), g++ (>= 4:9.2), make, dpkg-dev (>= 1.17.11)
These are either already installed in my AlmaLinux, or not applicable on AlmaLinux (dpkg); so let’s ignore it.
I would guess kernel-devel will be needed. Also, if I remember correctly, default Alma doesnt include tar, bzip2 and a few others. As a rule I also install gcc-c++. It looks as if this page has a list of the included packages in build-essential for Ubuntu and it’s probably the same as Debian.
https://packages.ubuntu.com/focal/build-essential
The build-essentials sounds like the DNF group Development Tools.
From dnf group list -v
:
Available Environment Groups:
Server with GUI (graphical-server-environment)
Server (server-product-environment)
Virtualization Host (virtualization-host-environment)
Custom Operating System (custom-environment)
Installed Environment Groups:
Minimal Install (minimal-environment)
Workstation (workstation-product-environment)
Installed Groups:
Development Tools (development)
GNOME Desktop Environment (gnome-desktop)
Fonts (fonts)
Hardware Support (hardware-support)
Available Groups:
Legacy UNIX Compatibility (legacy-unix)
Scientific Support (scientific)
Smart Card Support (smart-card)
RPM Development Tools (rpm-development-tools)
Security Tools (security-tools)
Graphical Administration Tools (graphical-admin-tools)
Headless Management (headless-management)
.NET Development (dotnet)
Network Servers (network-server)
Console Internet Tools (console-internet)
Container Management (container-management)
Graphical Internet (graphical-internet)
KDE (K Desktop Environment) (kde-desktop)
Games and Entertainment (games)
Sound and Video (sound-and-video)
System Tools (system-tools)
Info on the DT:
$ dnf group info development
Group: Development Tools
Description: A basic development environment.
Mandatory Packages:
autoconf
automake
binutils
bison
flex
gcc
gcc-c++
gdb
glibc-devel
libtool
make
pkgconf
pkgconf-m4
pkgconf-pkg-config
redhat-rpm-config
rpm-build
rpm-sign
strace
Default Packages:
asciidoc
byacc
diffstat
git
intltool
jna
ltrace
patchutils
perl-Fedora-VSP
perl-generators
pesign
source-highlight
systemtap
valgrind
valgrind-devel
Optional Packages:
cmake
expect
rpmdevtools
rpmlint
Who has file/dir ‘gcc’ in directory “*bin” (i.e. bin or sbin):
$ dnf provides *bin/gcc
Last metadata expiration check: 0:23:08 ago on Tue 08 Aug 2023 03:53:38 PM EEST.
gcc-11.3.1-4.3.el9.alma.x86_64 : Various compilers (C, C++, Objective-C, ...)
Repo : @System
Matched from:
Other : *bin/gcc
gcc-11.3.1-4.3.el9.alma.x86_64 : Various compilers (C, C++, Objective-C, ...)
Repo : sbl-appstream
Matched from:
Other : *bin/gcc
gcc-toolset-12-gcc-12.2.1-7.4.el9.x86_64 : GCC version 12
Repo : sbl-appstream
Matched from:
Other : *bin/gcc
Is package gcc
in one of those DNF groups?
$ dnf rq --groupmember gcc
gcc-11.3.1-4.3.el9.alma.x86_64
@development
Yes, in the “Development Tools”. (One of the mandatory packages.)
You might want also the additional-devel group:
$ dnf -q group list -v --hidden | grep -i devel
Development Tools (development)
RPM Development Tools (rpm-development-tools)
Platform Development (platform-devel)
.NET Development (dotnet)
Additional Development (additional-devel)
Java Development (java-development)
Any suggestions for AlmaLinux alternatives for autotools-dev
, libhidapi-dev
and libusb-1.0-0-dev
?
Specifically, if I build openocd
on Linux Mint and then copy the executable to AlmaLinux, libhidapi-hidraw.so.0
is missing. After copying libhidapi-hidraw.so.0
from Linux Mint to AlmaLinux, openocd
works. However, I’d prefer to buld everything on AlmaLinux, using shared libraries built for AlmaLinux.
I tried dnf provides '*/libhidapi-hidraw.so*'
which resulted in Error: No matches found
OK, I found the package for libusb-1.0-0-dev:
$ dnf provides 'libusb-1.0.so.0'
dnf provides 'libusb-1.0.so.0'
Last metadata expiration check: 2:58:50 ago on Tue 08 Aug 2023 10:48:22 AM UTC.
libusbx-1.0.23-4.el8.i686 : Library for accessing USB devices
Repo : baseos
Matched from:
Provide : libusb-1.0.so.0
==>
$ yum install libusb-devel
Still looking for yum alternatives for autotools-dev
and libhidapi-dev
on ubuntu find out which files are in that package
e.g.
moe[0]:~# apt-file list libhidapi-dev
libhidapi-dev: /usr/include/hidapi/hidapi.h
libhidapi-dev: /usr/include/hidapi/hidapi_libusb.h
libhidapi-dev: /usr/lib/x86_64-linux-gnu/libhidapi-hidraw.a
libhidapi-dev: /usr/lib/x86_64-linux-gnu/libhidapi-hidraw.so
libhidapi-dev: /usr/lib/x86_64-linux-gnu/libhidapi-libusb.a
libhidapi-dev: /usr/lib/x86_64-linux-gnu/libhidapi-libusb.so
libhidapi-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/hidapi-hidraw.pc
libhidapi-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/hidapi-libusb.pc
libhidapi-dev: /usr/share/doc/libhidapi-dev/AUTHORS.txt
libhidapi-dev: /usr/share/doc/libhidapi-dev/README.md.gz
libhidapi-dev: /usr/share/doc/libhidapi-dev/changelog.Debian.gz
libhidapi-dev: /usr/share/doc/libhidapi-dev/copyright
on RHEL/Alma do a dnf provides for the essential file .e.g. the shared library:
minimo[0]:~# dnf provides */libhidapi-hidraw.so
Updating Subscription Management repositories.
Last metadata expiration check: 0:23:22 ago on Mon 14 Aug 2023 03:04:00 PM CEST.
hidapi-devel-0.12.0-2.el9.x86_64 : Development files for hidapi
Repo : epel
Matched from:
Filename : /usr/lib64/libhidapi-hidraw.so
hidapi-devel-0.12.0-2.el9.x86_64 : Development files for hidapi
Repo : COMMON_epel-9_Everything
Matched from:
Filename : /usr/lib64/libhidapi-hidraw.so
to check if everything you need is in this file you can do a
minimo[0]:~# dnf repoquery -l hidapi-devel
Updating Subscription Management repositories.
Everything 106 kB/s | 2.3 kB 00:00
Root-CAs 87 kB/s | 2.0 kB 00:00
tsm-x64 90 kB/s | 2.0 kB 00:00
/usr/include/hidapi
/usr/include/hidapi/hidapi.h
/usr/include/hidapi/hidapi_libusb.h
/usr/lib64/cmake/hidapi
/usr/lib64/cmake/hidapi/hidapi-config.cmake
/usr/lib64/cmake/hidapi/libhidapi-release.cmake
/usr/lib64/cmake/hidapi/libhidapi-version.cmake
/usr/lib64/cmake/hidapi/libhidapi.cmake
/usr/lib64/libhidapi-hidraw.so
/usr/lib64/libhidapi-libusb.so
/usr/lib64/pkgconfig/hidapi-hidraw.pc
/usr/lib64/pkgconfig/hidapi-libusb.pc