From 42ab425037417e35d71594e13b9525bba2744c86 Mon Sep 17 00:00:00 2001 From: corey-derochie-amd <161367113+corey-derochie-amd@users.noreply.github.com> Date: Tue, 11 Feb 2025 08:51:39 -0700 Subject: [PATCH] Switched from `cmake_host_system_information` feature to a manual parse (#1518) * Switched cmake_host_system_information feature to a manual parse to remain cmake 3.5 compliant. * Updating minimum cmake to 3.16 to conform with the rest of ROCm. This change still applies. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45ba954fe0..d56531a55b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ # CMake version minimum requirements #================================================================================================== -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) # CMake Toolchain file to define compilers and path to ROCm #================================================================================================== @@ -315,7 +315,12 @@ if (ENABLE_MSCCLPP AND ROCM_VERSION VERSION_LESS "60200") set(ENABLE_MSCCLPP OFF) message(WARNING "MSCCL++ integration only supported on ROCm 6.2 or greater; disabling MSCCL++ build") endif() -cmake_host_system_information(RESULT HOST_OS_ID QUERY DISTRIB_ID) +# cmake_host_system_information(RESULT HOST_OS_ID QUERY DISTRIB_ID) ## Requires cmake 3.22 +execute_process( + COMMAND bash -c "grep '^ID=' /etc/os-release | cut -d'=' -f2" + OUTPUT_VARIABLE HOST_OS_ID + OUTPUT_STRIP_TRAILING_WHITESPACE +) if (ENABLE_MSCCLPP AND NOT(${HOST_OS_ID} STREQUAL "ubuntu" OR ${HOST_OS_ID} STREQUAL "centos")) set(ENABLE_MSCCLPP OFF) message(WARNING "MSCCL++ integration not supported on this OS (${HOST_OS_ID}); disabling MSCCL++ build")