Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Forum

  Home arrow Linux For Devices Articles arrow Comparing Scratchbox cross-compile times to native compile times

Comparing Scratchbox cross-compile times to native compile times
By victor donselaar

Rate This Article: Add This Article To:

Foreword: Scratchbox, an open source project to simplify cross-platform software compilation, has recently made several advances that may interest embedded device developers. This whitepaper describes how Scratchbox -- which was originated by Movial and is being sponsored by Nokia -- is helping Debian ARM strive for parity with Debian x86 by enabling package maintainers to build native ARM...

applications on fast x86 PCs, without modifying package build scripts.

A more basic Introduction to Scratchbox is also available as background.



Cross compiling versus native compiling

Scratchbox is a open source configuration and compilation environment for building Linux software and even entire Linux distributions. The basic idea in Scratchbox is to offer developers an environment that works and looks like the target environment before the target environment is available. This speeds up development and facilitates cross-compilation.

During the past months the Scratchbox development team has focused on making Scratchbox work more like a native build system, and bringing in support for additional architectures (like MIPS). The focus has been largely on building Debian packages using Scratchbox, as it appeared to be quite difficult in the past. Debian policy has been that everything should be built natively -- which is very time consuming and quite tedious, for example on ARM based systems. Scratchbox is designed to enable faster building, without hacking all the build scripts of all possible packages. It would be great to get the Debian ARM version up to date with the Debian x86 version.

Briefly, we have modified the Scratchbox environment and Debian tools so that they allow building almost any Debian package for ARM just like it would be done on a native ARM-PC or equivalent. The Scratchbox ARM environment with Debian Devkit looks just like an ARM-PC that has Debian installed, although in reality you are comfortably using a fast x86 system with its own Linux distribution. This makes fast and native compilation possible.

Scratchbox compile times

We wanted to prove our claim that Scratchbox makes cross-compilation faster and easier, and for this reason we compared some real compile times with native building versus Scratchbox compile times.

The main thing with Scratchbox is to make cross compiling easy, so that it is not necessary to modify the source packages or build systems. To prove our point, we chose some packages that are generally seen to be hard to cross-compile. Gtk2 and the helper libraries you need for that have traditionally been quite challenging to cross-compile. However, with Scratchbox we didn't need to tweak the build scripts at all. We also compiled gimp for more proof.

We used a ARM-PC (see below) as the Native compile environment and also as the CPU-transparency device when compiling with Scratchbox.

The graph below shows the actual compile times. The results show that Scratchbox really shortens the time needed for cross-compilation compared to native ARM. E.g., cross-compiling gtk2 on Scratchbox takes almost 10 times less time than on native ARM PC. The difference remains about the same with other packages, indicating that Scratchbox tremendously decreases the cross-compilation times. On the other hand, the difference between Scratchbox and native x86 was quite tolerable.


Scratchbox compiles are nearly as fast as native x86 compiles.
Tabulated data appears below.


PackageNative ARMSB ARMNative x86
Glib261min 59sec6 min 20sec2 min 50 sec
ATK23min 18sec2min 18sec1min 4sec
Pango57min 8sec5min 2sec2min 42sec
GTK2275min 51sec18min 43sec12min 12sec
Gimp301min 34sec20min 12sec12min 5sec

Conclusion

We believe that the results shown in this article indicate clearly that compiling in Scratchbox is a lot faster than compiling the native way, for example for the ARM target. Scratchbox is now easier to use and set up, thanks to better documentation. Compiling in Scratchbox is almost as easy as compiling natively, and it doesn't require special hacking of packages like cross-compiling the old-fashioned way. We strongly encourage everybody to try it out and to challenge our claims!



Test platform details
  • Linux PC:
    • Intel Xeon CPU 2.80GHz; 80GB IDE HDD; 2GB RAM
    • Debian Sarge with Linux kernel 2.6.8-1-686
    • Scratchbox 0.9.8.2

  • ARM PC:
    • Intel SA110 CPU 233MHz; 40GB IDE HDD; 256MB RAM
    • Debian Sarge with Linux kernel 2.4.25



Further information

About the author: Veli Mankinen has been a technical project manager in Movial for over two years, and has been involved in many of Movial's embedded Linux projects. Veli is one of the lead architects and developers behind Scratchbox. The Scratchbox project originated at and is maintained by Movial, a Finnish software design, integration, and development firm specializing embedded Linux and Symbian devices.



Related Stories:


Discuss Comparing Scratchbox cross-compile times to native compile times
 
>>> Be the FIRST to comment on this article!
 
 
 
>>> More Linux For Devices Articles Articles          >>> More By victor donselaar
 



FUEL Database on MontaVista Linux
Whether building a mobile handset, a car navigation system, a package tracking device, or a home entertainment console, developers need capable software systems, including an operating system, development tools, and supporting libraries, to gain maximum benefit from their hardware platform and to meet aggressive time-to-market goals.

