greenfield-cmd icon indicating copy to clipboard operation
greenfield-cmd copied to clipboard

building on linux

Open cemleme opened this issue 2 years ago • 4 comments

When try to build on linux servers (tried on different version, Amazon Linux and Ubuntu)

I receive error on make build command, on bls-eth-go part.

I was only able to build this on macOS arm architecture.

do I miss anything?

tried with: go version go1.20 go version go1.21

go build -o ./build/gnfd-cmd cmd/*.go
# github.com/cometbft/cometbft/votepool
../go/pkg/mod/github.com/bnb-chain/[email protected]/votepool/verifier.go:89:25: undefined: blst.PublicKeyFromBytes
../go/pkg/mod/github.com/bnb-chain/[email protected]/votepool/verifier.go:93:25: undefined: blst.SignatureFromBytes
# github.com/herumi/bls-eth-go-binary/bls
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:9:28: undefined: SecretKey
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:9:40: undefined: Fr
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:13:26: undefined: Fr
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:13:31: undefined: SecretKey
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:19:28: undefined: PublicKey
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:19:40: undefined: G1
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:23:26: undefined: G1
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:23:31: undefined: PublicKey
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:23: undefined: Sign
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:30: undefined: G2
../go/pkg/mod/github.com/herumi/[email protected]/bls/cast.go:29:30: too many errors
make: *** [Makefile:6: build] Error 1

cemleme avatar Sep 04 '23 17:09 cemleme

which version did you use to build?

CocoStarZ avatar Sep 04 '23 23:09 CocoStarZ

latest version

cemleme avatar Sep 05 '23 04:09 cemleme

export CGO_CFLAGS="-O -D__BLST_PORTABLE__" 
export CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"

Pls try with the above env set and rebuild with the latest version. blst has problem in some old CPU.

The latest released version provides binary files for Linux environment and mac. You can also directly download the corresponding binary files of the released version and use.

flywukong avatar Nov 21 '23 06:11 flywukong

I too am facinf same issue @cemleme has mentioned . how can i resolve this ?

sudharsansubash2002 avatar Dec 28 '23 06:12 sudharsansubash2002