summaryrefslogtreecommitdiff
path: root/volk
diff options
context:
space:
mode:
authorNick Foster2012-04-18 09:59:41 -0700
committerJosh Blum2012-04-19 18:13:23 -0700
commitfd1e12bffd162852ea377017204860af6573a01a (patch)
treef8d425c42486de4ef60fcda9901e0c93aa99d8f1 /volk
parent3d913cde5286c77ae4805bf7511b59190f2266dd (diff)
downloadgnuradio-fd1e12bffd162852ea377017204860af6573a01a.tar.gz
gnuradio-fd1e12bffd162852ea377017204860af6573a01a.tar.bz2
gnuradio-fd1e12bffd162852ea377017204860af6573a01a.zip
volk: disable AVX if GCC version < 4.6.0
Diffstat (limited to 'volk')
-rw-r--r--volk/lib/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt
index 5b7e0d256..108470d27 100644
--- a/volk/lib/CMakeLists.txt
+++ b/volk/lib/CMakeLists.txt
@@ -84,6 +84,19 @@ foreach(line ${arch_flag_lines})
endforeach(line)
########################################################################
+# eliminate AVX on GCC < 4.6.0
+# even though it accepts -mavx, as won't assemble xgetbv, which we need
+########################################################################
+if(COMPILER_NAME MATCHES "GNU")
+ execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+ OUTPUT_VARIABLE GCC_VERSION)
+ if(GCC_VERSION VERSION_LESS "4.6")
+ message(STATUS "GCC too old for AVX support, overruling AVX")
+ list(REMOVE_ITEM available_archs avx)
+ endif()
+endif()
+
+########################################################################
# implement overruling in the ORC case,
# since ORC always passes flag detection
########################################################################