Breaking New Ground: The Evolution of Linux Clustering
With a platform comprising a complete Linux distribution, enhanced for clustering, and tailored for HPC, Penguin Computing¿s Scyld Software provides the building blocks for organizations from enterprises to workgroups to deploy, manage, and maintain Linux clusters, regardless of their size.

Data Monitoring with NightStar LX
Unlike ordinary debuggers, NightStar LX doesn¿t leave you stranded in the dark. It¿s more than just a debugger, it¿s a whole suite of integrated diagnostic tools designed for time-critical Linux applications to reduce test time, increase productivity and lower costs. You can debug, monitor, analyze and tune with minimal intrusion, so you see real execution behavior. And that¿s positively illuminating.

Virtualizing Service Provider Networks with Vyatta
This paper highlights Vyatta's unique ability to virtualize networking functions using Vyatta's secure routing software in service provider environments.

High Availability Messaging Solution Using AXIGEN, Heartbeat and DRBD
This white paper discusses a high-availability messaging solution relying on the AXIGEN Mail Server, Heartbeat and DRBD. Solution architecture and implementation, as well as benefits of using AXIGEN for this setup are all presented in detail.

Understanding the Financial Benefits of Open Source
Will open source pay off? Open source is becoming standard within enterprises, often because of cost savings. Find out how much of a financial impact it can have on your organization. Get this methodology and calculator now, compliments of JBoss.

Embedded Hardware and OS Technology Empower PC-Based Platforms
The modern embedded computer is the jack of all trades appearing in many forms.

Data Management for Real-Time Distributed Systems
This paper provides an overview of the network-centric computing model, data distribution services, and distributed data management. It then describes how the SkyBoard integration and synchronization service, coupled with an implementation of the OMG¿s Data Distribution Service (DDS) standard, can be used to create an efficient data distribution, storage, and retrieval system.

7 Advantages of D2D Backup
For decades, tape has been the backup medium of choice. But, now, disk-to-disk (D2D) backup is gaining in favor. Learn why you should make the move in this whitepaper.

Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
PLATINUM SPONSORS

 
 

 
 

 
 

GOLD SPONSORS


(Become a sponsor)

(Become a sponsor)

ADVERTISEMENT
(Advertise here)

Check out the latest Linux powered...

Mobile phones!

MIDs, UMPCs
& tablets

Mobile devices

Other cool
gadgets

Resource Library

• Unix, Linux Uptime and Reliability Increase: Patch Management Woes Plague Windows Yankee Group survey finds IBM AIX Unix is highest in ...
• Scalable, Fault-Tolerant NAS for Oracle - The Next Generation For several years NAS has been evolving as a storage ...
• Managing Software Intellectual Property in an Open Source World This whitepaper draws on the experiences of the Black Duck ...
• Open Source Security Myths Dispelled Is it risky to trust mission-critical infrastructure to open source ...
• Bringing IT Operations Management to Open Source & Beyond Download this IDC analyst report to learn how open source ...


BREAKING NEWS

• NAS system houses 2.5-inch drives for up to 6TB
• Atom SBC boasts special low-power mode
• Android leaps to rugged handheld, and more phones
• Simulator runs Android apps on Ubuntu
• Fanless industrial PC taps Atom
• Router platform runs OpenWRT Linux
• Feature-packed UMPC survives four-foot drops
• UMPC pioneer gives up the ghost
• Biodegradable, solar-powered netbook runs Linux
• Hypervisor rev'd for higher reliability
• Eurotech spins Atom development kits
• Home media server to demo on Intel Atom platform
• Atom boards feature fanless DC operation
• Low-cost pluggable NAS adds Linux support
• Taiwan open source conference sets agenda


Most popular stories -- past 90 days:
• Linux boots in 2.97 seconds
• Tiniest Linux system, yet?
• Linux powers "cloud" gaming console
• Report: T-Mobile sells out first 1.5 million G1s
• Open set-top box ships
• E17 adapted to Linux devices, demo'd on Treo650
• Android debuts
• First ALP Linux smartphone?
• Cortex-A8 gaming handheld runs Linux
• Ubuntu announces ARM port


DesktopLinux headlines:
• Simulator runs Android apps on Ubuntu
• Hypervisor rev'd for higher reliability
• Pluggable NAS now supports Linux desktops
• Moblin v2 beta targets netbooks
• Linux-ready netbook touted as "Student rugged"
• USB display technology heading for Linux
• Ubuntu One takes baby step to the cloud
• Game over for Linux netbooks?
• Linux Foundation relaunches Linux web site
• Dell spins lower-cost netbook


Also visit our sister site:


Sign up for LinuxForDevices.com's...

news feed


Or, follow us on Twitter...