Error on OSX in latest VOLK

I just pulled the latest GIT master, cleaned out everything old, then
the usual cmake. Make errors out with:

[ 3%] Building C object volk/lib/CMakeFiles/volk.dir/volk_cpu.c.o
/var/tmp//ccrCnwC2.s:221:no such instruction: `xgetbv’

I’m running OSX 10.6.8, XCode 3.2.3, gcc 4.2.1. - MLD

On 04/18/2012 09:28 AM, Michael D. wrote:

I just pulled the latest GIT master, cleaned out everything old, then the usual
cmake. Make errors out with:

[ 3%] Building C object volk/lib/CMakeFiles/volk.dir/volk_cpu.c.o
/var/tmp//ccrCnwC2.s:221:no such instruction: `xgetbv’

I’m running OSX 10.6.8, XCode 3.2.3, gcc 4.2.1. - MLD

gcc 4.2.1? Seriously?

Philip

Yes: gcc 4.2.1. Apple is transitioning from pure gcc to using llvm /
clang, so maybe they’ll keep those more up to date? XCode 4.3.2
(latest) provides gcc 4.2.1 using llvm / clang (3.0), which is the
latest release of those. llvm / clang 3.1 is coming out soon, it looks
like; so, we’ll see. In the mean time, I’m stuck with Apple’s gcc 4.2.1
variant. So, I’m sure there’s a way to make it work with what VOLK is
trying to do; but, that’s an SEP <
Somebody else's problem - Wikipedia > both since I
don’t have time right now and that it’s a little beyond my current
expertise in assembly language programming. Hopefully the
VOLK-programmers-that-be can find a quick fix. - MLD

On Wed, Apr 18, 2012 at 8:03 AM, Michael D. [email protected]
wrote:

gcc 4.2.1? Seriously?

Thanks for the update, that’s good to know Apple’s antediluvian
assembler
doesn’t yet support AVX instructions. Actually, now that I look at it,
looks like GCC didn’t support AVX until 4.6.0. We’ll put in a check
disabling AVX if CMake doesn’t find GCC 4.6. Unfortunately, there’s no
safe
way to enable AVX instructions without using xgetbv.

–n

On 04/18/2012 09:23 AM, Nick F. wrote:

expertise in assembly language programming. Hopefully the

Maybe the xgetbv stuff still needs and ifdef AVX around it

AVX is only defined when the -mavx is passed

-josh

On 04/18/2012 06:28 AM, Michael D. wrote:

I just pulled the latest GIT master, cleaned out everything old, then the usual
cmake. Make errors out with:

[ 3%] Building C object volk/lib/CMakeFiles/volk.dir/volk_cpu.c.o
/var/tmp//ccrCnwC2.s:221:no such instruction: `xgetbv’

Do you mind trying my volk_work branch? Its got a fix that we can
backport on to maint:
https://github.com/guruofquality/gnuradio/tree/volk_work

Fix referenced from here:
https://code.google.com/p/pcsx2/issues/detail?id=1195

-josh

On Wed, Apr 18, 2012 at 9:30 AM, Josh B. [email protected] wrote:

clang, so maybe they’ll keep those more up to date? XCode 4.3.2
since I don’t have time right now and that it’s a little beyond my

[ 3%] Building C object volk/lib/CMakeFiles/volk.dir/volk_cpu.c.o
looks like GCC didn’t support AVX until 4.6.0. We’ll put in a check
I take it back, we dont pass arch flags to volk_cpu.c
We can manually define something from the build system when -mavx
passes, or a compile time test, or maybe there is another gcc define.

-josh

I was just going to eliminate AVX from the available arches list if GCC
<
4.6 is detected.

— 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

########################################################################

–n

On 04/18/2012 09:24 AM, Josh B. wrote:

there’s a way to make it work with what VOLK is trying to do; but, that’s

looks like GCC didn’t support AVX until 4.6.0. We’ll put in a check
disabling AVX if CMake doesn’t find GCC 4.6. Unfortunately, there’s no safe
way to enable AVX instructions without using xgetbv.

Maybe the xgetbv stuff still needs and ifdef AVX around it

AVX is only defined when the -mavx is passed

I take it back, we dont pass arch flags to volk_cpu.c
We can manually define something from the build system when -mavx
passes, or a compile time test, or maybe there is another gcc define.

-josh

On 04/18/2012 10:04 AM, Michael D. wrote:

[ 3%] Building C object volk/lib/CMakeFiles/volk.dir/volk_cpu.c.o
/opt/GNURadio/source/builds/jblum_gr/volk/lib/volk_cpu.c:51:43: error: missing
binary operator before token “(”

OK I think I see why. I updated the branch and copied the changes to a
branch of of maint

potential maint fix:
http://gnuradio.org/cgit/jblum.git/commit/?h=volk_xgetbv_fix&id=ad9752793bbb7134e14483553766ab3d36e02366

volk_work fix:
https://github.com/guruofquality/gnuradio/commit/578a4d858c3f765417b0d9560e5f8de29dde4e20

-josh

On Apr 18, 2012, at 2:20 PM, Josh B. wrote:

volk_work fix:

https://github.com/guruofquality/gnuradio/commit/578a4d858c3f765417b0d9560e5f8de29dde4e20

OK; I now see the commit you reference from your github account. I ‘rm
-rf’ the build directory, recreate it, do cmake, then make:

[ 3%] Building C object volk/lib/CMakeFiles/volk.dir/volk_cpu.c.o
/opt/GNURadio/source/builds/jblum_gr/volk/lib/volk_cpu.c:51:48: error:
missing binary operator before token “(”

gcc 4.2.1 does not like the “__GNUC_PREREQ(4, 4)” macro – if I remove
it compiling continues (correctly or not). - MLD

[ 3%] Building C object volk/lib/CMakeFiles/volk.dir/volk_cpu.c.o
/opt/GNURadio/source/builds/jblum_gr/volk/lib/volk_cpu.c:51:43: error:
missing binary operator before token “(”

On 04/18/2012 11:41 AM, Michael D. wrote:

Yea, i figured it was that. So the changesets now use:
#if defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 4)

Is that not working for you?

-josh