Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes CI #190

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 9 additions & 24 deletions .github/workflows/develop.yml → .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Develop
name: Linux

on:
pull_request:
Expand All @@ -20,51 +20,36 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install dependencies
- name: Get latest CMake
uses: lukka/get-cmake@latest

- name: Setup dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y curl cmake build-essential libopencv-dev zlib1g-dev
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*

- name: Download Halide package
run: |
mkdir ${HOME}/halide
curl -L https://github.com/halide/Halide/releases/download/v16.0.0/Halide-16.0.0-x86-64-linux-1e963ff817ef0968cc25d811a25a7350c8953ee6.tar.gz | tar zx -C ${HOME}/halide --strip-components 1
find ${HOME}/halide -type d | xargs chmod 755
sudo cp -r ${HOME}/halide/* /usr/

- name: Download onnxruntime package
run: |
mkdir ${HOME}/onnxruntime
curl -L https://github.com/microsoft/onnxruntime/releases/download/v1.16.3/onnxruntime-linux-x64-1.16.3.tgz | tar zx -C ${HOME}/onnxruntime --strip-components 1
find ${HOME}/onnxruntime -type d | xargs chmod 755
sudo cp -r ${HOME}/onnxruntime/* /usr/

- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/ion-kit/build

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
working-directory: ${{runner.workspace}}/ion-kit/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE $GITHUB_WORKSPACE
- name: Configure
shell: bash
run: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -D ION_BUILD_TEST=ON -D ION_BUILD_EXAMPLE=ON $GITHUB_WORKSPACE

- name: Build
working-directory: ${{runner.workspace}}/ion-kit/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE

- name: Test
working-directory: ${{runner.workspace}}/ion-kit/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
ctest --verbose -v -C $BUILD_TYPE
44 changes: 44 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: MacOS

on:
pull_request:
branches:
- master

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build-and-test:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Get latest CMake
uses: lukka/get-cmake@latest

- name: Setup dependencies
shell: bash
run: |
mkdir ${HOME}/Halide
curl -L https://github.com/halide/Halide/releases/download/v16.0.0/Halide-16.0.0-x86-64-osx-1e963ff817ef0968cc25d811a25a7350c8953ee6.tar.gz | tar zx -C ${HOME}/Halide --strip-components 1
find ${HOME}/Halide -type d | xargs chmod 755

- name: Configure
shell: bash
run: cmake -D CMAKE_BUILD_TYPE=$BUILD_TYPE -D ION_BUILD_TEST=ON -D ION_BUILD_EXAMPLE=ON -D HalideHelpers_DIR=${HOME}/Halide/lib/cmake/HalideHelpers -D Halide_DIR=${HOME}/Halide/lib/cmake/Halide $GITHUB_WORKSPACE

- name: Build
shell: bash
run: cmake --build . --config $BUILD_TYPE

- name: Test
shell: bash
run: |
ctest --verbose -v -C $BUILD_TYPE
50 changes: 50 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Windows

on:
pull_request:
branches:
- master

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build-and-test:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: windows-2019

steps:
- uses: actions/checkout@v4

- name: Get latest CMake
uses: lukka/get-cmake@latest

- name: Setup msbuild
uses: microsoft/setup-msbuild@v1

- name: Setup dependencies
shell: bash
run: |
# Halide
mkdir ${HOME}/Halide
curl -L https://github.com/halide/Halide/releases/download/v16.0.0/Halide-16.0.0-x86-64-windows-1e963ff817ef0968cc25d811a25a7350c8953ee6.zip -o Halide.zip
unzip Halide.zip
rm Halide.zip
mv Halide*/* ${HOME}/Halide

- name: Configure
shell: bash
run: cmake -G "Visual Studio 16 2019" -A x64 -D ION_BUILD_TEST=ON -D ION_BUILD_EXAMPLE=ON -D HalideHelpers_DIR=${HOME}/Halide/lib/cmake/HalideHelpers -D Halide_DIR=${HOME}/Halide/lib/cmake/Halide $GITHUB_WORKSPACE

- name: Build
shell: bash
run: cmake --build . --config $BUILD_TYPE

