The project is built using Go 1.13+.
Install libvips:
port install vips (using MacPorts)Build the nuggan executable from source:
go build
Run the full test suite:
go test -v nuggan
The build system uses a compiler wrapper script (scripts/cc-sse.sh) to automatically handle SSE (SIMD) support based on your platform.
Set the CC environment variable to the absolute path of the wrapper script before building:
CC="$PWD/scripts/cc-sse.sh" go build
CC="$PWD/scripts/cc-sse.sh" go test -v nuggan
The wrapper automatically detects your platform:
Explicitly control SSE support using the NUGGAN_USE_SSE environment variable:
NUGGAN_USE_SSE=0 (or false, no, off) — Explicitly disable SSENUGGAN_USE_SSE=1 (or true, yes, on) — Explicitly enable SSE (may fail on ARM64)ARM64 (SSE auto-disabled):
CC="$PWD/scripts/cc-sse.sh" go build
Explicitly disable SSE:
NUGGAN_USE_SSE=0 CC="$PWD/scripts/cc-sse.sh" go build
Run tests with SSE wrapper:
CC="$PWD/scripts/cc-sse.sh" go test -v nuggan
Image output differs slightly when SSE is disabled due to different quantization algorithms. This is expected and normal. Output remains deterministic and valid across builds.
If you’re on an Apple Silicon host or your local libvips setup differs from CI requirements, run tests in Docker using the CI environment:
docker run --rm --platform linux/amd64 \
-v "$PWD":/go/src/github.com/cchantep/nuggan \
-w /go/src/github.com/cchantep/nuggan \
cchantep/golang:1.26-vips \
/bin/sh -lc 'export PATH=/usr/local/go/bin:$PATH; go test -v nuggan'
This runs the exact test environment used in CI with x86_64 architecture and all dependencies properly configured.