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

Tips to compile for armv7l linux #3

Closed
arthurlutz opened this issue Apr 19, 2021 · 3 comments
Closed

Tips to compile for armv7l linux #3

arthurlutz opened this issue Apr 19, 2021 · 3 comments

Comments

@arthurlutz
Copy link

Hi,

Project looks awesome, congrats!

Am trying to compile it for armv7l (more specifically the gameshell by clockworkpi https://www.clockworkpi.com/ with a debian bullseye/sid installed)

cpi@clockworkpi :~/CopperBoy/sdl$ cargo --version
cargo 1.46.0
cpi@clockworkpi :~/CopperBoy/sdl$ rustc --version
rustc 1.48.0
cpi@clockworkpi :~/CopperBoy/sdl$ uname -a
Linux clockworkpi  5.7.0-clockworkpi-cpi3-g5c715d2cd-dirty #1 SMP Sun Jul 12 20:21:02 CEST 2020 armv7l GNU/Linux
cpi@clockworkpi :~/CopperBoy/sdl$ cargo build --release --target armv7-unknown-linux-gnueabi --bin sdl
   Compiling stable_deref_trait v1.2.0
   Compiling byteorder v1.4.2
   Compiling once_cell v1.5.2
   Compiling cfg-if v1.0.0
error[E0463]: can't find crate for `core`
  |
  = note: the `armv7-unknown-linux-gnueabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `core`
  |
  = note: the `armv7-unknown-linux-gnueabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `stable_deref_trait`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `core`
  |
  = note: the `armv7-unknown-linux-gnueabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
  |
  = note: the `armv7-unknown-linux-gnueabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: build failed

Am a bit new to this cargo/rustc stuff and so I'm not even sure that the target is correct.

cpi@clockworkpi :~/CopperBoy/sdl$ rustc --print target-list | grep arm
arm-linux-androideabi
arm-unknown-linux-gnueabi
arm-unknown-linux-gnueabihf
arm-unknown-linux-musleabi
arm-unknown-linux-musleabihf
armebv7r-none-eabi
armebv7r-none-eabihf
armv4t-unknown-linux-gnueabi
armv5te-unknown-linux-gnueabi
armv5te-unknown-linux-musleabi
armv6-unknown-freebsd
armv6-unknown-netbsd-eabihf
armv7-apple-ios
armv7-linux-androideabi
armv7-unknown-cloudabi-eabihf
armv7-unknown-freebsd
armv7-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
armv7-unknown-linux-musleabi
armv7-unknown-linux-musleabihf
armv7-unknown-netbsd-eabihf
armv7-wrs-vxworks-eabihf
armv7a-none-eabi
armv7a-none-eabihf
armv7r-none-eabi
armv7r-none-eabihf
armv7s-apple-ios

If you have any tips, they would be welcome.

@arthurlutz
Copy link
Author

While trying to figure this out, I tried to install rustup and it stated that the arch was armv7-unknown-linux-gnueabihf. Building on that hardware worked. Will come back and comment when I get something working.

@arthurlutz
Copy link
Author

arthurlutz commented Apr 19, 2021

Got it compiling and "running" - it's weirdly laggy and probably needs a keymap but here is a first glimpse :

Video on imgur : https://imgur.com/AfWfeLT

@Dhole
Copy link
Owner

Dhole commented Apr 21, 2021

Got it compiling and "running" - it's weirdly laggy and probably needs a keymap but here is a first glimpse :

Video on imgur : https://imgur.com/AfWfeLT

I'm glad to hear that you got it running! And thanks for sharing the video :)

Regarding the performance:

  1. I've managed to build Copperboy for the PSVita via the libretro implementation, and I managed to get around 80% speed in some games. The PSVita is an 32bit ARM at 333/444MHz. Considering that the clockworkPi is using the Raspberry Pi Compute Module 3 which has a 64bit ARM core at 1.2GHz, I believe there is potential for Copperboy to run at fullspeed without trouble.
  2. The sdl frontend currently has some code useful for debugging that may be affecting performance. On the other hand, the libretro implementation has no such code and may perform much better.

Regarding the libretro build, if you take a look at the scripts inside https://github.com/Dhole/CopperBoy/tree/master/ci you'll see how I'm currently doing builds of the libretro version. For ARM linux you should be able to adapt what's happening in build-libretro.sh but setting your particular target. That should build a dynamic library that you can then load with retroarch for example.

@Dhole Dhole closed this as completed Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants