Overview
This part will guide you through the steps to create a working cross compile platform for the Beaglebone. I will try to keep it generic enough that you could use any toolchain and target distro, but this is my target:
- BeagleBone Black Rev A6
- Saucy Ubuntu 13.10 with Kernel 3.8.13-bone32 (12/13/2013) installed to eMMC
- CircuitCo LCD7 Rev A3
See Part 2 for configuring and building Qt.
Downloads
Download these files while you read the instructions below...- Virtual Box 4.3.6: Windows Host, Others
- Ubuntu x64 12.04 LTS: Direct Link, Others
- Linaro Toochain GCC 4.8 (04/17/2013): Direct Link, Others
- Qt 5.2.0 Source: Direct Link, Others
- TI Graphics SDK (for OpenGL ES2.0 support): to be covered later
Setup Generic Virtual Machine
Follow these instructions to create and setup a vanilla Ubuntu VM. If you already have a VM or are going to use your host Ubuntu install, proceed to the "Install Compiler Prerequisites" section.
- Install Virtual Box
- Create a new Virtual Machine
- Enter a name, such as "Ubuntu Qt Builder"
- Change Type to "Linux", if it hasn't automatically done so.
- Change Version to "Ubuntu (64 bit)"
- Specify memory size, at least 1.5 Gb for better compiling performance.
- Create a new virtual hard drive (ignore size recommendation for now)
- Select VDI
- Select Dynamically allocated
- Set size to at least 40 Gb (it's dynamic, so why limit yourself)
- Once the virtual machine is created, change the advanced settings
- Click the Settings button and then select "System" from the list on the left
- Click the "Processor" tab and change the Processors to something greater than 1
- Select "Display" from the list on the left
- Max out the video memory
- Select "Storage" from the list on the left
- Click on the empty CD drive under the Storage Tree
- Under the attributes section, click the CD symbol and select "Choose a Virtual CD/DVD disk file"
- Point it to your Ubuntu ISO.
- Adjust other virtual machine settings as desired.
- Start the virtual machine and perform the Ubuntu Install
- After the install completes, reboot the virtual machine. Don't forget to hit enter to "eject" the boot CD when it prompts.
- Let it install the 200+ updates
- After another reboot, install Guest Additions by clicking on the Devices menu of the running VM, and then selecting "Install Guest Additions..." (You may have to do this again after Ubuntu installs future updates)
Install Compiler Prerequisites
Since we are running a 64 bit host OS, we need to install the 32 bit libraries to run some of the build tools. We also need the Linaro headers. Follow these instructions to install both of these required packages
- Open a new Terminal or xterm window
- Type the following to install the Linaro headers and 32 bit compatibility libraries
> sudo apt-get install ia32-libs
Extract Qt Source
Perform this step to expand the source tarball into your home directory. It will reside under the tarball directory of "qt-everywhere-opensource-src-5.2.0". This can be done in a new terminal window, while the prerequisites are being installed.> cd
> tar -zxf qt-everywhere-opensource-src-5.2.0.tar.gz
Now we create a couple of folders for our shadow builds. This helps keep the main source folder clean of configuration files and binaries.
> mkdir qt-5.2-host
> mkdir qt-5.2-target
Extract Linaro Toolchain
I chose to use the Linaro toolchain because it came highly recommended and the Ubuntu cross compile chain does not include a g++ binary, which will be required to compile Qt.Issue these commands to extract the Linaro toolchain, change the directory name, and move it to a global location:
> tar -Jxf gcc-linaro-arm-linux-gnueabihf-4.8-2013.04-20130417_li nux.tar.xz
> mv gcc-linaro-arm-linux-gnueabihf-4.8-2013.04-20130417_linux \
linaro
> sudo mv linaro /usr/local
Conclusion
You should now have a working Ubuntu virtual machine that is:- Up-to-date
- Has necessary host utilities installed
- Contains a folder, in the home directory, with the Qt source
- Has the Linaro toolchain installed under /usr/local/linaro
Continue on to Part 2 for the configuration and building of Qt.