diff --git a/setup.py b/setup.py index 6a1a118b..cbe78c14 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,12 @@ with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() PACKAGE_VERSION = os.environ.get("SHARK_PACKAGE_VERSION") or "0.0.4" +backend_deps = [] +if os.environ["NO_BACKEND"] is None: + backend_deps = [ + "iree-compiler>=20220427.13", + "iree-runtime>=20220427.13", + ] setup( name="nodai-SHARK", @@ -32,7 +38,6 @@ setup( "numpy", "PyYAML", "torch-mlir>=20220428.420", - "iree-compiler>=20220427.13", - "iree-runtime>=20220427.13", - ], + ] + + backend_deps, ) diff --git a/setup_venv.sh b/setup_venv.sh index 51032428..885f28fc 100755 --- a/setup_venv.sh +++ b/setup_venv.sh @@ -7,6 +7,7 @@ # VENV_DIR=myshark.venv #create a venv called myshark.venv # USE_IREE=1 #use stock IREE instead of Nod.ai's SHARK build # IMPORTER=1 #Install importer deps +# NO_BACKEND=1 #Don't install iree or shark backend # if you run the script from a conda env it will install in your conda env TD="$(cd $(dirname $0) && pwd)" @@ -91,9 +92,12 @@ if [[ -z "${USE_IREE}" ]]; then else RUNTIME="google/iree" fi -echo "Installing ${RUNTIME}..." -$PYTHON -m pip install --find-links https://github.com/${RUNTIME}/releases iree-compiler iree-runtime - +if [[ -z "${NO_BACKEND}" ]]; then + echo "Installing ${RUNTIME}..." + $PYTHON -m pip install --find-links https://github.com/${RUNTIME}/releases iree-compiler iree-runtime +else + echo "Not installing a backend, please make sure to add your backend to PYTHONPATH" +fi if [[ ! -z "${IMPORTER}" ]]; then echo "${Yellow}Installing importer tools.." if [[ $(uname -s) = 'Linux' ]]; then