Note that the version of CMake on apt may not be sufficiently up to date; it may be necessary to install it directly from Kitware’s third-party APT repository.
On Fedora/CentOS and related operating systems use:
If you are on macOS with an M1 Processor you may need to use conda to manage dependencies while building. Specifically you may need, Miniforge to ensure that the dependencies obtained using pip are compatible with M1.
On supported platforms, the Ccache compiler wrapper may be helpful for
reducing TVM’s build time. There are several ways to enable CCache in TVM builds:
Leave USE_CCACHE=AUTO in build/config.cmake. CCache will be used if it is found.
Ccache’s Masquerade mode. This is typically enabled during the Ccache installation process.
To have TVM use Ccache in masquerade, simply specify the appropriate C/C++ compiler
paths when configuring TVM’s build system. For example:
cmake-DCMAKE_CXX_COMPILER=/usr/lib/ccache/c++....
Ccache as CMake’s C++ compiler prefix. When configuring TVM’s build system,
set the CMake variable CMAKE_CXX_COMPILER_LAUNCHER to an appropriate value.
E.g. cmake-DCMAKE_CXX_COMPILER_LAUNCHER=ccache....
# Build in the "build" directory
make
# Alternate location, "build_debug"TVM_BUILD_PATH=build_debug make
# Build both "build_release" and "build_debug"TVM_BUILD_PATH="build_debug build_release" make
# Use debug buildTVM_LIBRARY_PATH=~/tvm/build_debug python3
# Create a conda environment with the dependencies specified by the yaml
conda env create --file conda/build-environment.yaml
# Activate the created environment
conda activate tvm-build
TVM support build via MSVC using cmake. You will need to obtain a visual studio compiler.
The minimum required VS version is Visual Studio Enterprise 2019 (NOTE: we test
against GitHub Actions’ Windows 2019 Runner, so see that page for full details.
We recommend following 用 Conda 环境构建 to obtain necessary dependencies and
get an activated tvm-build environment. Then you can run the following command to build
mkdir build
cd build
cmake -A x64 -Thost=x64 ..
cd ..
# 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.exportMACOSX_DEPLOYMENT_TARGET=10.9 # This is required for mac to avoid symbol conflicts with libstdc++cd python; python setup.py install --user;cd ..