From be6a63cd03c31756e6bf05cc7449539ff5276aa6 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 7 Jul 2025 10:59:20 +0200 Subject: [PATCH] tools.func: add AVX check for MongoDB (#5780) --- misc/tools.func | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/misc/tools.func b/misc/tools.func index 92cffe55e..0e0a5ea0d 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -658,6 +658,15 @@ function setup_mongodb() { DISTRO_ID=$(awk -F= '/^ID=/{ gsub(/"/,"",$2); print $2 }' /etc/os-release) DISTRO_CODENAME=$(awk -F= '/^VERSION_CODENAME=/{ print $2 }' /etc/os-release) + # Check AVX support + if ! grep -qm1 'avx[^ ]*' /proc/cpuinfo; then + local major="${MONGO_VERSION%%.*}" + if ((major > 5)); then + msg_error "MongoDB ${MONGO_VERSION} requires AVX support, which is not available on this system." + return 1 + fi + fi + case "$DISTRO_ID" in ubuntu) MONGO_BASE_URL="https://repo.mongodb.org/apt/ubuntu"