GHC builder board up’n’running

Just to write some status, I’ve dedicated received Freescale i.MX53 Quick Start Board to serve as a GHC builder machine. It’s already running for some time. Installed OS is Ubuntu 11.10 and I’ve installed on it Ubuntu’s 12.04 LLVM 3.0 packages. The builder already caught one issue during the end of February which I’m still trying to solve in my currently very limited free time… If you’d like to see results of the builder, then have a look into cvs-ghc mailing list and search for kgardas-linux-arm-head string in the emails subjects.

Welcome back Freescale i.MX53

Few months ago I’ve been contacted by Marsha Chang from Freescale i.MX53 marketing division if I’d like to have another i.MX53 Quick Start Board as a replacement for the board I needed to return back to Freescale during this summer.
Having more ARM boards never hurts, so I replied “yes” quickly and today another i.MX53 is already siting on my SMC switch with preinstalled Ubuntu 11.10. The only quirk so far I’ve had with Ubuntu, which looks like switched to NFSv4 and this all goes kind of wrong with my Solaris 11 ZFS/NFS id mapping. Since both machines are well secured and basically just available to me alone, I’ve given up on increased NFSv4 security and decided to use quickest and least hurting path and enforce usage of NFSv3 on Ubuntu side about which I know is running well. At least it does so in Ubuntu 11.04 running on my Pandaboard. The trick is to put vers=3 into appropriate option column in /etc/fstab file:

solaris:/export/home/karel /export/home/karel nfs vers=3 0 0

Otherwise everything is working as expected and the board is already crunching through LLVM 3.0 compilation and testing, but that’s the topic for next post anyway.

New hardware: Pandaboard

First of all *big* thanks to Freescale for lending me i.MX53 Quick Start Board. This was a move which basically started my project and although days of i.MX53 in my office are numbered and I need to return the board soon it still did a lot of work here and also motivation of myself to continue with the project! So thanks a lot Freescale!
As I wouldn’t like to stop the project I’ve decided to purchase Pandaboard myself and at least give it a try, since general feeling you can get about the board from the Pandaboard discussion group is kind of mixed. Let’s compare both boards in a table and then I’ll explain it a little bit.

i.MX53 Quick Start Board Pandaboard
CPU speed single-core Cortex A8 dual-core Cortex A9 (twice and a bit faster than single-core Cortex A8)
CPU/MEM temperature stability stable as a rock easily overheated, e.g. make -j2 fails several times per week
SD/microSD card stability stable as a rock very weak and very sensitive to card in use
Ethernet/NFS mount stability stable as a rock kernel sometimes crashes on memory allocation in USB/Eth driver

i.MX53 Quick Start Board and Pandaboard together on top of SMC GS8P-Smart switch


With Pandaboard, the first problem I’ve hit was sensitivity to SD card. I’ve originally purchased Kingston SDHC 8GB Class 10 (UltimateX 100X), but this does not work well. The second attempt with card purchase was much better and I’ve used recommended Transcend SDHC 8GB Class 10 this time without any issue (so far, knocking on the wood! :-)). I reported this my issue and complained loudly about it. I’ve though this is really board design issue (weak hardware), but some people also think that it might be software issue. See the thread SD card compatibility issue on panda discussion group. Also search the group and you will see a lot of other reports about incompatible cards or cards issues. So if you are going Pandaboard route, be very careful with your card choice!
Another issue you will easily hit with Panda, especially if you plan to use it like me for building some huge software package, is overheating. I’m using this nice temperature monitoring tool for temperature measurements on OMAP4. When stress testing panda with make -j2 I’ve been able to get up to 92°C without any troubles, I mean it’s really easy to get to this temperature. Anyway, this temperature is quite high for my taste and also for Panda since it fails several times during the stress testing and so at the end I’ve decided to start another discussion thread on the group and ask what’s the recommended heatsink for Panda. I’ve purchased Primecooler PC-NB1 for my panda at the end and it really does its job very well. It basically decreases top temperature from 92°C to just 52°C which is much more acceptable for me at least.
The last issue with Panda which I’ve observed so far is its mediocre ethernet controller connected to USB. Its current software support is quite weak, but I still don’t have time to test proposed solution yet.
I hope this last kernel/NFS/Eth/USB issue will be solved in the next Ubuntu release for Pandaboard and makes my Panda really stable at the end.

Primecooler PC-NB1 on top of Pandaboard


Primecooler PC-NB1 on top of Pandaboard from the top

It takes quite some time…

Indeed, it takes quite some time to build unregisterised build of GHC on ARM machine. But let’s start from the beginning. I’ve been always quite ignorant to major computer architecture x86. To be honest this is probably caused by my laziness to read more about it since my university studies where I’ve been hit by all those segments, chaotic memory model and such. I must admit that AMD did really good job on AMD64, finally flat address space, 64 bit etc, but yet the platform is so boring, running everywhere… 🙂

So what’s more interesting to me are all those other platforms: PowerPC, MIPS, ARM, IA64, etc, etc. Generally speaking I quite like load-store CPU model and since last year I’ve more focused my attention to IA64 and ARM. IA64 since this is quite interesting from the assembler point of view and to ARM, since this is x86 world conqueror and my bet is that’s also future architectural winner. So ARM. I’m its user for more than five years … running it in my mobile phone, but I’m still more and more curious to learn a little bit more about this architecture and somehow connect this to my still to be performed Haskell learning — as Haskell is another project which makes me wonder what will be its outcome. Quite interesting language indeed. So Haskell and ARM, that’s it. From Haskell I’ve chosen GHC as it seems to be most spread around the community, although to be honest this is not the most easy choice if I consider ARM architecture. Anyway, the project evolves quickly and man is even able to perform unregisterised (read: build which produces not so fast binaries) build of GHC on ARM machine. I did this from time to time on GCC’s compile farm EfikaMX hosts, but still was considering to buy my own machine for better GHC/ARM hacking which I hope this blog will be about.
Anyway, big thanks to Freescale and big thanks to my friend working for Freescale who lend me nice i.MX53 Quick Start Board. I’m now able to start actual “local” tests and even hacks as time permits.

I’ve installed Freescale recommended Ubuntu/Debian based distro, installed provided GHC 6.12.1 and was able to build unregisterised build of GHC 7.0.3. I’ve used following mk/build.mk file to perform the build just to save the time I’ve disabled profiling libs which I don’t need. I need GHC 7.0.3 just to be better prepared to build GHC HEAD.

GhcUnregisterised=YES
GhcWithNativeCodeGen=NO
SplitObjs=NO
GhcLibWays=v

And finally I got back to the post title, funny thing is, it took 16 hours 30 minutes to perform this build! Interesting is that what I observed from top, it looks as majority of time was spent in C compiler which makes a hope that perhaps future GHC with either LLVM or NCG ARM support might run quite faster… Err, if you wonder, I don’t hold build tree on (micro)SD card nor SATA drive nor USB flash connected to the i.MX53 board. I use NFS to mount some space from my main Solaris workstation to the board. This certainly causes some slowness, but not so big, believe me and I rather trust ZFS on mirrored drives than any consumer flash storage on the board.