Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile erigon on ARM Linux #9299

Closed
ArielTM opened this issue Jan 24, 2024 · 8 comments · Fixed by #9914
Closed

Can't compile erigon on ARM Linux #9299

ArielTM opened this issue Jan 24, 2024 · 8 comments · Fixed by #9914

Comments

@ArielTM
Copy link
Contributor

ArielTM commented Jan 24, 2024

System information

Erigon version: tag: v2.57.0

OS & Version: Linux

Commit hash: 4f6eda7

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/silkworm-go@v0.10.0/lib/linux_arm64'

make: *** [Makefile:109: erigon.cmd] Error 1
@BeamNawapat
Copy link

me too, I use it in arm64

@tripplegreen
Copy link
Contributor

Looks like solution for your issue as well:
#9391

@tripplegreen
Copy link
Contributor

@AskAlexSharov - duplicate #9391

@ArielTM
Copy link
Contributor Author

ArielTM commented Feb 16, 2024

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/silkworm-go@v0.12.0/lib/linux_arm64'

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

@battlmonstr
Copy link
Collaborator

@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).

@ArielTM
Copy link
Contributor Author

ArielTM commented Apr 10, 2024

@battlmonstr my linux version: Ubuntu 22.04.4 LTS aarch64

Running the mentioned script:

/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/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/silkworm-go@v0.14.0/
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/link_linux_x64.go
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/.gitignore
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/.github
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/.github/workflows
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/.github/workflows/release.yml
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/LICENSE
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/include
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/include/silkworm.h
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/include/readme.txt
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/ci
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/ci/release_branch.sh
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/ci/release.sh
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/lib
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/lib/readme.txt
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/lib/macos_arm64
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/lib/macos_arm64/libsilkworm_capi.dylib
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/lib/linux_x64
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/lib/linux_x64/libsilkworm_capi.so
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/lib/macos_x64
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/lib/macos_x64/libsilkworm_capi.dylib
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/bindings_test.go
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/bindings_stub.go
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/link_macos_arm64.go
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/.circleci
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/.circleci/config.yml
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/README.md
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/link_macos_x64.go
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/link_linux_arm64.go
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/go.mod
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/snapshot_types.go
/root/go/pkg/mod/github.com/erigontech/silkworm-go@v0.14.0/bindings.go

@battlmonstr
Copy link
Collaborator

@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 battlmonstr changed the title Can't compile erigon on linux amd64 Can't compile erigon on ARM Linux Apr 11, 2024
@ArielTM
Copy link
Contributor Author

ArielTM commented Apr 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants