Skip to content

Commit be6a63c

Browse files
authored
tools.func: add AVX check for MongoDB (#5780)
1 parent 160846e commit be6a63c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

misc/tools.func

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,15 @@ function setup_mongodb() {
658658
DISTRO_ID=$(awk -F= '/^ID=/{ gsub(/"/,"",$2); print $2 }' /etc/os-release)
659659
DISTRO_CODENAME=$(awk -F= '/^VERSION_CODENAME=/{ print $2 }' /etc/os-release)
660660

661+
# Check AVX support
662+
if ! grep -qm1 'avx[^ ]*' /proc/cpuinfo; then
663+
local major="${MONGO_VERSION%%.*}"
664+
if ((major > 5)); then
665+
msg_error "MongoDB ${MONGO_VERSION} requires AVX support, which is not available on this system."
666+
return 1
667+
fi
668+
fi
669+
661670
case "$DISTRO_ID" in
662671
ubuntu)
663672
MONGO_BASE_URL="https://repo.mongodb.org/apt/ubuntu"

0 commit comments

Comments
 (0)