diff --git a/INSTALL-LINUX.md b/INSTALL-LINUX.md new file mode 100644 index 00000000..dfd8e167 --- /dev/null +++ b/INSTALL-LINUX.md @@ -0,0 +1,71 @@ +## ion-kit Linux Install + +### 1. Install LLVM +#### a. Using a binary release (Preferred for all systems) +Find latest binary release [here](https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.1) for your supported system. + +### 2. Install Halide +#### a. Using a binary release (Preferred for all systems) +Find latest binary release [here](https://github.com/halide/Halide/releases/tag/v16.0.0) for your supported system. +```sh +curl -L https://github.com/halide/Halide/releases/download/v12.0.1/Halide-12.0.1-x86-64-linux-5dabcaa9effca1067f907f6c8ea212f3d2b1d99a.tar.gz | tar zx +``` + +#### b. Build from source +##### 2.b.1. Build and install LLVM +Halide v16.0.1 requires LLVM 16. In the following, assume install LLVM-16.0. + +```sh +git clone https://github.com/llvm/llvm-project.git -b release/16.x --depth=1 +cd llvm-project +mkdir build && cd build +cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX= -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" -DLLVM_TARGETS_TO_BUILD="X86;ARM;NVPTX;AArch64;Mips;Hexagon;PowerPC;AMDGPU;RISCV" -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_BUILD_32_BITS=OFF ../llvm +cmake --build . --target install +``` + +##### 2.b.2 Build and install Halide +```sh +git clone https://github.com/halide/Halide.git -b v16.0.0 --depth=1 +mkdir build && cd build +cmake -GNinja -DCMAKE_INSTALL_PREFIX= -DLLVM_DIR=/lib/cmake/llvm/ -DHALIDE_ENABLE_RTTI=ON -DWITH_APPS=OFF .. +cmake --build . --target install +``` + +### 3. Install onnxruntime (Optional, if you use ion-bb-dnn) +If you use only cpu, you can get binary release. +Please visit official onnxruntime [github](https://github.com/microsoft/onnxruntime/releases/tag/v1.16.3) for latest release. + +```sh +curl -L https://github.com/microsoft/onnxruntime/releases/download/v1.4.0/onnxruntime-linux-x64-1.4.0.tgz | tar zx -C +``` + +Add directory to `ldconfig` +``` +sudo vim /etc/ld.so.conf +sudo ldconfig +``` + +* Please note, latest version of onnxruntime with GPU only supports `CUDA 1.8` +* `libcudnn8` will also be needed if you run with GPU, please install with: +``` +sudo apt-get install libcudnn8 +``` + +### 4. Place additional building blocks (Appendix) +If you want to use additional `ion-bb-xx` directories, place them directly under `ion-kit` directory. + +### 5. Install OpenCV +#### a. Using Package Managers +##### 5.a.1 Linux +``` +sudo apt install libopencv-dev +``` + +### 6. Install Generators +#### a. Using Package Managers +##### 6.a.1 Linux +``` +sudo apt-get install ninja-build +``` + + diff --git a/INSTALL-MACOS.md b/INSTALL-MACOS.md new file mode 100644 index 00000000..3c03fc19 --- /dev/null +++ b/INSTALL-MACOS.md @@ -0,0 +1,63 @@ +## ion-kit MacOS Install + +### 1. Install LLVM +#### a. Using a binary release (Preferred for all systems) +Find latest binary release [here](https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.1) for your supported system. +#### b. Install with Package Managers +##### 1.b.1. Install with Brew (MacOS) +``` +brew install llvm@16 +``` + +### 2. Install Halide +#### a. Using a binary release (Preferred for all systems) +Find latest binary release [here](https://github.com/halide/Halide/releases/tag/v16.0.0) for your supported system. +```sh +curl -L https://github.com/halide/Halide/releases/download/v12.0.1/Halide-12.0.1-x86-64-linux-5dabcaa9effca1067f907f6c8ea212f3d2b1d99a.tar.gz | tar zx +``` +#### b. Install with Package Managers +##### 2.b.1. Install with Brew (MacOS) +``` +brew install Halide@16 +``` +Use `brew info` to install and check missing dependencies (including `llvm16`) + +#### c. Build from source +##### 2.c.1. Build and install LLVM +Halide v16.0.1 requires LLVM 16. In the following, assume install LLVM-16.0. + +```sh +git clone https://github.com/llvm/llvm-project.git -b release/16.x --depth=1 +cd llvm-project +mkdir build && cd build +cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX= -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" -DLLVM_TARGETS_TO_BUILD="X86;ARM;NVPTX;AArch64;Mips;Hexagon;PowerPC;AMDGPU;RISCV" -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_BUILD_32_BITS=OFF ../llvm +cmake --build . --target install +``` + +##### 2.c.2 Build and install Halide +```sh +git clone https://github.com/halide/Halide.git -b v16.0.0 --depth=1 +mkdir build && cd build +cmake -GNinja -DCMAKE_INSTALL_PREFIX= -DLLVM_DIR=/lib/cmake/llvm/ -DHALIDE_ENABLE_RTTI=ON -DWITH_APPS=OFF .. +cmake --build . --target install +``` + +### 3. Install onnxruntime (Optional, if you use ion-bb-dnn) +**Not currently supported on MacOS.** + +### 4. Place additional building blocks (Appendix) +If you want to use additional `ion-bb-xx` directories, place them directly under `ion-kit` directory. + +### 5. Install OpenCV +#### a. Using Package Managers +##### 5.a.1 MacOS +``` +brew install opencv +``` + +### 6. Install Generators +#### a. Using Package Managers +##### 6.a.1 MacOS +``` +brew install ninja +``` diff --git a/INSTALL-WINDOWS.md b/INSTALL-WINDOWS.md new file mode 100644 index 00000000..20be42cb --- /dev/null +++ b/INSTALL-WINDOWS.md @@ -0,0 +1,23 @@ +## ion-kit Windows Install + +### 1. Install LLVM +#### a. Using a binary release (Preferred for all systems) +Find latest binary release [here](https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.1) for your supported system. + +### 2. Install Halide +#### a. Using a binary release (Preferred for all systems) +Find latest binary release [here](https://github.com/halide/Halide/releases/tag/v16.0.0) for your supported system. + +### 3. Install onnxruntime (Optional, if you use ion-bb-dnn) +WIP + +### 4. Place additional building blocks (Appendix) +If you want to use additional `ion-bb-xx` directories, place them directly under ` `ion-kit` directory. + +### 5. Install OpenCV +#### a. Using Installers +##### 5.a.1 Windows +Download and install latest from [OpenCV](https://sourceforge.net/projects/opencvlibrary/files/) + +### 6. Install Generators +Please install the latest version of Microsoft Visual Studio. diff --git a/README.md b/README.md index 36a752d9..80d362e7 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,44 @@ # ion-kit -A framework to compile user-defined pipeline. +A framework to compile user-defined pipeline. Current support: + * Linux + * Windows + * MacOS ## Depedencies -* [Halide (v12.0.1)](https://github.com/halide/Halide/releases/tag/v12.0.1) +* [Halide (v16.0.0)](https://github.com/halide/Halide/releases/tag/v16.0.0) +* llvm * doxygen * sphinx +* ninja (unix) +* msvc (windows) -## Build -### 1. Install Halide -#### a. Using a binary release -```sh -curl -L https://github.com/halide/Halide/releases/download/v12.0.1/Halide-12.0.1-x86-64-linux-5dabcaa9effca1067f907f6c8ea212f3d2b1d99a.tar.gz | tar zx -``` - -#### b. Build from source -##### 2.b.1. Build and install LLVM -Halide v12.0.1 requires LLVM 11.0-12.0. In the following, assume install LLVM-12.0. +### 1. Install +Please follow the instructions provided for your preferred platform. +* [Linux](INSTALL-LINUX.md) +* [Windows](INSTALL-WINDOWS.md) +* [MacOS](INSTALL-MACOS.md) +### 2. Build +#### a. Unix ```sh -git clone https://github.com/llvm/llvm-project.git -b release/12.x --depth=1 -cd llvm-project mkdir build && cd build -cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX= -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" -DLLVM_TARGETS_TO_BUILD="X86;ARM;NVPTX;AArch64;Mips;Hexagon;PowerPC;AMDGPU;RISCV" -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_BUILD_32_BITS=OFF ../llvm -cmake --build . --target install +cmake -GNinja -DCMAKE_INSTALL_PREFIX= -DHalide_DIR= -DONNXRUNTIME_ROOT= -DOPENCV_DIR= ../ +cmake --build . ``` - -##### 2.b.2 Build and install Halide -```sh -git clone https://github.com/halide/Halide.git -b v12.0.1 --depth=1 -mkdir build && cd build -cmake -GNinja -DCMAKE_INSTALL_PREFIX= -DLLVM_DIR=/lib/cmake/llvm/ -DHALIDE_ENABLE_RTTI=ON -DWITH_APPS=OFF .. -cmake --build . --target install +#### b. Windows ``` - -### 2. Install onnxruntime (Optional, if you use ion-bb-dnn) -If you use only cpu, you can get binary release. - -```sh -curl -L https://github.com/microsoft/onnxruntime/releases/download/v1.4.0/onnxruntime-linux-x64-1.4.0.tgz | tar zx -C -``` - -### 3. Place additional building blocks (Appendix) -If you want to use additional `ion-bb-xx` directories, place them directly under ` `ion-kit` directory. - - -### 4. Build -```sh -mkdir build && cd build -cmake -GNinja -DCMAKE_INSTALL_PREFIX= -DHalide_DIR= -DONNXRUNTIME_ROOT= ../ -cmake --build . +mkdir build +cd build +cmake -G "Visual Studio 17 2022" -A x64 -DHalide_DIR= -DOpenCV_DIR= ../ +cmake --build . --config Release ``` -### 5. Install +### 3. Install ```sh cmake --build . --target install ``` -### 6. Run examples +### 4. Run examples ```sh ctest ```