VitisAIのpytorch環境を作成したいとか思ってたり…
XIR(Xilinx Intermediate Representation)を素でビルドする。
まずはcmakeが新しくないと怒るのでUbuntuのデフォルトは削除して最新版をインストールする。
$ sudo apt remove cmake
cd cmake
./bootstrap --prefix=/usr/local
make -j5
あと、.bashrcにCMAKE_ROOTを追加する。
echo "export CMAKE_ROOT='/usr/local/share/cmake-3.9'" >> ~/.bashrc
XIRのビルドにgflagsが必要なのでインストールする。
$ sudo apt install libgflags2.2 libgflags-dev
XIRのビルドにunilogが必要なのでビルドしてインストールする。
ちなみにunilogはgoogle glogのwrapperらしい。
google glogがいるのでまずはライブラリをインストールする。
$ sudo add-apt-repository universe
$ sudo apt install libgoogle-glog-dev
そして、pip3でglogをインストールする。
$ pip3 install glog
あとは次のようにビルドしてインストールする。
$ cd ./Vitis-AI/tools/Vitis-AI-Runtime/VART/unilog
$ mkdir build
$ cd build/
$ cmake ../
$ make
$ sudo make install
XIRは次のようにビルドしてインストールする。
$ cd ./Vitis-AI/tools/Vitis-AI-Runtime/VART/xir/build
$ mkdir build
$ cd build/
$ cmake ../
$ make
$ sudo make install