Skip to content

Commit

Permalink
Merge branch 'master' into feature/restructure-port-map
Browse files Browse the repository at this point in the history
  • Loading branch information
iitaku authored Jan 2, 2024
2 parents 9f7c693 + 05b7606 commit 66160ac
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 42 deletions.
71 changes: 71 additions & 0 deletions INSTALL-LINUX.md
Original file line number Diff line number Diff line change
@@ -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 <path-to-halide-install>
```

#### 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=<path-to-llvm-install> -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=<path-to-halide-install> -DLLVM_DIR=<path-to-llvm-install>/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 <path-to-onnxruntime-install>
```

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
```


63 changes: 63 additions & 0 deletions INSTALL-MACOS.md
Original file line number Diff line number Diff line change
@@ -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 <path-to-halide-install>
```
#### 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=<path-to-llvm-install> -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=<path-to-halide-install> -DLLVM_DIR=<path-to-llvm-install>/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
```
23 changes: 23 additions & 0 deletions INSTALL-WINDOWS.md
Original file line number Diff line number Diff line change
@@ -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.
66 changes: 24 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <path-to-halide-install>
```

#### 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=<path-to-llvm-install> -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=<path-to-ion-kit-install> -DHalide_DIR=<path-to-HalideConfig.cmake> -DONNXRUNTIME_ROOT=<path-to-onnxruntime-root> -DOPENCV_DIR=<path-to-opencv-cmake> ../
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=<path-to-halide-install> -DLLVM_DIR=<path-to-llvm-install>/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 <path-to-onnxruntime-install>
```

### 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=<path-to-ion-kit-install> -DHalide_DIR=<path-to-HalideConfig.cmake> -DONNXRUNTIME_ROOT=<path-to-onnxruntime-root> ../
cmake --build .
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A x64 -DHalide_DIR=<path-to-HalideConfig.cmake> -DOpenCV_DIR=<path-to-opencv-cmake> ../
cmake --build . --config Release
```

### 5. Install
### 3. Install
```sh
cmake --build . --target install
```

### 6. Run examples
### 4. Run examples
```sh
ctest
```
Expand Down

0 comments on commit 66160ac

Please sign in to comment.