Ask questionsWindows build


I am trying to cross-compile for Windows, from Linux (with go1.12 linux/amd64, gcc version 7.4).

I have added the following to app/victoria-metrics/makefile:

	CGO_ENABLED=1 GOARCH=amd64 GO111MODULE=on go build -mod=vendor -ldflags "$(GO_BUILDINFO)" -o bin/victoria-metrics-amd64.exe ./app/victoria-metrics

I then ran GOOS=windows GOARCH=amd64 make victoria-metrics-amd64 with this result:

# runtime/cgo
gcc: error: unrecognized command line option ‘-mthreads’; did you mean ‘-pthread’?
lib/memory/memory.go:31:10: undefined: sysTotalMemory
app/victoria-metrics/Makefile:30: recipe for target 'victoria-metrics-amd64' failed
make: *** [victoria-metrics-amd64] Error 2

I do not have enough experience to proceed. Maybe you can help? Also, knowing the archictecture, is it feasible to run vm single node on Windows?

Thank you.


Answer questions valyala

Unfortunately VictoriaMetrics isn't intended to run under Windows. But it would be great if somebody will add missing bits for running under Windows. I added missing stubs, but there is remaining problem with gozstd. It would be great if somebody could solve it. gozstd should already support Windows, but it wasn't tested and is outdated now.

Github User Rank List