- name: Test
shell: bash
run: |
ctest --verbose -v -C $BUILD_TYPE
83 changes: 45 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,64 @@
[![Linux](https://github.com/fixstars/ion-kit/workflows/Linux/badge.svg)](https://github.com/fixstars/ion-kit/actions?query=workflow%3ALinux)
[![MacOS](https://github.com/fixstars/ion-kit/workflows/MacOS/badge.svg)](https://github.com/fixstars/ion-kit/actions?query=workflow%3AMacOS)
[![Windows](https://github.com/fixstars/ion-kit/workflows/Windows/badge.svg)](https://github.com/fixstars/ion-kit/actions?query=workflow%3AWindows)

# ion-kit
A framework to compile user-defined pipeline. Current support:
* Linux
* Windows
* MacOS
ion-kit is a graph based image processing framework based on Halide.
User can build pipeline using ion-kit API composing building blocks and compile it into static library or run just in time.

## Depedencies
* [Halide (v16.0.0)](https://github.com/halide/Halide/releases/tag/v16.0.0)
* llvm
* doxygen
* sphinx
* ninja (unix)
* msvc (windows)

### 1. Install
Please follow the instructions provided for your preferred platform.
* [Linux](INSTALL-LINUX.md)
* [Windows](INSTALL-WINDOWS.md)
* [MacOS](INSTALL-MACOS.md)
## Quick start

### 2. Build
#### a. Unix
```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> -DOPENCV_DIR=<path-to-opencv-cmake> ../
cmake --build .
```
#### b. Windows
```
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
```
```c++
int main() {
int32_t min0 = 0, extent0 = 2, min1 = 0, extent1 = 2, v = 1;

### 3. Install
```sh
cmake --build . --target install
```
// ion::Builder is fundamental class to build a graph.
ion::Builder b;

// Load ion building block module. User can create own BB module using ion::BuildingBlock class.
b.with_bb_module("ion-bb-test");

### 4. Run examples
```sh
ctest
// Set the target architecture you will compile to. Here just use host architecture.
b.set_target(ion::get_host_target());

// Create simple graph consists from two nodes.
//
// test_producer -> test_consumer -> r (dummy output)
//
ion::Node n;
n = b.add("test_producer").set_param(ion::Param("v", 41));
n = b.add("test_consumer")(n["output"], &min0, &extent0, &min1, &extent1, &v);

// Allocate dummy output. At least one output is required to run the pipeline.
auto r = ion::Buffer<int32_t>::make_scalar();

// Bind output with test_consumer "output" port.
n["output"].bind(r);

// Run the pipeline. Internally, it is compiled into native code just in time called as a function.
b.run();
}
```

Compile it.

## Build from scratch
Please follow the instructions provided for your preferred platform.
* [Linux](INSTALL-LINUX.md)
* [Windows](INSTALL-WINDOWS.md)
* [MacOS](INSTALL-MACOS.md)

## CMake variables
| Variable | Type | Descriotion |
| ----------------- | ------ | ------------------------------------------------------------------------- |
| ION_BUILD_ALL_BB | ON/OFF | Enable to buld all building blocks. (Default: ON) |
| ION_BBS_TO_BUILD | String | The building blocks of target to build. (This overrides ION_BUILD_ALL_BB) |
| ION_BUILD_DOC | ON/OFF | Enable to bulid documents. (Default: ON) |
| ION_BUILD_TEST | ON/OFF | Enable to bulid tests. (Default: ON) |
| ION_BUILD_EXAMPLE | ON/OFF | Enable to bulid examples. (Default: ON) |
| WITH_CUDA | ON/OFF | Enable CUDA with buliding examples. (Default: ON) |
| ION_BUNDLE_HALIDE | ON/OFF | Bundle Halide when packaging. (Default: OFF) |
| ION_ENABLE_HALIDE_FPGA_BACKEND | ON/OFF | Enable experimental FPGA backend. (Default: OFF) |

## Authors
The ion-kit is an open-source project created by Fixstars Corporation and its subsidiary companies including Fixstars Solutions Inc, Fixstars Autonomous Technologies.
Expand Down
Loading
Loading