[llvm-branch-commits] [mlir] 3024b1e - [mlir][Python] Check numpy in Python bindings configuration.

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 1 17:34:09 PST 2020


Author: zhanghb97
Date: 2020-12-02T09:29:20+08:00
New Revision: 3024b1efde6097779d86277131e2de60086f637b

URL: https://github.com/llvm/llvm-project/commit/3024b1efde6097779d86277131e2de60086f637b
DIFF: https://github.com/llvm/llvm-project/commit/3024b1efde6097779d86277131e2de60086f637b.diff

LOG: [mlir][Python] Check numpy in Python bindings configuration.

The test process of the ir_array_attributes.py depends on numpy. This patch checks numpy in Python bindings configuration.
- Add NumPy in find_package as a required component to check numpy.
- If numpy is found, print the version and include directory.

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

Added: 
    

Modified: 
    mlir/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 1acdec218373..2cf37753ea5c 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -79,9 +79,10 @@ set(MLIR_PYTHON_BINDINGS_VERSION_LOCKED 1 CACHE BOOL
 
 if(MLIR_BINDINGS_PYTHON_ENABLED)
   include(MLIRDetectPythonEnv)
-  find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
+  find_package(Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
   message(STATUS "Found python include dirs: ${Python3_INCLUDE_DIRS}")
   message(STATUS "Found python libraries: ${Python3_LIBRARIES}")
+  message(STATUS "Found numpy v${Python3_NumPy_VERSION}: ${Python3_NumPy_INCLUDE_DIRS}")
   mlir_detect_pybind11_install()
   find_package(pybind11 2.6 CONFIG REQUIRED)
   message(STATUS "Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIR}")


        


More information about the llvm-branch-commits mailing list