Skip to content
Snippets Groups Projects
Commit d8b9e1c8 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Install python packages in installer

parent 5e671e05
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
CURRENT_DIR=`pwd`
BUILD_DIR=$CURRENT_DIR/build
HPVM_RT=hpvm-rt/hpvm-rt.bc
if [ -f $BUILD_DIR/tools/hpvm/projects/$HPVM_RT ]; then
true
else
echo $BUILD_DIR/tools/hpvm/projects/$HPVM_RT
echo HPVM not installed! Exiting without running tests!.
exit 0
fi
LIT_DIR=$BUILD_DIR/bin/
LIT_TOOL=$LIT_DIR/llvm-lit
TEST_DIR=$CURRENT_DIR/test
REG_TEST_DIR=$TEST_DIR/regressionTests
UNIT_TEST_DIR=$TEST_DIR/unitTests
echo
echo Running tests ...
echo
# Run regression tests
$LIT_TOOL -v $REG_TEST_DIR
# Run unit tests
#$LIT_TOOL -v $UNIT_TEST_DIR
......@@ -31,8 +31,14 @@ LINKS = [
"tools",
]
MAKE_TARGETS = ["approxhpvm.py"]
MAKE_TEST_TARGETS = ["hpvm-check"]
MAKE_TEST_TARGETS = ["check-hpvm-dnn", "check-hpvm-pass"]
# Relative to project root which is __file__.parent.parent
PY_PACKAGES = [
"projects/predtuner",
"projects/torch2hpvm",
"projects/keras",
]
def parse_args():
parser = ArgumentParser(
......@@ -241,6 +247,16 @@ For more details refer to README.md.
chdir(ROOT_DIR)
def install_py_packages():
import sys
project_root = Path(__file__).parent.parent
for package in PY_PACKAGES:
package_home = project_root / package
print(f"Installing python package {package_home}")
check_call([sys.executable, "-m", "pip", "install", str(package_home)])
def run_tests():
chdir(BUILD_DIR)
# Run regression tests
......@@ -270,6 +286,7 @@ def main():
if not args.no_params:
check_download_model_params()
maybe_build(not args.no_build, args.parallel, args.targets, args.run_tests)
install_py_packages()
if args.run_tests:
run_tests()
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment