3X speedup

Just by using different compilers on math-intensive applications.

I have written a test program to see how fast the BB can do floating
point FFTs. I instrumented it using Linux's nanosecond clock.

Natively compiled on the BB, the code runs in

115,081,791 nanoseconds or 115 milliseconds.

Cross-compiled, the very same code took

35,827,638 nanoseconds or 36 milliseconds

That's over a 3X speed-up by simply using the Ubuntu cross-compiler and
its more modern math library.

Same code. Same compiler switches. Same makefile except for changing
the compiler name to

CC="/usr/bin/arm-linux-gnueabi-gcc-4.6"

Sweet.

John

NeonJohn <jgd@neon-john.com> writes:

Just by using different compilers on math-intensive applications.

I have written a test program to see how fast the BB can do floating
point FFTs. I instrumented it using Linux's nanosecond clock.

Natively compiled on the BB, the code runs in

115,081,791 nanoseconds or 115 milliseconds.

Cross-compiled, the very same code took

35,827,638 nanoseconds or 36 milliseconds

What code was this?

That's over a 3X speed-up by simply using the Ubuntu cross-compiler and
its more modern math library.

Same code. Same compiler switches. Same makefile except for changing
the compiler name to

CC="/usr/bin/arm-linux-gnueabi-gcc-4.6"

You should use gcc 4.7. It is _much_ better than 4.6.

NeonJohn <jgd@neon-john.com> writes:

35,827,638 nanoseconds or 36 milliseconds

What code was this?

floating point fast fourier transform.

You should use gcc 4.7. It is _much_ better than 4.6.

OK, I'll try to find it. You wouldn't know what apt-get repository to
use would you?

Thanks,
John

NeonJohn <jgd@neon-john.com> writes:

NeonJohn <jgd@neon-john.com> writes:

35,827,638 nanoseconds or 36 milliseconds

What code was this?

floating point fast fourier transform.

Sure, but was it some well-known implementation? Or something you wrote
yourself?

You should use gcc 4.7. It is _much_ better than 4.6.

OK, I'll try to find it. You wouldn't know what apt-get repository to
use would you?

Should be available from the usual places.

NeonJohn <jgd@neon-john.com> writes:

floating point fast fourier transform.

Sure, but was it some well-known implementation? Or something you wrote
yourself?

Mostly something I hacked together. I started off with kiss_fft and
hacked in a zoom algorithm I found in an academic paper. I am mostly a
hardware engineer so this is far from optimized code. The important
point to bring away from this is that merely changing compilers can
result in the kind of speed-up I saw.

You should use gcc 4.7. It is _much_ better than 4.6.

OK, I'll try to find it. You wouldn't know what apt-get repository to
use would you?

Should be available from the usual places.

Should be but so far isn't. I found a deb for Ubuntu 12.04 but gdebi
aborts with a cryptic message that it can't satisfy dependencies. No
further info. So I'm looking around but I haven't found anything yet.

John

It didn't enter the repo till 12.10..
http://packages.ubuntu.com/quantal/gcc-4.7

So unless you buildt on your own or download a linaro x86 version to
cross compile your code...

https://launchpad.net/linaro-toolchain-binaries

Regards,

It didn't enter the repo till 12.10..
http://packages.ubuntu.com/quantal/gcc-4.7

yeah, I figured that out. Because of the Unity/Gnome3 debacle, our
company is going to ride out this LTR to the end so I have to find some
other source.

So unless you buildt on your own or download a linaro x86 version to
cross compile your code...

https://launchpad.net/linaro-toolchain-binaries

I couldn't figure out what to download from Linaro so I'm wading into
deep water and going for a GCC build. Like much GNU software, the
source package is incomplete, lacking GMP, MPFR and MPC libraries. I'm
trying to fetch these but have been getting "host unreachable" for about
half the net all day long. Hughesnet at its finest, I think.

BTW, I'm using your kernel. I don't know what the differences are from
Angstrom kernel but it sure did build and install nicely. Well done and
thanks.

John

It didn't enter the repo till 12.10..
http://packages.ubuntu.com/quantal/gcc-4.7

yeah, I figured that out. Because of the Unity/Gnome3 debacle, our
company is going to ride out this LTR to the end so I have to find some
other source.

Ah yeah...I jumped ship, Debian Wheezy + kde.. After about a year, i
no longer miss gnome 2.xx...

So unless you buildt on your own or download a linaro x86 version to
cross compile your code...

https://launchpad.net/linaro-toolchain-binaries

I couldn't figure out what to download from Linaro so I'm wading into
deep water and going for a GCC build. Like much GNU software, the
source package is incomplete, lacking GMP, MPFR and MPC libraries. I'm
trying to fetch these but have been getting "host unreachable" for about
half the net all day long. Hughesnet at its finest, I think.

For just the latest arm cross compiler:

wget https://launchpad.net/linaro-toolchain-binaries/trunk/2013.01/+download/gcc-linaro-arm-linux-gnueabihf-4.7-2013.01-20130125_linux.tar.bz2

Just make sure you have the ia32-libs installed...

BTW, I'm using your kernel. I don't know what the differences are from
Angstrom kernel but it sure did build and install nicely. Well done and
thanks.

Other then a couple config tweaks not much, as it's all based on the
unified beagleboard.org tree..

Regards,

Ah yeah...I jumped ship, Debian Wheezy + kde.. After about a year, i
no longer miss gnome 2.xx...

I'll have to take a look. Thanks.

For just the latest arm cross compiler:

wget https://launchpad.net/linaro-toolchain-binaries/trunk/2013.01/+download/gcc-linaro-arm-linux-gnueabihf-4.7-2013.01-20130125_linux.tar.bz2

Just make sure you have the ia32-libs installed...

Well, I was hoping to report back that the download went smoothly (it
did) and the compiler installed cleanly (it didn't) and thing were good
(they're not.) It took my quite awhile to figure out where everything
goes on my host machine, and I'm not sure I have that correct. I built
an image, move it over to the BB and it would not run, generating a
"file not found" message.

I "strings" the image and found that it was trying to load
/lib/ld-linux-armhf.so.3 instead of the normal /lib/ld-linux.so.3. I
looked in /lib and saw that ld-linux.do.3 was linked to ld-2.12.2.so so
I created another link from it to -armhf.so. Now the program runs a
little and then core dumps. seg fault. I haven't debugged any yet but I
think it's failing on a malloc().

I looked in package's lib directory and didn't find anything that looked
like a replacement for ld-1.12.2.so so I went to bed :slight_smile: That's where
the situation stands now.

The directory arm-linux-gnuebihf contains stuff that needs to go on the
BB. But there is so much in that directory that I was afraid to
wholesale copy the stuff over without asking. Am I correct in my
thinking? One big problem I see is that if I just copy that stuff over
it'll break a lot of symbolic links.

If you or anyone else has any words of advice, I'm all ears.

Thanks,
John

Where would I find instructions on how to create a cross-compile environment for the BeagleBone. I am writing an application for the BeagleBone and I would much prefer building in a cross-compile environment then building natively on the BeagleBone.

Adi

I found this page

http://azkeller.com/blog/?p=129

It's about rebuilding the kernel on a debian/Ubuntu box but it tells you
how to load the essential cross-compiler tools.

I never did get the NFS server to work on the BB so this is how my make
file is set up:

$(REALFFT): maggie.c kiss_fft.c sm.c signal_source.c popen.c
  $(CC) -c $(CFLAGS) $(CPPWARNINGS) -I.. $(TYPEFLAGS) $+
  $(CC) -o $@ maggie.o kiss_fft.o sm.o signal_source.o popen.o -lm -lrt
  chmod +x $@
  rm -rf /tmp/code
  mkdir /tmp/code
  mv realfft /tmp/code
  scp jgd@neonjohn:/tmp/code/* root@maggie:/home/root/maggie/code
  rm -rf /tmp/code
  @echo ""
  @echo "finished $@"
  @echo ""

I copy the executable to /tmp because the path to my dev environment has
a directory with a space in the name (old windows legacy) and even
single quoting the fully qualified file name would not get scp to work.

You have to have SSH set up for this to work and be accessing the BB
over ethernet.

I also gave up on getting the 4.7 version of the compiler working. It's
not available as a deb for Ubuntu 12.04 and I didn't have the time to
spare figuring where everything went from the binary tar file. If you
take the time to figure that out please let us know.

John

wait, the speedup is on compiling time or is it on running time??

Pedro