From c45e88aca424303c1837a3930b3dbb8e9fb9ea1e Mon Sep 17 00:00:00 2001 From: LakshmiKumar23 Date: Mon, 5 Feb 2024 10:07:44 -0800 Subject: [PATCH] accepts python version for dockers --- CMakeLists.txt | 1 + rocAL_pybind/CMakeLists.txt | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 846279696..2405847b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,7 @@ option(BUILD_DEV "Build rocAL Development Package" ON) option(AMD_FP16_SUPPORT "Build rocAL with float16 Support" OFF) option(BUILD_PYPACKAGE "Build rocAL Python Package" ON) option(BUILD_WITH_AMD_ADVANCE "Build rocAL for advanced AMD GPU Architecture" OFF) +option(PYTHONVERSION "Python version to build rocal" "") set(DEFAULT_BUILD_TYPE "Release") diff --git a/rocAL_pybind/CMakeLists.txt b/rocAL_pybind/CMakeLists.txt index ba7dc21ff..59763d35a 100644 --- a/rocAL_pybind/CMakeLists.txt +++ b/rocAL_pybind/CMakeLists.txt @@ -41,9 +41,13 @@ set(ROCAL_PYTHON ON) find_package(AMDRPP QUIET) find_package(MIVisionX QUIET) find_package(TurboJpeg QUIET) -set(Python3_FIND_VIRTUALENV FIRST) -find_package(Python3 QUIET COMPONENTS Interpreter Development) -find_package(pybind11 QUIET CONFIG) +if (PYTHONVERSION) + find_package(Python3 "${PYTHONVERSION}" EXACT QUIET COMPONENTS Interpreter Development) +else() + set(Python3_FIND_VIRTUALENV FIRST) + find_package(Python3 QUIET COMPONENTS Interpreter Development) +endif() +find_package(pybind11 QUIET CONFIG) find_package(HALF QUIET) # Backend @@ -280,4 +284,4 @@ if(${BUILD_ROCAL_PYBIND}) message("-- ${Green}Radeon Augmentation Library Python Binding - rocal_pybind module added ${ColourReset}") else() message("-- ${Red}WARNING: rocAL PyBind Module excluded - Dependency Failure${ColourReset}") -endif() \ No newline at end of file +endif()