jordanbray / chess

A rust library to manage chess move generation
https://jordanbray.github.io/chess/
MIT License
234 stars 54 forks source link

Build fails on arm (raspberry pi) #26

Closed UlisseMini closed 3 years ago

UlisseMini commented 4 years ago
   Compiling chess v3.1.1
error[E0432]: unresolved import `std::arch::x86_64`
 --> /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/chess-3.1.1/src/gen_tables/bmis.rs:1:16
  |
1 | use std::arch::x86_64::_pext_u64;
  |                ^^^^^^ could not find `x86_64` in `arch`

If I have time i'll PR a fix, from my limited understanding I think this is only there for efficiency so it should be as simple as not importing for arm.

edit: Maybe consider using https://docs.rs/bitintr

jordanbray commented 4 years ago

I believe the version on github resolves this. I don't have a rpi handy to test it, though. I may get one working in a few days.

UlisseMini commented 4 years ago

Will test again with the github version when I get home and can use my RPI.

UlisseMini commented 4 years ago

Sorry for the delay, here is the result of trying to compile https://hastebin.com/alibuwahur

I don't think it's chess's fault for the failed build, I'll try and fix it since it is likely on my end.

edit: After updating my system and rust, this is the error I get

error: failed to run custom build command for `chess v3.1.1 (/home/pi/chess)`

Caused by:
  process didn't exit successfully: `/home/pi/chess/target/debug/build/chess-ad31ba297d6cd7e0/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'index out of bounds: the len is 64 but the index is 553977856', /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/slice/mod.rs:2717:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Hopefully that helps you to debug it.

jordanbray commented 4 years ago

Ahh, OK. I'm gonna need to set up a raspberry pi or something to debug this one. I had originally assumed it was just the BMI2 stuff, but it appears I've got some endian-ness stuff to fix in the magic bitboards implementation.

Thanks for reporting it. I'll set up a pi (I think I have one around here somewhere) and get it figured out.

jordanbray commented 4 years ago

Long time no fix. So, I finally got all the arm build issues resolved. This is not pushed up to crates.io yet, but it should be in a few days (personal server is down). Leaving open until it is fully resolved.