Skip to content

Instantly share code, notes, and snippets.

@loicmolinari
Last active March 5, 2018 15:04
Show Gist options
  • Select an option

  • Save loicmolinari/b2849413b7fe9d249308300c4d20b875 to your computer and use it in GitHub Desktop.

Select an option

Save loicmolinari/b2849413b7fe9d249308300c4d20b875 to your computer and use it in GitHub Desktop.
Building ripgrep with AVX support

Building ripgrep with AVX support

Get the Rust environment. Press enter to validate the default Rust installation settings and put the files for the current platform in $HOME/.cargo and $HOME/.rustup.

$ curl https://sh.rustup.rs -sSf | sh

Switch to nightly builds to get SIMD support.

$ source $HOME/.cargo/env
$ rustup default nightly

Get and build ripgrep with AVX acceleration.

$ git clone https://github.com/BurntSushi/ripgrep
$ cd ripgrep
$ RUSTFLAGS="-C target-cpu=native" cargo build --release --features 'simd-accel avx-accel'
$ strip ./target/release/rg

Check for SIMD and AVX support.

$ ./target/release/rg --version
ripgrep 0.8.1 (rev b98585b429)
+SIMD +AVX

Put the standalone rg binary in the PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment