On 10/11/2017 07:01 PM, Kenneth Hoste wrote:
notes are available at https://github.com/easybuilders/easybuild/wiki/Conference-call-notes-20171011

Comment on the code displayed in the notes:

CPU_FLAGS_LIST="lm sse sse4_2 f16c avx avx2 avx512 avx512f avx512dq avx512cd 
avx512bw avx512vl eagerfpu epb ida epb fma"
## expand as needed
cpuflags="$(grep ^flags /proc/cpuinfo |uniq|cut -d: -f2-|xargs -n1|sort|comm -1 -2 - 
<(echo $CPU_FLAGS_LIST|xargs -n1|sort)|xargs|sed 's/ /:/g;s/$/:/g;s/^/:/g')"
march="$(gcc -march=native -Q --help=target | awk 'BEGIN { march="NA" } ; /^\ 
*-march= / { march= } END { print march }')" ## changes among GCC/4.8 vs 4.9
unset CPU_FLAGS_LIST

My 2 cents:

1. The bash shell (not sh) is required to execute these lines.

2. There is a missing argument in the march= line so that the -march= value gets printed:
   { march= } should read { march=$2 }

/Ole

Reply via email to