Showing posts with label gcc. Show all posts
Showing posts with label gcc. Show all posts

20091108

Simple Fortran Cross-Compiler for ARM


Run Fortran code on my handheld ? Are you insane?

That's probably the first thing that comes to your mind after seeing the title of my latest post - but with the power of ARM processors of today, why wouldn't we run Fortran programs on them?

Fortran was (back in the 70's ... and arguably still is) the scientific computing language of choice for many academics and engineers. It became the basis for many of the most advanced matrix-algebra math libraries available to date, including BLAS, LINPACK, and LAPACK, which are used by the most powerful number-crunching machines in the world, not to mention all of the banks and stock-exchanges! What I find more interesting is that the popular math engine known as MATLAB makes heavy use of BLAS and LAPACK, as does a free MATLAB-like environment called Octave.

I should take a step back and say, that the simple cross-compiler I have devised is not in-itself a cross compiler, but a two-step solution using F2C and your friendly-neighborhood cross-GCC ;-) That is, the Fortran code is first translated to C code, and then cross-compiled into machine code. Although many people swear that a well written Fortran code pushed through a good Fortran compiler will always blow away C code (and they probably are right), it's always true that something is better than nothing. The advantage of using F2C is that you don't need to link your programs to libgfortran, and having fewer dependencies is always good in embedded systems.

In any event, F2C (and the resultant libf2c) were authored by several friendly and very smart people who were kind enough to make their software available to the general public on NetLib.Org.

Using a popular perl script called Fort77, and my tiny patch, you should be able to cross-compile Fortran code to object code (.f -> .o) just like you would with C (.c -> .o). You'll need a libf2c.so compiled for ARM as well as f2c.h installed and in your cross-compiler's default search paths. I built the cross-compiled libf2c using an armv5tel-softfloat toolchain using Gentoo's crossdev, and created a small overlay for the package, available here.

I have something special on my evil agenda for this... and will hopefully be announcing something about that within the not-to-distant future!

Lastly ... for all of the gadget-geeks that are reading this... what sort of devices are you hoping to find in your stockings this holiday season? I'm fairly infatuated with the Qualcomm Snapdragon / MSM devices, but the Nokia n900 (with an OMAP chip also looks very tempting).

20080710

VAI Prime Overlays Accessible Via Layman


After making my vuze-bin overlay accessible via layman, I decided to apply the same approach to my ts72xx related overlays on VAI Prime.

You can see the overlays via layman with

layman -o http://vaiprime.visibleassets.com/~cfriedt/layman.conf -i [overlay-name]

So far, the available overlay-names are as follows:

  • jvmcp (Miniaturized Java environment suitable for the ts72xx boards)
    • custom JamVM (1.5.1)
    • custom GNU Classpath (0.97.1)
  • vai (mainly custom apps for the ts72xx)
    • custom JamVM (1.5.1)
    • custom GNU Classpath (0.97.1)
    • custom battery monitor
  • maverick (overlays necessary for creating a EABI/MaverickCrunch toolchain for the ts72xx)
    • patched binutils
    • patched gcc
    • patched crossdev
    • patched uclibc
  • ts72xx (overlay of applications for the ts72xx)
    • patched fastjar
    • patched busybox
    • patched screen
    • patched portage-utils
    • patched bash
    • patched java-config
    • patched jamvm
    • patched rxtx
    • patched ant-core
    • patched ant-eclipse-ecj
    • patched eclipse-ecj
    • patched gnu-classpath
    • patched mpfr
    • patched nfs-utils
    • patched libnfsidmap
    • patched openvpn
    • patched dropbear
    • patched wpa_supplicant
    • patched binutils (2.15)
    • patched gcc (3.4.6
    • patched db
    • patched psmisc
  • ts72xxtc (binary-compatible toolchain for factory TS filesystem)
    • patched glibc
    • patched linux-headers
It would probably be wise to move at least the binutils and gcc from ts72xx to ts27xxtc.

Anyway, check out the overlay with

layman -o http://vaiprime.visibleassets.com/~cfriedt/layman.conf

20080218

MaverickCrunch / EABI Toolchain, Kernel, and Sysroot




Hi everyone,

I just announced a somewhat lengthy HowTo with information on building a fully compliant kernel, root filesystem, and toolchain for use with the ep93xx series of SOC's. This is really mainly addressed at Gentoo Linux users due to the build system in place.

GentooWiki:Gentoo_for_the_TS72xx_SBC_(Full_Distro)

The next few steps are getting a package manager working, a commissioning station, and also a database for storing client/host keys.

20080201

Maverick-Crunch / EABI support for Crossdev




Since I've been using the TS-7xxx boards from Technologic Systems, I've been wanting to experiment a bit more with the Maverick-Crunch floating point coprocessor in order to squeeze a bit more performance in number-crunching apps.

Here are some simple instructions for creating an armv4tl-maverick-linux-gnueabi toolchain using Gentoo/Portage/Crossdev. These instructions are current as of 26. February 2008.

[ Update: 26. Feb, 2008 ]

The procedure is tested and I have yet to experience any bugs in any normal userspace applications. I know that lame now produces mp3s 25 times faster, and there were no audible errors, which basically confirms with Martin Guy's results that the Maverick FPU is being used.

The only thing that I am lacking is a better stress test - paranoia.c just segfaults, and I'm not really sure why.

I've moved the instructions, as well as instructions for creating an eabi Linux kernel and a full userland, to the Gentoo Wiki.