Skip to content

Commit 4ca39da

Browse files
NFC: Update MLIR python bindings docs to install deps via requirements.txt.
* Also adds some verbiage about upgrading `pip` itself, since this is a common source of issues. Differential Revision: https://reviews.llvm.org/D99522
1 parent d35d8da commit 4ca39da

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

mlir/docs/Bindings/Python.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ Current status: Under development and not enabled by default
77
### Pre-requisites
88

99
* A relatively recent Python3 installation
10-
* [`pybind11`](https://github.com/pybind/pybind11) must be installed and able to
11-
be located by CMake (auto-detected if installed via
12-
`python -m pip install pybind11`). Note: minimum version required: :2.6.0.
10+
* Installation of python dependencies as specified in
11+
`mlir/lib/Bindings/Python/requirements.txt`
1312

1413
### CMake variables
1514

@@ -45,9 +44,18 @@ which python
4544
python -m venv ~/.venv/mlirdev
4645
source ~/.venv/mlirdev/bin/activate
4746

47+
# Note that many LTS distros will bundle a version of pip itself that is too
48+
# old to download all of the latest binaries for certain platforms.
49+
# The pip version can be obtained with `python -m pip --version`, and for
50+
# Linux specifically, this should be cross checked with minimum versions
51+
# here: https://github.com/pypa/manylinux
52+
# It is recommended to upgrade pip:
53+
python -m pip install --upgrade pip
54+
55+
4856
# Now the `python` command will resolve to your virtual environment and
4957
# packages will be installed there.
50-
python -m pip install pybind11 numpy
58+
python -m pip install -r mlir/lib/Bindings/Python/requirements.txt
5159

5260
# Now run `cmake`, `ninja`, et al.
5361
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
numpy
2+
pybind11>=2.6.0
3+
PyYAML

0 commit comments

Comments
 (0)