Forum: GNU Radio configure tests?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
821c1adf3f4be2f2aa6fbc89cce4c69a?d=identicon&s=25 Michael Dickens (Guest)
on 2006-05-26 22:01
(Received via mailing list)
I think I've got the issue with gr-audio-osx running on Intel
Macs ... it's about endianness in the float stream.  Which means, if
I'm correct, that I need to add a #ifdef to select on whether the CPU
is big (PPC) or little (Intel) endian.  Anyone know if this is
already available for configure, or will I need to add one?  If the
latter, I'm sure it's straight forward (e.g. `uname -a | grep
powerpc` == ""), but why reinvent the wheel?

Also, it looks like Apple's GCC implements the ".align X" in assembly
as a log2 based number (for either PPC or Intel) while others use
".align Y" where X = log2 (Y) .. a linear number.  I really doubt
that this is available for configure, but it's worth checking.  I've
already started writing this one ("config/gr_asm_dot_align.m4"), but
again why reinvent the wheel?

Thanks! - MLD
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2006-05-27 02:54
(Received via mailing list)
On Fri, May 26, 2006 at 03:58:42PM -0400, Michael Dickens wrote:
> I think I've got the issue with gr-audio-osx running on Intel
> Macs ... it's about endianness in the float stream.  Which means, if
> I'm correct, that I need to add a #ifdef to select on whether the CPU
> is big (PPC) or little (Intel) endian.  Anyone know if this is
> already available for configure, or will I need to add one?  If the
> latter, I'm sure it's straight forward (e.g. `uname -a | grep
> powerpc` == ""), but why reinvent the wheel?

There's already a test in the usrp and gr-usrp code for this.
See configure.ac, AC_C_BIGENDIAN.
See also usrp/host/lib/usrp_bytesex.h

I believe that the gr-usrp code already handles this properly.
See gr-usrp/usrp1_{sink,source}_{c,s}.cc.

Search for host_to_usrp_short and usrp_to_host_short


> Also, it looks like Apple's GCC implements the ".align X" in assembly
> as a log2 based number (for either PPC or Intel) while others use
> ".align Y" where X = log2 (Y) .. a linear number.  I really doubt
> that this is available for configure, but it's worth checking.  I've
> already started writing this one ("config/gr_asm_dot_align.m4"), but
> again why reinvent the wheel?

I don't know of a test for this.
How are you planning on implementing the test?
I'd suggest something like:

  in test.asm (syntax could be wrong...)

	.globl _start_test, _end_test

	.align  16
  _start_test:
	.db	1
        .align  4
  _end_test:


Then use nm to extract the resulting symbol values, followed by some
python, etc to compute difference.  Or I guess your test code could
just write the difference to stdout, then you could parse that.

Eric
5e81c66258333eb8e665cc4814d0a6d5?d=identicon&s=25 Greg Troxel (Guest)
on 2006-05-27 03:15
(Received via mailing list)
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
821c1adf3f4be2f2aa6fbc89cce4c69a?d=identicon&s=25 Michael Dickens (Guest)
on 2006-05-27 04:40
(Received via mailing list)
On May 26, 2006, at 8:52 PM, Eric Blossom wrote:
> There's already a test in the usrp and gr-usrp code for this.
> See configure.ac, AC_C_BIGENDIAN.

Yup, that works.  I'll send diff's once I have confirmation that this
is the issue.

> Then use nm to extract the resulting symbol values, followed by some
> python, etc to compute difference.

Yes, something like that, but '.align 16' is too big.  sed could do
the trick too.

Even simpler would be:
+++++++++++++++++
	.text
	.globl	_abc
	.byte	1
	.align	4
_abc:
+++++++++++++++++
Then:

gcc -c -o test.o test.S
nm test.o | grep abc | sed -e 's/.*\([0-9a-fA-F][0-9a-fA-F]\).*abc.*/
\1/'

the output of the NM pipe should be '10' or '16' for 'log' based and
something else (I think '04') for linear based.  This works for me
(returns '10', which is in hex but that doesn't matter).  Should be
pretty straight forward to stick in an m4 file. - MLD
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2006-05-27 05:11
(Received via mailing list)
On Fri, May 26, 2006 at 10:38:21PM -0400, Michael Dickens wrote:
> On May 26, 2006, at 8:52 PM, Eric Blossom wrote:
> >There's already a test in the usrp and gr-usrp code for this.
> >See configure.ac, AC_C_BIGENDIAN.
>
> Yup, that works.  I'll send diff's once I have confirmation that this
> is the issue.

Great.

> >Then use nm to extract the resulting symbol values, followed by some
> >python, etc to compute difference.
>
> Yes, something like that, but '.align 16' is too big.  sed could do
> the trick too.

By too big, do you mean that some tool complains?


> gcc -c -o test.o test.S
> nm test.o | grep abc | sed -e 's/.*\([0-9a-fA-F][0-9a-fA-F]\).*abc.*/
> \1/'
>
> the output of the NM pipe should be '10' or '16' for 'log' based and
> something else (I think '04') for linear based.  This works for me
> (returns '10', which is in hex but that doesn't matter).  Should be
> pretty straight forward to stick in an m4 file. - MLD

Sounds good!

Eric
821c1adf3f4be2f2aa6fbc89cce4c69a?d=identicon&s=25 Michael Dickens (Guest)
on 2006-05-28 03:45
(Received via mailing list)
>>> Then use nm to extract the resulting symbol values, followed by some
>>> python, etc to compute difference.
>>
>> Yes, something like that, but '.align 16' is too big.  sed could do
>> the trick too.
>
> By too big, do you mean that some tool complains?

gcc complains that "Alignment too large: 15. assumed."  I guess
alignment can be at most 2^15, but 2^16 is too big ... not sure what
the page size on OSX is but they're probably related.  Anyway, testing
for ".align 4" is pretty safe. - MLD
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2006-05-28 16:51
(Received via mailing list)
On Sat, May 27, 2006 at 09:44:38PM -0400, Michael Dickens wrote:
> >>>Then use nm to extract the resulting symbol values, followed by some
> for ".align 4" is pretty safe. - MLD
OK.  Thanks for the info.

Eric
This topic is locked and can not be replied to.