Permalink
Browse files

linux: build with native arch if the cpu supports avx

workaround to handle the pentium G detected as the Core i5/7 but not compatible with avx
  • Loading branch information...
1 parent 8631093 commit 6f9132714641fa2ffe062430604e81efbb3acebb @tpruvot committed Dec 8, 2015
Showing with 5 additions and 0 deletions.
  1. +5 −0 build.sh
View
@@ -18,6 +18,11 @@ rm -f config.status
# Debian 7.7 / Ubuntu 14.04 (gcc 4.7+)
extracflags="$extracflags -Ofast -flto -fuse-linker-plugin -ftree-loop-if-convert-stores"
+if [ ! "0" = `cat /proc/cpuinfo | grep -c avx` ]; then
+ # march native doesn't always works, ex. some Pentium Gxxx (no avx)
+ extracflags="$extracflags -march=native"
+fi
+
./configure --with-crypto --with-curl CFLAGS="-O2 $extracflags -DUSE_ASM -pg"
make -j 4

0 comments on commit 6f91327

Please sign in to comment.