Repository navigation
Installing
- Packages
- Quick Setup 1 (All)
- Quick Setup 2 (Limited)
- Manual Setup (copy)
- Windows (cross compilation)
Only available after Quick Setup 2 (Limited)
Note
Most packages have a pre-release/unstable version named <package_name>-pre.
The -pre packages are marked as obsolete by any release/stable package (without -pre) of the same version or higher.
The same packages exist as RPM (Fedora), DEB (Debian/Ubuntu) and Arch Linux (pacman, .pkg.tar.zst): same names, content and dependencies (on Arch the libraries are in /usr/lib).
| File Name | Content |
|---|---|
libutils |
Install the default packages (libutils-dev, libutils-op) |
libutils-dev |
Contains all includes needed and cmake global configuration (requires openssl-devel / libssl-dev) |
libutils-dev-op |
Contains cmake configuration for libutils-op
|
libutils-dev-db |
Contains cmake configuration for libutils-db
|
libutils-dev-as |
Contains cmake configuration for libutils-as
|
libutils-op |
Compiled with optimization options |
libutils-db |
Compiled with debug options (intended for debugging only) |
libutils-as |
Compiled with asan options (intended for debugging only) |
Windows (MinGW-w64 cross compilation, installed in the MinGW sysroot: /usr/x86_64-w64-mingw32/sys-root/mingw on Fedora, /usr/x86_64-w64-mingw32 on Debian/Ubuntu)
| File Name | Content |
|---|---|
mingw64-libutils |
Install the default Windows packages (mingw64-libutils-dev, mingw64-libutils-op) |
mingw64-libutils-dev |
All includes needed and cmake global configuration (requires mingw64-openssl on Fedora, OpenSSL for MinGW built by hand on Debian) |
mingw64-libutils-dev-op |
Contains cmake configuration for mingw64-libutils-op
|
mingw64-libutils-dev-db |
Contains cmake configuration for mingw64-libutils-db
|
mingw64-libutils-op |
Windows, compiled with optimization options |
mingw64-libutils-db |
Windows, compiled with debug options (no asan version with MinGW) |
Setup into
/usr/local
git clone https://github.com/TsukiNi22/libutils.git
cd libutilsexport BUILD_DIR=build
cmake -S . -B $BUILD_DIR
sudo cmake --build $BUILD_DIR --target install --parallel $(nproc)Setup into
/usr
Warning
If during the installation using tools like dnf, apt... you see an invalid hash error, reset the cache of the tool or relaunch the setup.sh script
If the error still persists, it might be due to an error in the repository
Warning
Restriction: fedora-based (rpm), debian-based (deb), arch-based (pacman)
Note
The usage of sudo in the script can be remove using --no-sudo argument
Run the setup script directly, without cloning the repository manually. It registers the libutils package repository so that the package manager can install the packages:
- Detect the distribution from
/etc/os-release(rpm,deborarchbased). -
rpm: add/etc/yum.repos.d/libutils.repoand import the GPG key. -
deb: add the GPG key in/etc/apt/keyrings/libutils.gpg, the source in/etc/apt/sources.list.d/libutils.list, thenapt-get update. -
arch: add the GPG key to the pacman keyring (pacman-key --add+--lsign-key), the[libutils]repository in/etc/pacman.conf(SigLevel = Required, packages and database signed), thenpacman -Sy.
wget -qO- https://raw.githubusercontent.com/TsukiNi22/libutils/main/setup.sh | bash -sor with curl:
curl -fsSL https://raw.githubusercontent.com/TsukiNi22/libutils/main/setup.sh | bash -sThen install the packages:
sudo dnf install libutils # Fedora / RHEL
sudo apt install libutils # Debian / Ubuntu
sudo pacman -S libutils # Arch Linux| Argument | Effect |
|---|---|
--no-sudo |
Run without sudo (the script must already run as root) |
-h, --help
|
Display the usage |
Setup into
<your_project>/
git clone https://github.com/TsukiNi22/libutils.git
cd libutilsexport BUILD_DIR=build
cmake -S . -B $BUILD_DIR -DCMAKE_BUILD_TYPE=Optimized
cmake --build $BUILD_DIR --parallel $(nproc)cp -r include/* build/generated/* <your_project>/include/
cp build/libutils.a <your_project>/libs/You can now compile your own project using -I<your_project>/include/ and -L<your_project>/libs/ -lutils or using cmake:
target_include_directories(${TARGET} PRIVATE include)
target_link_directories(${TARGET} PRIVATE ${CMAKE_SOURCE_DIR}/libs/)
target_link_libraries(${TARGET} PRIVATE utils)Note
Some parts of the libutils need OpenSSL (>= 3.0)
Using command -lssl -lcrypto or with cmake:
find_package(OpenSSL REQUIRED)
target_link_libraries(${TARGET} PRIVATE
OpenSSL::SSL
OpenSSL::Crypto
)Build
libutils.afor Windows (x86_64) from Linux with the MinGW-w64 toolchain (complete guide: Windows (usage))
From the packages (after the setup.sh of Quick Setup 2 (Limited)), installed in the MinGW sysroot:
sudo dnf install mingw64-libutils-pre # Fedora: + mingw64-libutils-db-pre for Debug (requires mingw64-openssl)
sudo apt install mingw64-libutils-pre # Debian/Ubuntu: OpenSSL for MinGW must be built by handFrom the sources:
| Name | Fedora (dnf) |
Debian/Ubuntu (apt) |
|---|---|---|
| MinGW-w64 (GCC >= 13) | mingw64-gcc-c++ |
g++-mingw-w64-x86-64 |
| OpenSSL for MinGW | mingw64-openssl |
built for MinGW (no package) |
| Wine (tests only) | wine |
wine64 |
export BUILD_DIR=build-windows
cmake -S . -B $BUILD_DIR -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain/mingw-w64.cmake -DCMAKE_BUILD_TYPE=Optimized
cmake --build $BUILD_DIR --parallel $(nproc)
cmake --install $BUILD_DIR --prefix <windows_prefix> # include/, lib/libutils.a, lib/cmake/utils/
cmake --build $BUILD_DIR --target package # mingw64-libutils-* RPM/DEB (MinGW sysroot)Note
No AddressSanitizer with MinGW: the Asan mode is built like Debug. With -DBUILD_TESTS=ON, the GoogleTest built for MinGW in the sysroot is used (else it is downloaded) and ctest runs the tests with wine.
Warning
Include <windows.h> before <utils/utils.hpp> (or define WIN32_LEAN_AND_MEAN): the complete <windows.h> declares a member named _unused, a libutils attribute macro.
Home · Installing · Usage · Tools Preview · Sections · Workflow (CI-CD)
libutils is licensed under MIT (the synced algorithms under CC BY-NC-SA 4.0).