TeXitoi / benchmarksgame-rs

The Computer Language Benchmarks Game: Rust implementations
Other
70 stars 19 forks source link

Cannot build `fasta` benchmark #68

Closed GabrielMajeri closed 6 years ago

GabrielMajeri commented 6 years ago

When I try to build with Rust stable 1.28:

error[E0464]: multiple matching crates for `num_cpus`
 --> src/fasta.rs:7:1
  |
7 | extern crate num_cpus;
  | ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: candidates:
          crate `num_cpus`: /home/gabriel/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnum_cpus-8e0ce176cc0ba9e5.rlib
          crate `num_cpus`: /data/Development/Rust/benchmarksgame-rs/lib/libnum_cpus-756b42f97ccecdf5.rlib

error[E0463]: can't find crate for `num_cpus`
 --> src/fasta.rs:7:1
  |
7 | extern crate num_cpus;
  | ^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to 2 previous errors

Some errors occurred: E0463, E0464.
For more information about an error, try `rustc --explain E0463`.
make: *** [Makefile:52: bin/fasta] Error 101

It seems that some recent update added num_cpus to the Rust sysroot, and it's conflicting with the one we build manually.

TeXitoi commented 6 years ago

The build system is broken since a long time. It is supposed to be about the same as the official one.

But, to my knowledge, the benchmarksgame is frozen, thus I didn't took any time to maintain this repository.

TeXitoi commented 6 years ago

Seems that that's possible now: https://salsa.debian.org/benchmarksgame-team/benchmarksgame/issues/3

Maybe the first step is to change the build system in sync with Isaac.

GabrielMajeri commented 6 years ago

@TeXitoi So basically we can now move every benchmark to its own Cargo.toml?

TeXitoi commented 6 years ago

I don't know, we have to ask to Isaac. But I'd prefer one project with a src/bin with each program in it.

TeXitoi commented 6 years ago

He wanted to use rustc directly, but he use cargo to build the libs, thus maybe we can convince him to use cargo for everything.

TeXitoi commented 6 years ago

https://salsa.debian.org/benchmarksgame-team/benchmarksgame/issues/40

TeXitoi commented 6 years ago

I removed num_cpus as it's better to test with the value of the bench machine.

The other solution is to use explicit --extern as here: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/fasta-rust-3.html#log