erigon icon indicating copy to clipboard operation
erigon copied to clipboard

Can't compile erigon on linux amd64

Open ArielTM opened this issue 2 years ago • 4 comments

System information

Erigon version: tag: v2.57.0

OS & Version: Linux

Commit hash: 4f6eda7694b4f33d2f907b40088e3a83192b5c2c

Erigon Command (with flags/config): make erigon

Expected behaviour

Compile success

Actual behaviour

Building erigon
# github.com/ledgerwatch/erigon/cmd/erigon
/snap/go/current/pkg/tool/linux_arm64/link: running g++ failed: exit status 1
/usr/bin/ld: cannot find -lsilkworm_capi: No such file or directory
collect2: error: ld returned 1 exit status

make: *** [Makefile:109: erigon.cmd] Error 1

When trying with clang: CC=clang-12 CXX=clang++-12 CFLAGS="-O3" make erigon

Building erigon
# github.com/ledgerwatch/erigon/cmd/erigon
/snap/go/current/pkg/tool/linux_arm64/link: running clang++-12 failed: exit status 1
clang: error: no such file or directory: '/root/go/pkg/mod/github.com/erigontech/[email protected]/lib/linux_arm64'

make: *** [Makefile:109: erigon.cmd] Error 1

ArielTM avatar Jan 24 '24 09:01 ArielTM

me too, I use it in arm64

BeamNawapat avatar Jan 30 '24 19:01 BeamNawapat

Looks like solution for your issue as well: https://github.com/ledgerwatch/erigon/issues/9391

tripplegreen avatar Feb 07 '24 18:02 tripplegreen

@AskAlexSharov - duplicate #9391

tripplegreen avatar Feb 07 '24 18:02 tripplegreen

Don't see how #9391 solves this. tried running make evm and the result is the same.

Still can't compile v2.58.0 -

bash# CC=clang-12 CXX=clang++-12 CFLAGS="-O3" make erigon
Building erigon
go: downloading github.com/spf13/cobra v1.8.0
go: downloading github.com/erigontech/mdbx-go v0.27.22
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.3
go: downloading golang.org/x/net v0.20.0
go: downloading golang.org/x/crypto v0.18.0
go: downloading github.com/ledgerwatch/erigon-snapshot v1.3.1-0.20240214034330-a436079c93ec
go: downloading github.com/emicklei/dot v1.6.1
go: downloading github.com/erigontech/silkworm-go v0.12.0
# github.com/ledgerwatch/erigon/cmd/erigon
/snap/go/current/pkg/tool/linux_arm64/link: running clang++-12 failed: exit status 1
clang: error: no such file or directory: '/root/go/pkg/mod/github.com/erigontech/[email protected]/lib/linux_arm64'

make: *** [Makefile:109: erigon.cmd] Error 1

ArielTM avatar Feb 16 '24 09:02 ArielTM

@ArielTM , which Linux flavour/version do you use? There's probably a bug in this script on your system. Could you run it and see what it outputs using this command?

./turbo/silkworm/silkworm_lib_path.sh

Also if you could show the output of go env it might help to understand.

Also if you could search with find / erigontech to find where did it actually downloaded go: downloading github.com/erigontech/silkworm-go v0.12.0 (since is not found in /root/go/pkg/mod, I assume that it is downloaded at some other location).

battlmonstr avatar Apr 10 '24 15:04 battlmonstr

@battlmonstr my linux version: Ubuntu 22.04.4 LTS aarch64

Running the mentioned script:

/root/go/pkg/mod/github.com/erigontech/[email protected]/lib/linux_arm64/libsilkworm_capi.so

go env:

GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/snap/go/current"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/snap/go/current/pkg/tool/linux_arm64"
GOVCS=""
GOVERSION="go1.20.14"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/erigon/erigon/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2665737319=/tmp/go-build -gno-record-gcc-switches"

It did download github.com/erigontech/silkworm-go , the linux_arm64 is just not in there:

find /root/go/pkg/mod/github.com/erigontech/[email protected]/
/root/go/pkg/mod/github.com/erigontech/[email protected]/
/root/go/pkg/mod/github.com/erigontech/[email protected]/link_linux_x64.go
/root/go/pkg/mod/github.com/erigontech/[email protected]/.gitignore
/root/go/pkg/mod/github.com/erigontech/[email protected]/.github
/root/go/pkg/mod/github.com/erigontech/[email protected]/.github/workflows
/root/go/pkg/mod/github.com/erigontech/[email protected]/.github/workflows/release.yml
/root/go/pkg/mod/github.com/erigontech/[email protected]/LICENSE
/root/go/pkg/mod/github.com/erigontech/[email protected]/include
/root/go/pkg/mod/github.com/erigontech/[email protected]/include/silkworm.h
/root/go/pkg/mod/github.com/erigontech/[email protected]/include/readme.txt
/root/go/pkg/mod/github.com/erigontech/[email protected]/ci
/root/go/pkg/mod/github.com/erigontech/[email protected]/ci/release_branch.sh
/root/go/pkg/mod/github.com/erigontech/[email protected]/ci/release.sh
/root/go/pkg/mod/github.com/erigontech/[email protected]/lib
/root/go/pkg/mod/github.com/erigontech/[email protected]/lib/readme.txt
/root/go/pkg/mod/github.com/erigontech/[email protected]/lib/macos_arm64
/root/go/pkg/mod/github.com/erigontech/[email protected]/lib/macos_arm64/libsilkworm_capi.dylib
/root/go/pkg/mod/github.com/erigontech/[email protected]/lib/linux_x64
/root/go/pkg/mod/github.com/erigontech/[email protected]/lib/linux_x64/libsilkworm_capi.so
/root/go/pkg/mod/github.com/erigontech/[email protected]/lib/macos_x64
/root/go/pkg/mod/github.com/erigontech/[email protected]/lib/macos_x64/libsilkworm_capi.dylib
/root/go/pkg/mod/github.com/erigontech/[email protected]/bindings_test.go
/root/go/pkg/mod/github.com/erigontech/[email protected]/bindings_stub.go
/root/go/pkg/mod/github.com/erigontech/[email protected]/link_macos_arm64.go
/root/go/pkg/mod/github.com/erigontech/[email protected]/.circleci
/root/go/pkg/mod/github.com/erigontech/[email protected]/.circleci/config.yml
/root/go/pkg/mod/github.com/erigontech/[email protected]/README.md
/root/go/pkg/mod/github.com/erigontech/[email protected]/link_macos_x64.go
/root/go/pkg/mod/github.com/erigontech/[email protected]/link_linux_arm64.go
/root/go/pkg/mod/github.com/erigontech/[email protected]/go.mod
/root/go/pkg/mod/github.com/erigontech/[email protected]/snapshot_types.go
/root/go/pkg/mod/github.com/erigontech/[email protected]/bindings.go

ArielTM avatar Apr 10 '24 17:04 ArielTM

@ArielTM Thanks for the update. I got confused, because the issue title was amd64, but your system is in fact arm64. Unfortunately ARM is not supported by this script. We'll need to update our Makefile to take this into account.

A workaround is to build with nosilkworm tag using this command:

make BUILD_TAGS=nosqlite,noboltdb,nosilkworm erigon

battlmonstr avatar Apr 11 '24 07:04 battlmonstr

My bad @battlmonstr . I'm terribly sorry. Indeed I meant arm64 🤦

ArielTM avatar Apr 11 '24 16:04 ArielTM