[Openmp-commits] [openmp] 4007963 - [RFC][OpenMP] Update to Python3 for lit test

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Mon Dec 26 18:39:56 PST 2022


Author: Shilei Tian
Date: 2022-12-26T21:39:51-05:00
New Revision: 40079637569f999015eaf3f7e137a63b2c8ade92

URL: https://github.com/llvm/llvm-project/commit/40079637569f999015eaf3f7e137a63b2c8ade92
DIFF: https://github.com/llvm/llvm-project/commit/40079637569f999015eaf3f7e137a63b2c8ade92.diff

LOG: [RFC][OpenMP] Update to Python3 for lit test

I think it's reasonable to upgrade to Python 3 for LIT test requirement because `lit` itself (`llvm/utils/lit/lit.py`) already switched to Python 3. In addition, LLVM already requires Python 3.6 to be the minimum version (https://llvm.org/docs/GettingStarted.html#software).

Reviewed By: jdoerfert, jhuber6

Differential Revision: https://reviews.llvm.org/D139855

Added: 
    

Modified: 
    openmp/cmake/OpenMPTesting.cmake

Removed: 
    


################################################################################
diff  --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake
index 01f49cfaea78c..a771efdf9e69a 100644
--- a/openmp/cmake/OpenMPTesting.cmake
+++ b/openmp/cmake/OpenMPTesting.cmake
@@ -3,9 +3,9 @@ set(ENABLE_CHECK_TARGETS TRUE)
 
 # Function to find required dependencies for testing.
 function(find_standalone_test_dependencies)
-  include(FindPythonInterp)
+  find_package (Python3 COMPONENTS Interpreter)
 
-  if (NOT PYTHONINTERP_FOUND)
+  if (NOT Python3_Interpreter_FOUND)
     message(STATUS "Could not find Python.")
     message(WARNING "The check targets will not be available!")
     set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
@@ -207,7 +207,7 @@ function(add_openmp_testsuite target comment)
   if (${OPENMP_STANDALONE_BUILD})
     set(LIT_ARGS ${OPENMP_LIT_ARGS} ${ARG_ARGS})
     add_custom_target(${target}
-      COMMAND ${PYTHON_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
+      COMMAND ${Python3_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
       COMMENT ${comment}
       DEPENDS ${ARG_DEPENDS}
       USES_TERMINAL


        


More information about the Openmp-commits mailing list