# Latest Gnuradio git won't compile on OS X

**URL:** <https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726>\
**Category:** GNU Radio\
**Created:** [October 23, 2014, 7:39pm UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726 "2014-10-23T19:39:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [October 23, 2014, 7:39pm UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726/1 "2014-10-23T19:39:23Z")

</div>

I just got the latest git version of gnuradio and tried to compile, but  
I get compilation errors resulting from avxintrin.h:

> **[GNURadio OS X compilation error - Pastebin.com](https://pastebin.com/uq4uGeNs)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

These errors seems to be common and result from using non-standard  
GCC-extensions that clang does not support.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Stefan\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@Stefan\_O](https://www.ruby-forum.com/u/Stefan_O)\
**Post date:** [October 23, 2014, 7:51pm UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726/2 "2014-10-23T19:51:17Z")

</div>

On Thu, Oct 23, 2014 at 12:37 PM, Stefan O.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I just got the latest git version of gnuradio and tried to compile, but  
> I get compilation errors resulting from avxintrin.h:
> 
> [GNURadio OS X compilation error - Pastebin.com](http://pastebin.com/uq4uGeNs)
> 
> These errors seems to be common and result from using non-standard  
> GCC-extensions that clang does not support.
> 
> Any ideas?

This is a recently introduced bug; thanks for the report!

This is apparently because clang is stricter than gcc on constant  
arguments. The shuffle parameter is defined as an int rather than  
const int. The same instruction/function has been used for a long time  
without any problems, but in other cases we always give the literal  
value rather than a variable.

Since you’re building from source I’ll assume you might be able to try  
this patch out:

— a/volk/kernels/volk/volk\_32fc\_deinterleave\_32f\_x2.h  
+++ b/volk/kernels/volk/volk\_32fc\_deinterleave\_32f\_x2.h  
@@ -42,8 +42,8 @@ static inline void  
volk\_32fc\_deinterleave\_32f\_x2\_a\_avx(float\* iBuffer, float\* qB

unsigned int number = 0;  
// Mask for real and imaginary parts

- int realMask = 0x88;
- int imagMask = 0xdd;

- const int realMask = 0x88;
- const int imagMask = 0xdd;  
const unsigned int eighthPoints = num\_points / 8;  
\_\_m256 cplxValue1, cplxValue2, complex1, complex2, iValue, qValue;  
for(;number \< eighthPoints; number++){

Otherwise, just roll back to a commit before we merged in the volk  
gsoc work (1-2 weeks, I think).

Nathan

---

<div class="post-metadata">

**Author:** ![Stefan\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@Stefan\_O](https://www.ruby-forum.com/u/Stefan_O)\
**Post date:** [October 23, 2014, 9:53pm UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726/3 "2014-10-23T21:53:51Z")

</div>

Adding const did not fix the problem, so I gave the 0xdd / 0x88 directly  
as shuffle mask parameter in \_mm256\_shuffle\_ps, then it compiles without  
any problems (same fix for volk\_32fc\_deinterleave\_imag\_32f.h)

Thank you very much  
Stefan

Am 23.10.2014 19:50, schrieb West, Nathan:

---

<div class="post-metadata">

**Author:** ![Stefan\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@Stefan\_O](https://www.ruby-forum.com/u/Stefan_O)\
**Post date:** [October 24, 2014, 2:58am UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726/4 "2014-10-24T02:58:58Z")

</div>

Oh goody! I have a MacPorts ticket with this issue, and my AVX Mac is  
currently unavailable for fixing this. Maybe somebody (Nathan? Tom?)  
can figure out the correct fix? - MLD

---

<div class="post-metadata">

**Author:** ![Stefan\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@Stefan\_O](https://www.ruby-forum.com/u/Stefan_O)\
**Post date:** [October 24, 2014, 9:16pm UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726/5 "2014-10-24T21:16:55Z")

</div>

The intel docs specify that function as taking a const int, so I’m not  
sure why that wouldn’t work but the literal value would. Although I’m  
basically fine with using the literal value, I feel like the “correct”  
thing to do is use a const int here. At a minimum I’d like to at least  
understand what’s happening.

- Is this caused by a specific version of clang that is introduced by  
the OS upgrade? (aka can I install a version of clang to test this on  
linux)
- Are there some “be super strict about const parameters” flags being  
passed in that haven’t been previously?
- Is there some compiler cache issue that caused your const change to  
be silently ignored?

If you’re willing to test #3 that would be great. If you can provide a  
command line used to compile (make VERBOSE=1 \> file; parse file for  
this build command) and a clang version I might be able to tinker with  
this. I’m assuming here that clang on Macs is not modified from the  
publicly available clang (I don’t actually know if that’s true or  
not).

Nathan

On Thu, Oct 23, 2014 at 7:57 PM, Michael D.

---

<div class="post-metadata">

**Author:** ![Stefan\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@Stefan\_O](https://www.ruby-forum.com/u/Stefan_O)\
**Post date:** [October 24, 2014, 10:14pm UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726/6 "2014-10-24T22:14:37Z")

</div>

See: [9665 – \_\_builtin\_shufflevector requires a constant integer](http://llvm.org/bugs/show_bug.cgi?id=9665)  
When I understand that correctly it´s a bug in the intel avx header  
files. The solution is either use other header files or do not use const  
int, but literal values or enum.

Best regards  
Stefan

Am 24.10.2014 21:15, schrieb West, Nathan:

---

<div class="post-metadata">

**Author:** ![Stefan\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@Stefan\_O](https://www.ruby-forum.com/u/Stefan_O)\
**Post date:** [October 25, 2014, 3:36am UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726/7 "2014-10-25T03:36:58Z")

</div>

I would like to trying to help. I’m using yosemite now.  
I install dependency using macports, but und & gnu radio install by  
manually.  
Attach is the command that using llvm-gcc clang. They are run into same  
error, but I cannot telling why.  
And I try gcc4.9 install by macport didn’t have the problem, but link  
boost  
will cause the error, I know I can install boost using gcc4.9, but it  
will  
cause I can not install one dependency (I forgot sorry) and/or can not  
compiler und correctly.

Using gcc, clang or llvm is more suitable for volk ? I have no idea,  
just  
know macports had a suggest that using gcc better than clang for volk.

If there I can do to help, just tell me.

Sincerely,  
Jeff Guo

2014-10-25 4:13 GMT+08:00 Stefan O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Stefan\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@Stefan\_O](https://www.ruby-forum.com/u/Stefan_O)\
**Post date:** [October 31, 2014, 9:15pm UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726/8 "2014-10-31T21:15:58Z")

</div>

I just fixed this issue within MacPorts \<  
[https://trac.macports.org/changeset/127653](https://trac.macports.org/changeset/127653) \>, which will be live by  
around 12:30 PM/US/Eastern. I ended up following Stephans lead and  
moving the shuffle index values directly into the function call; nothing  
else made clang happy. Given that these constants are used just once,  
and other constants are used in other shuffle calls directly, I think it  
makes sense to just commit this change to GIT. The patch (-p0) is found  
at \<  
[Making sure you're not a bot!](https://trac.macports.org/browser/trunk/dports/science/gnuradio/files/patch-volk-shuffle.diff?rev=127653)

> for anybody interested. For folks using MacPorts, youll want to do:  
> {{{  
> sudo port clean gnuradio\*  
> sudo port selfupdate  
> }}}  
> before installing or upgrading whichever gnuradio port youre using (next  
> or devel; none of the others are affected). - MLD

---

<div class="post-metadata">

**Author:** ![Stefan\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@Stefan\_O](https://www.ruby-forum.com/u/Stefan_O)\
**Post date:** [October 26, 2014, 2:53am UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726/9 "2014-10-26T02:53:57Z")

</div>

That looks like the exact same error and will have the exact same  
resolution. We’ll fix it before the next release. If you don’t feel  
comfortable making the changes discussed in this thread then I suggest  
you stick with a package manager (macports) and heed Michael D.’  
advice:  
[http://lists.gnu.org/archive/html/discuss-gnuradio/2014-10/msg00344.html](http://lists.gnu.org/archive/html/discuss-gnuradio/2014-10/msg00344.html)

---

<div class="post-metadata">

**Author:** ![Stefan\_O](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a8b319/32.png) [@Stefan\_O](https://www.ruby-forum.com/u/Stefan_O)\
**Post date:** [October 31, 2014, 10:04pm UTC](https://www.ruby-forum.com/t/latest-gnuradio-git-wont-compile-on-os-x/232726/10 "2014-10-31T22:04:17Z")

</div>

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)
