kaspanet / kaspad

Kaspad was the reference full node Kaspa implementation written in Go (golang), now rewritten in Rust: https://github.com/kaspanet/rusty-kaspa
ISC License
447 stars 228 forks source link

installing kaspad and all dependencies fails due to muhash.go #2201

Open dstark1993 opened 1 year ago

dstark1993 commented 1 year ago

After cloning https://github.com/kaspanet/kaspad and running '''install . ./cmd/...''' from the kaspad directory, there are several errors because of muhash (I presume is the type declaration?).

image

OS: Windows 10 64bit Golang: version go1.20.2 windows/amd64

kennethffx2 commented 11 months ago

This happens to me also.

arkadd61 commented 9 months ago

Same here, is there a fix for it?

lemois-1337 commented 6 months ago

First option: Install gcc on Windows, set CGO_ENABLED=1 environment variable before compilation so that it compiles the C part during go build:

CGO_ENABLED=1 go build -v -tags netgo,osusergo -o ./bin/ . ./cmd/...

Optionally you can also set CC environment variable if multiple gcc installation exists.

Second option: Cross compile on Linux for Windows:

CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -v -tags netgo,osusergo -o ./bin/ . ./cmd/...

If needed extend both with -s and -w for striping to get smaller binaries and -extldflags=-static for static linking.

ppbbgg110 commented 2 months ago

First option: Install gcc on Windows, set CGO_ENABLED=1 environment variable before compilation so that it compiles the C part during go build:第一个选项:在 Windows 上安装 gcc ,在编译前设置 CGO_ENABLED=1 环境变量,以便在 go 构建期间编译 C 部分:

CGO_ENABLED=1 go build -v -tags netgo,osusergo -o ./bin/ . ./cmd/...

Optionally you can also set CC environment variable if multiple gcc installation exists.(可选)如果存在多个 gcc 安装,您还可以设置 CC 环境变量。

Second option: Cross compile on Linux for Windows:

CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -v -tags netgo,osusergo -o ./bin/ . ./cmd/...

If needed extend both with -s and -w for striping to get smaller binaries and -extldflags=-static for static linking.如果需要,可以扩展 with -s-w for striping,以获得较小的二进制文件和 -extldflags=-static 静态链接。

GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build -ldflags="-s -w" -tags="netgo osusergo" -o output_fil ename

runtime/cgo

gcc_arm64.S: Assembler messages: gcc_arm64.S:30: 错误: no such instruction: stp x29,x30,[sp,' gcc_arm64.S:34: 错误: operand size mismatch formov' gcc_arm64.S:36: 错误: no such instruction: stp x19,x20,[sp,' gcc_arm64.S:39: 错误: no such instruction:stp x21,x22,[sp,' gcc_arm64.S:42: 错误: no such instruction: stp x23,x24,[sp,' gcc_arm64.S:45: 错误: no such instruction:stp x25,x26,[sp,' gcc_arm64.S:48: 错误: no such instruction: stp x27,x28,[sp,' gcc_arm64.S:52: 错误: operand size mismatch formov' gcc_arm64.S:53: 错误: operand size mismatch for mov' gcc_arm64.S:54: 错误: operand size mismatch formov' gcc_arm64.S:56: 错误: no such instruction: blr x20' gcc_arm64.S:57: 错误: no such instruction:blr x19' gcc_arm64.S:59: 错误: no such instruction: ldp x27,x28,[sp,' gcc_arm64.S:62: 错误: no such instruction:ldp x25,x26,[sp,' gcc_arm64.S:65: 错误: no such instruction: ldp x23,x24,[sp,' gcc_arm64.S:68: 错误: no such instruction:ldp x21,x22,[sp,' gcc_arm64.S:71: 错误: no such instruction: ldp x19,x20,[sp,' gcc_arm64.S:74: 错误: no such instruction:ldp x29,x30,[sp],'