Go supports cross-compiling binaries for multiple platforms which applies to eKuiper as well. Because eKuiper depends on sqlite, CGO_ENABLED must be set to 1 which requires to install and specify the gcc of the target system.
GOOS
, GOARCH
and CC
and then build.For example, to cross build ARM64 binaries in AMD64 ubuntu/debian machine, do these steps:
shell
apt-get install gcc-aarch64-linux-gnu
shell
GO111MODULE=on CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc go build -trimpath -ldflags="-s -w -X main.Version=$(VERSION) -X main.LoadFileType=relative" -o kuiperd cmd/kuiperd/main.go
make