3 ms·
To build a static Linux binary with SIMD support, run this: RUSTFLAGS="-C target-cpu=native" rustup run nightly cargo build --target x86_64-unknown-linux-m
by cm3 10y ago
To build a static Linux binary with SIMD support, run this:
RUSTFLAGS="-C target-cpu=native" rustup run nightly cargo build --target x86_64-unknown-linux-musl --release --features simd-accel
- burntsushi 10y agoThat's an awesome demonstration of how easy it is to swap out the libc in Rust. :-) Note that I also distribute statically compiled executables with musl and SIMD enabled (using target-feature=+ssse3 instead of target-cpu=native): https://github.com/BurntSushi/ripgrep/releases https://github.com/BurntSushi/ripgrep/releases
- cm3 10y ago> That's an awesome demonstration of how easy it is to swap out the libc in Rust. :-) Now I have to look up how I use cargo to build a static binary on FreeBSD, where I don't have to swap out libc. > Note that I also distribute statically compiled executables with musl and SIMD enabled (using target-feature=+ssse3 instead of target-cpu=native): https://github.com/BurntSushi/ripgrep/releases https://github.com/BurntSushi/ripgrep/releases I took the flag from your blog post, thanks for pointing out the explicit feature flag. That will allow the binary to run on more cpus.