mmstick/parallel

can't "cargo install parallel"

tycho opened this issue · 2 comments

tycho commented

Both the latest release and the master branch fail to build.

$ cargo install parallel
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading parallel v0.6.5
 Downloading permutate v0.1.3
   Compiling permutate v0.1.3
   Compiling odds v0.2.25
   Compiling libc v0.2.18
   Compiling num_cpus v1.2.0
   Compiling nodrop v0.1.8
   Compiling arrayvec v0.3.20
   Compiling parallel v0.6.5
error[E0554]: #[feature] may not be used on the stable release channel
 --> .cargo/registry/src/github.com-1ecc6299db9ec823/parallel-0.6.5/src/main.rs:3:1
  |
3 | #![feature(alloc_system)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: failed to compile `parallel v0.6.5`, intermediate artifacts can be found at `/tmp/cargo-install.0fNbtHtRHfKF`

Caused by:
  Could not compile `parallel`.

To learn more, run the command again with --verbose.
$ git clone https://github.com/mmstick/parallel
[...]
$ cd parallel
$ cargo build --release
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading permutate v0.2.0
 Downloading arrayvec v0.3.20
 Downloading num_cpus v1.2.0
 Downloading nodrop v0.1.8
 Downloading odds v0.2.25
 Downloading libc v0.2.18
   Compiling odds v0.2.25
   Compiling libc v0.2.18
   Compiling permutate v0.2.0
   Compiling num_cpus v1.2.0
   Compiling nodrop v0.1.8
   Compiling arrayvec v0.3.20
   Compiling parallel v0.6.5 (file:///home/steven/Development/parallel)
error[E0554]: #[feature] may not be used on the stable release channel
 --> src/main.rs:3:1
  |
3 | #![feature(alloc_system)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `parallel`.

To learn more, run the command again with --verbose.
$ cargo --version
cargo 0.15.0-dev (298a0127 2016-12-20)
$ rustc --version
rustc 1.14.0

I'm a Rust newbie so I don't know how to contribute a fix for the issue.

The problem is just that Rust currently requires that you use the Nightly version of Rust to disable jemalloc. I've been doing a number of improvements to Parallel lately to increase performance, and I found that jemalloc was hampering with the performance of Parallel drastically, so I've disabled it. Basically, I'd recommend just copying and pasting this in your terminal:

rustup default nightly
cargo install --git https://github.com/mmstick/parallel/ --force

If you're using Linux, you can gain increased performance by compiling Parallel with MUSL over Glibc, which also has the benefit of making Parallel fully static with zero dynamic dependencies.

rustup default nightly
rustup target add x86_64-unknown-linux-musl
git clone https://github.com/mmstick/parallel/
cd parallel
cargo build --release --target x86_64-unknown-linux-musl
cp target/x86_64-unknown-linux-musl/release/parallel ~/.cargo/bin/
tycho commented

Thanks for the explanation and help! Your suggestions worked beautifully.