This page gives instructions on how to build and install the tvm package from scratch on various systems. It consists of two steps:
- First build the shared library from the C++ codes (
libtvm.sofor linux/osx and
- Setup for the language packages (e.g. Python Package).
To get started, clone tvm repo from github. It is important to clone the submodules along, with
git clone --recursive https://github.com/dmlc/tvm
For windows users who use github tools, you can open the git shell, and type the following command.
git submodule init git submodule update
Python Package Installation¶
The python package is located at python There are several ways to install the package:
Set the environment variable
PYTHONPATHto tell python where to find the library. For example, assume we cloned
tvmon the home directory
~. then we can added the following line in
~/.bashrc. It is recommended for developers who may change the codes. The changes will be immediately reflected once you pulled the code and rebuild the project (no need to call
Install tvm python bindings by
# install tvm package for the current user # NOTE: if you installed python via homebrew, --user is not needed during installaiton # it will be automatically installed to your user directory. # providing --user flag may trigger error during installation in such case. export MACOSX_DEPLOYMENT_TARGET=10.9 # This is required for mac to avoid symbol conflicts with libstdc++ cd python; python setup.py install --user; cd .. cd topi/python; python setup.py install --user; cd ../.. cd nnvm/python; python setup.py install --user; cd ../..