Venus: cross-compile the arm/arm64 binary

Created on 20 Feb 2019  ·  15Comments  ·  Source: filecoin-project/venus

Description

We tried to cross-compile the arm/arm64 environment executable, but encountered a lot of dependencies, can you give me some advice? Do you have an arm/arm64 version development plan?

Acceptance criteria

arm/arm64 binary

Risks + pitfalls

none

Where to begin

Always

Most helpful comment

@whyrusleeping This arm/arm64 version can be run normally using the leveldb storage method. Thank you for your support.
image

image
image
image

All 15 comments

@wyblyf could you paste the failures you encountered?

@whyrusleeping The following problems were encountered when compiling file-coin:
image
Exported coredump tips: “/usr/bin/qemu-aarch64-static /tmp/go-build825887773/b001/exe/main build”
image
But the /tmp/go-build825887773/b001/exe/main file does not exist, I can't execute crash to view more stack information.

And I have the following questions about cross compilation:
1.Does the CC and GCCGO tools need to specify the corresponding platform?
image

  1. Do tools such as rust, rust-proofs, and bls-signatures need to be mapped to the platform?
    image

Thanks.

You cannot build go-filecoin without CGO, so setting CGO_ENABLED=0 will definitely not work.

Are you able to do the build on the arm platform itself? (not cross compiling?)

@phritz is there a way we can build without having to generate all the groth parameters? That seems like an annoying extra step to force in all situations.

@whyrusleeping I compile with "GOOS=linux GOARCH=arm64 go run ./build/*.go build" and the final result is also a failure.
image

Native compilation is able to success generate executable files normally
image

Now I am trying to build a build environment on the arm64 platform, I hope I can have a good luck, and I will have feedback in time.

you will need to compile rust-proofs and bls-signatures manually using the appropriate targets. the default commands used build it for the platform you are on.
https://github.com/japaric/rust-cross is a tool I used in the past for doing that

On 21. Feb 2019, 07:44 +0100, reach notifications@github.com, wrote:

@whyrusleeping I compile with "GOOS=linux GOARCH=arm64 go run ./build/*.go build" and the final result is also a failure.
Native compilation is able to success generate executable files normally
Now I am trying to build a build environment on the arm64 platform, I hope I can have a good luck, and I will have feedback in time.

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@dignifiedquire I put the file-coin project on the arm64 platform to compile. When I executed the "make deps" command to install the dependency package, I encountered a problem:
image

I think it is caused by the wrong package( x86-64 ) downloaded by scripts/install-rust-proofs.sh
image

So I downloaded the rust-proofs source code and tried to compile, but I can't get target files such as paramcache.
image

image

How can I compile to get release files?
image

@laser, can you help with this?

Hey @wyblyf, we currently do not officially support ARM architectures. Support is in the plan down the road, but I'm afraid we won't be getting to it any time soon.

@rosalinekarr Already compile the binary, but can't initialize --devnet-user!!
image
image

image

@wyblyf ah yeah, thats badger not working on arm. We can get around that by using leveldb (or some other datastore) probably. Datastore types are technically configurable: https://github.com/filecoin-project/go-filecoin/blob/master/repo/fsrepo.go#L320 But theres only one type... we would need to add in leveldb or something there.

In addition, it also looks like someone added code to open up two different badger datastores here: https://github.com/filecoin-project/go-filecoin/blob/master/repo/fsrepo.go#L347 This is a bug IMO, and we should just be using one datastore (so its configurable in just one place).

You could probably get things working hackily by modifying the code and changing all the badger references to use leveldb (via this package: https://github.com/ipfs/go-ds-leveldb)

In the meantime, i'll open an issue to make the datastores configurable.

@whyrusleeping Yes, I agree with you, the badger not working on arm. The following is the comparison test result:

  1. In x86-64 environment, test is successful
    image
  2. In arm64 environment, test is failure
    image
    image

I will follow your suggestion, hackily by modifying the code and changing all the badger references to use leveldb. Thanks for your suggestion.

When is the ARM/ARM64 architecture expected to be supported?

@whyrusleeping This arm/arm64 version can be run normally using the leveldb storage method. Thank you for your support.
image

image
image
image

@loulancn once issue #2070 is fixed, we should have slightly better arm support. right now, you have to manually patch the code like @wyblyf did.

@ rosalinekarr once I compiled rust-proofs and bls-signatures for my target, what should I do fro here to file-coin project?

you will need to compile rust-proofs and bls-signatures manually using the appropriate targets. the default commands used build it for the platform you are on. https://github.com/japaric/rust-cross is a tool I used in the past for doing that

Was this page helpful?
0 / 5 - 0 ratings