Commit 755fcbbf authored by Bruno Mongazon-Cazavet's avatar Bruno Mongazon-Cazavet Committed by Robert Schmidt

make --noavx512 implicit if host does not have avx512

parent e0a8c824
......@@ -613,6 +613,21 @@ function main() {
cd $DIR/$BUILD_DIR/build
if [[ ${#CMAKE_C_FLAGS[@]} > 0 ]]; then CMAKE_CMD="$CMAKE_CMD -DCMAKE_C_FLAGS=\"${CMAKE_C_FLAGS[*]}\""; fi
if [[ ${#CMAKE_CXX_FLAGS[@]} > 0 ]]; then CMAKE_CMD="$CMAKE_CMD -DCMAKE_CXX_FLAGS=\"${CMAKE_CXX_FLAGS[*]}\""; fi
# if --noavx512 is not specified the AVX512 equals "True" by default
# override AVX512 to "False" if processor does not have avx512
# this avoids having to specify --noavx512 systematically
if [ -f /proc/cpuinfo ]; then
if grep -q avx512 /proc/cpuinfo
then
echo_info "Processor has avx512 intrinsics"
else
echo_info "Processor does not have avx512 intrinsics"
echo_info "Forcing AVX512 to False"
AVX512="False"
fi
fi
# for historical reasons we build in a subdirectory cmake_targets/XYZ/build,
# e.g., cmake_targets/ran_build/build, hence the ../../..
CMAKE_CMD="$CMAKE_CMD -DAVX512=\"${AVX512[*]}\" -DAVX2=\"${AVX2[*]}\" ../../.."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment