Build from source
Contents
Build from source¶
If you want to contribute to Hidet, or you encountered any problem installing hidet via pip, it is better to install hidet from source.
Clone the code¶
First clone the repository to local:
$ git clone https://github.com/hidet-org/hidet
Update environment variables¶
To allow Python interpreter to find hidet package under python
directory of the repository, we should append the
directory to PYTHONPATH
variable. To allow the system find the shared libraries we built in the previous step,
we should append build/lib
directory to LD_LIBRARY_PATH
variable.
$ export HIDET_HOME=<The Path to Hidet Repo>
$ export PYTHONPATH=$PYTHONPATH:$HIDET_HOME/python
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HIDET_HOME/build/lib
To avoid repeating above commands, it is recommended to put above commands to your shell’s initialization script
(e.g., ~/.bashrc
for Bash and ~/.zshrc
for Zsh).
Validation¶
To make sure we have successfully installed hidet, run the following command in a new shell:
$ python -c "import hidet"
If no error reports, then hidet has been successfully installed on your computer.