|
picceler
A compiled DSL for image processing, built on MLIR
|
This document aims to provide all the necessary information to get picceler to build on your system.
We recommend building on Linux, and the following commands assume you are running Linux, but it is likely for picceler to build on Windows as well.
We currently have the following dependencies:
For spdlog, googletest and opencv you can likely install them via your system's package manager.
Otherwise, you can manually build & install these libraries
googletest
spdlog
opencv
For MLIR and CLI11 you are much less likely to have them available via your system's package manager so we need to build them manually:
CLI11
MLIR
Building MLIR is expensive and will take you a long time compared to the other dependencies. Here are some tips to make it faster:
The command below expects you have Ninja & lld installed. Modify accordingly if not installed
Make sure you do not skip on any of these cmake options, otherwise your MLIR installation is ill-formed.
If compilation was successful, ./picceler is your compiler driver for .pic source files (usage below; see LANGUAGE.md for the language itself). All binaries build straight into build/, alongside it: ./picceler-opt runs standalone passes over .mlir files for testing, and ./picceler-mlir-lsp-server backs editor tooling for the picceler dialect.
These are set with -D<OPTION>=<ON|OFF> at the cmake .. configure step, e.g. cmake .. -DENABLE_DOCS=ON.
| Option | Default | What it does |
|---|---|---|
| ENABLE_TESTS | ON | Adds the tests/ subdirectory (unit tests + MLIR lit tests, see "Running tests" below). |
| ENABLE_E2E_TESTS | ON | Adds the e2e lit suite (tests/lit/e2e/, the e2e build target). Set to OFF to skip building/copying it, e.g. if lit isn't available. |
| ENABLE_CLANG_TIDY | OFF | Runs clang-tidy as part of the normal build (-warnings-as-errors=*), using the project's .clang-tidy config. Requires clang-tidy to be on your PATH. |
| ENABLE_DOCS | OFF | Adds a doc_doxygen build target that generates the Doxygen API docs into docs/html/ (requires Doxygen to be installed). Build it explicitly with cmake --build . --target doc_doxygen. |
| ENABLE_BENCH | ON | Adds the bench/ subdirectory, building the standalone reference_bench binary (naive C++ vs OpenCV timings; no MLIR/picceler runtime dependency). |
If you don't pass -DCMAKE_BUILD_TYPE, the project defaults to RelWithDebInfo. The usual CMake build types are supported: Debug, Release, RelWithDebInfo.
With the defaults (ENABLE_TESTS=ON, ENABLE_E2E_TESTS=ON), three independent test suites are built — see tests/README.md for what each one covers and how to add a case.
Unit tests (GoogleTest, tests/unit/) — build and run the unittests binary:
MLIR lit tests (tests/lit/mlir/) and e2e tests (tests/lit/e2e/) — both use lit/FileCheck (the LLVM test runner needs to be on your PATH), and both have a CMake target that builds whatever they need and runs lit in one step:
All three suites run in CI on every pull request (.github/workflows/unit_tests.yaml, lit_mlir_tests.yaml, e2e_tests.yaml).
There is currently no install() rule wired up in the CMake configuration, so cmake --install . is a no-op today — this section is a placeholder for that work. For now, run the built binaries directly out of build/, or add build/ to your PATH yourself.