[BUILD] Require use of Python3 interpreter (#1367)

Signed-off-by: nileshnegi <Nilesh.Negi@amd.com>

[ROCm/rccl commit: 41a2c02773]
This commit is contained in:
Nilesh M Negi
2024-10-09 22:36:50 -05:00
committed by GitHub
parent f61053dcba
commit 04d9a98c8e
+11 -2
View File
@@ -591,15 +591,24 @@ endforeach()
# Generate device/host tables and all the collective functions that are going to be in librccl.so
#==================================================================================================
find_package(PythonInterp REQUIRED)
find_package(Python3 COMPONENTS Interpreter REQUIRED)
if (NOT Python3_FOUND)
message(FATAL_ERROR "RCCL requires Python3 for generating host/device tables")
endif()
set(GEN_DIR "${HIPIFY_DIR}/gensrc")
# Execute the python script to generate required files
execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/device/generate.py ${GEN_DIR} ${IFC_ENABLED} ${COLLTRACE} ${ENABLE_MSCCL_KERNEL} ${ONLY_FUNCS}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE result
RESULT_VARIABLE gen_py_result
ERROR_VARIABLE gen_py_error
)
if (gen_py_result)
message(SEND_ERROR "Error: ${gen_py_error}")
message(FATAL_ERROR "${CMAKE_SOURCE_DIR}/src/device/generate.py failed")
endif()
# Find the generated files in the output directory
file(GLOB GENERATED_FILES "${GEN_DIR}/*")