build scripts: disable avx512, since it decreases performance

This commit is contained in:
Joakim Frostegård 2020-07-31 01:34:13 +02:00
parent 225a76e075
commit 0d8b6f6cc4
7 changed files with 54 additions and 8 deletions

View file

@ -1,5 +1,13 @@
#!/bin/sh
export RUSTFLAGS="-C target-cpu=native"
# Compile with target-cpu=native but without AVX512 features, since they
# decrease performance.
DISABLE_AVX512=$(rustc --print target-features | grep " avx512" |
awk '{print $1}' | sed 's/^/-C target-feature=-/' | xargs)
export RUSTFLAGS="-C target-cpu=native $DISABLE_AVX512"
echo "Compiling with RUSTFLAGS=$RUSTFLAGS""
cargo run --release --bin aquatic_udp_bench -- $@