MemoDocumentation
EN

Build from Source

Build Memo from the repository. This guide covers Go backend compilation, Flutter frontend build, CGO requirements, and packaging for distribution.

Prerequisites

Tool Version Purpose
Go 1.26+ Backend compiler
Flutter 3.10+ Frontend framework
GCC / Clang Any recent CGO compilation (sqlite-vec)
CMake 3.20+ sqlite-vec build
Git Any recent Clone the repository

Clone

git clone https://github.com/BugraAkdemir/memo.git
cd memo

Backend Build

CGO Flags

SQLite and sqlite-vec require CGO enabled:

export CGO_ENABLED=1

For cross-compilation or custom toolchains, configure the C compiler:

export CC=gcc                  # Linux
export CC=x86_64-w64-mingw32-gcc  # Cross-compile for Windows from Linux

Install Go Dependencies

go mod download

Key dependencies include:

Package Purpose
modernc.org/sqlite Pure-Go SQLite (where no CGO needed)
github.com/ncruces/go-sqlite3 CGO SQLite with vec0 extension
golang.org/x/net HTTP, HTML parsing (web search tool)
google.golang.org/api Google Drive OAuth2
go.mau.fi/whatsmeow WhatsApp Web bridge

Build

CGO_ENABLED=1 go build -o memo .

The output is a single binary memo (~40 MB) containing the full backend.

Run Tests

go test ./... -race -count=1 -timeout 60s

Frontend Build

cd frontend
flutter pub get
flutter build linux --release

The Flutter build outputs to frontend/build/linux/x64/release/bundle/.

Platform-Specific Builds

# Windows (from Windows or cross-compile)
flutter build windows --release

# macOS
flutter build macos --release

# Android (companion app)
flutter build apk --release

# iOS (requires macOS)
flutter build ios --release

Frontend Checks

cd frontend
flutter analyze lib/
flutter test

sqlite-vec Compilation

The sqlite-vec (vec0) extension is compiled from C source during the Go build. If you encounter build errors:

# Ensure sqlite3 dev headers are available
# Debian/Ubuntu
sudo apt install libsqlite3-dev

# Fedora
sudo dnf install sqlite-devel

# macOS
brew install sqlite

# Clean and rebuild
go clean -cache
CGO_ENABLED=1 go build -o memo .


The sqlite-vec library targets vec0 — a virtual table extension for approximate nearest neighbor (ANN) vector search using quantization. It is not bundled as a separate binary; it's embedded in the Go binary via CGO.

Packaging Script

The repository includes build_releases.sh for creating distributable packages:

./build_releases.sh

This script:

  1. Builds the Go backend for all target platforms
  2. Builds the Flutter frontend for desktop platforms
  3. Bundles llama-server and vec0 engine binaries
  4. Creates platform-specific installers

Output Formats

Format Platform Contents
.exe Windows NSIS installer with bundled dependencies
.AppImage Linux (universal) Self-contained AppImage
.deb Debian/Ubuntu dpkg package
.tar.gz Linux portable Standalone directory
.zip macOS Universal .app bundle
.apk Android Flutter companion app

Linux Packaging Details

The packaging script for Linux uses:

# AppImage - uses linuxdeploy with AppImage plugin
linuxdeploy --appdir AppDir --plugin gtk --output appimage

# .deb - standard dpkg-deb
dpkg-deb --build memo-deb

# .tar.gz - simple archive
tar -czf Memo-linux-x64-v3.1.2-beta.tar.gz memo/

Windows Packaging Details

Windows packaging requires:

  • NSIS installer framework
  • MSYS2/MinGW for CGO cross-compilation (if building from Linux)
  • DLL bundling for GTK, SQLite, and OpenGL dependencies
# From Linux with MinGW cross-compiler
CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows go build -o memo.exe .

# Flutter
flutter build windows --release

# Package with NSIS
makensis memo-installer.nsi

Distribution Checklist

Before publishing a release:

  • go test ./... -race passes on all target platforms
  • flutter analyze lib/ passes
  • flutter test passes
  • llama-server and vec0 binaries are bundled and version-matched
  • Installers are tested on clean VMs for each platform
  • Release notes (versionNoteEN.md, versionNoteTR.md) are updated
  • GitHub release is created with all artifacts
  • Download portal at memo.bugradev.com is updated

Continuous Integration

GitHub Actions workflows (ci.yml) run on every push to main:

  • Go tests with race detector
  • Flutter analyze and test
  • Cross-platform build matrix (Linux, Windows, macOS)
  • Artifact upload for verified builds

For the CI configuration, see .github/workflows/ in the repository.