Update README.md
I think these are all of the chanes Aart recommended...
diff --git a/README.md b/README.md
index 5bdb687..db698dc 100644
--- a/README.md
+++ b/README.md
@@ -24,43 +24,25 @@
git submodule update --init --recursive --progress
```
-All of the following commands assume you remain in the `mpact-compiler` directory.
+NOTE: All of the following commands assume you remain in the `mpact-compiler` directory.
### Setup Python virtual environment
-The following commands initialize a virtual environment.
+The following commands initialize a virtual environment under bash/sh/etc. For other shells, see Note 1, [below](README.md#notes).
```shell
python3.11 -m venv mpact_venv # one time set up
+source mpact_venv/bin/activate # MUST BE REPEATED FOR EVERY SESSION
```
-NOTE: every session you have in this repo requires one of the following
-three commands (maybe add it to your .*sh file?). (Remember to replace
-"<path_to_mpact_compiler>" with your specific path.)
+Next, set the Python paths as follows; for shells not in the bash/sh family, see Note 2, [below](README.md#notes).
```shell
-source <path_to_mpact_compiler>/mpact_venv/bin/activate # for bash/sh/etc.
-
-source <path_to_mpact_compiler>/mpact_venv/bin/activate.csh # for csh/tcsh/etc.
-
-source <path_to_mpact_compiler>/mpact_venv/bin/activate.fish # for fish/etc.
-```
-
-Also make sure to set the Python paths as follows -- note that shell
-syntax depends on the shell you're running, and you need to replace
-"<path_to_mpact_compiler>" with your specific path.
-
-```shell
-# FOR bash/sh/etc.
-export PYTHONPATH=<path_to_mpact_compiler>/build/tools/torch-mlir/python_packages/torch_mlir: \\
- <path_to_mpact_compiler>/build/tools/mpact/python_packages/mpact
-
-# FOR csh/tcsh/etc.
-setenv PYTHONPATH <path_to_mpact_compiler>/build/tools/torch-mlir/python_packages/torch_mlir:<path_to_mpact_compiler>/build/tools/mpact/python_packages/mpact
+export PYTHONPATH=`pwd`/build/tools/torch-mlir/python_packages/torch_mlir:pwd`/build/tools/mpact/python_packages/mpact
```
### Install build requirements
-Note that currently we rely on `torch-mlir` requirements defined in the
+Note that currently we rely on `torch-mlir` requirements defined in that
submodule to ensure all the build requirements are consistent.
```shell
@@ -68,6 +50,7 @@
python -m pip install -r externals/torch-mlir/requirements.txt
python -m pip install -r externals/torch-mlir/torchvision-requirements.txt
```
+For shells not in the bash/sh family, see Note 3, [below](README.md#notes).
### Building the MPACT compiler in-tree
@@ -75,12 +58,6 @@
project completely *in-tree*, which means that both LLVM as well as torch-mlir
are built from source.
-NOTE: if using csh/tcsh/etc., run the following command:
-
-```shell
-rehash
-```
-
```shell
cmake -GNinja -Bbuild \
-DCMAKE_BUILD_TYPE=Release \
@@ -99,3 +76,25 @@
```shell
cmake --build build --target check-mpact
```
+
+
+## Notes
+
+1. Shells other than bash/sh/etc. require a different `activate` script, as shown. Because the python environment has to be set up for every session, we recommend putting it in your .*sh startup file.
+ - For csh/tcsh/etc.:
+ ```shell
+ source `pwd`/mpact_venv/bin/activate.csh
+ ```
+ - For fish/etc.:
+ ```shell
+ source <path_to_mpact_compiler>/mpact_venv/bin/activate.fish
+ ```
+2. Shells other than bash/sh/etc. set their environment variables differently:
+ - For csh/tcsh/etc.:
+ ```shell
+ setenv PYTHONPATH `pwd`/build/tools/torch-mlir/python_packages/torch_mlir:`pwd`/build/tools/mpact/python_packages/mpact
+ ```
+3. If using csh/tcsh/etc., run the following command before trying to build the compiler:
+```shell
+rehash
+```