bnb-chain / greenfield-cmd

support cmd tool for Greenfield
GNU Lesser General Public License v3.0
27 stars 12 forks source link

building on linux #86

Open cemleme opened 10 months ago

cemleme commented 10 months ago

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/greenfield-cometbft@v0.0.3/votepool/verifier.go:89:25: undefined: blst.PublicKeyFromBytes
../go/pkg/mod/github.com/bnb-chain/greenfield-cometbft@v0.0.3/votepool/verifier.go:93:25: undefined: blst.SignatureFromBytes
# github.com/herumi/bls-eth-go-binary/bls
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:9:28: undefined: SecretKey
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:9:40: undefined: Fr
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:13:26: undefined: Fr
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:13:31: undefined: SecretKey
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:19:28: undefined: PublicKey
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:19:40: undefined: G1
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:23:26: undefined: G1
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:23:31: undefined: PublicKey
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:29:23: undefined: Sign
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:29:30: undefined: G2
../go/pkg/mod/github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e/bls/cast.go:29:30: too many errors
make: *** [Makefile:6: build] Error 1
CocoStarZ commented 10 months ago

which version did you use to build?

cemleme commented 10 months ago

latest version

flywukong commented 8 months ago
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.

sudharsansubash2002 commented 7 months ago

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