Heiaha / Weiawaga

A UCI chess engine written in Rust.
GNU General Public License v2.0
46 stars 0 forks source link

compilation failed - on Linux #2

Closed tissatussa closed 2 years ago

tissatussa commented 2 years ago

i tried this, but i get an error :

$ cargo build --release
    Updating crates.io index
   Compiling libc v0.2.109
   Compiling cfg-if v1.0.0
   Compiling ppv-lite86 v0.2.15
   Compiling getrandom v0.2.3
   Compiling rand_core v0.6.3
   Compiling rand_chacha v0.3.1
   Compiling rand v0.8.4
   Compiling Weiawaga v3.0.0 (/home/tissatussa/Compiled/Weiawaga)
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:1:1
  |
1 | #![feature(step_trait)]
  | ^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:2:1
  |
2 | #![feature(destructuring_assignment)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::evaluation::score::*`
 --> src/evaluation/e_constants.rs:2:5
  |
2 | use crate::evaluation::score::*;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `std::mem`
 --> src/texel/tuner.rs:3:5
  |
3 | use std::mem;
  |     ^^^^^^^^

warning: unused import: `crate::types::move_list::MoveList`
  --> src/texel/tuner.rs:10:5
   |
10 | use crate::types::move_list::MoveList;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `File`
 --> src/texel/parameter.rs:1:15
  |
1 | use std::fs::{File, OpenOptions};
  |               ^^^^

warning: unused imports: `BufReader`, `BufWriter`
 --> src/texel/parameter.rs:2:15
  |
2 | use std::io::{BufReader, BufWriter, Write};
  |               ^^^^^^^^^  ^^^^^^^^^

warning: unused import: `crate::texel::tuner::Tuner`
  --> src/main.rs:15:5
   |
15 | use crate::texel::tuner::Tuner;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
warning: `Weiawaga` (bin "Weiawaga") generated 6 warnings
error: could not compile `Weiawaga` due to 2 previous errors; 6 warnings emitted
Heiaha commented 2 years ago

Hi, yes you will need to use Rust nightly to compile this. The Step trait used is nightly only.

https://doc.rust-lang.org/std/iter/trait.Step.html

tissatussa commented 2 years ago

Thanks. I'm on Xubuntu 20.04 - i forgot to mention this .. i have problems installing Nightly for Rust .. another chess engine programmer also used this, but later (to please me, i guess) he changed a bit of his code, so it could compile without it .. what's so special / important about Nightly builds ? Do you really need its features ?

Heiaha commented 2 years ago

I chose to use it because I like the step trait for the enumeration that I use for squares, and that is only available in nightly.

Heiaha commented 2 years ago

Hi @tissatussa. As an update, I've removed the nightly features so now you can compile the engine on a stable toolchain.

tissatussa commented 2 years ago

thanks ! indeed i can compile Weiawaga now, and it runs fine in CuteChess !

however, i encounter some fault concerning the Hash setting .. i will open a new Issue for that.