DPC+ARM - Part 5, C Compiler
NOTE: This blog series is obsolete. Head on over to the Harmony/Melody Club where you'll find information on the new Linaro compiler and the new CDFJ coprocessor/bankswitch scheme that has many improvements over DPC+.
Update Ubuntu
There were some updates to Ubuntu. If you applied them, you'll probably need to re-install the Guest Additions, then restart your virtual machine.
Download
Due to the Max File size of 50 MB, I've divided each of the compiler installers into 3 parts using the split1 command.
Using your Host OS, create a new folder in the Shared Folder you set up during Part 2. I called my new folder arm_compilers.
Note: it's easier if you don't have any spaces in the folder name
Download the following files for the version(s) of the compiler you wish to install and save them into your new folder.
2011.03-42
2012.03-56
2012.09-63
2013.05-23
Also download and save this sample source code for testing the compiler.
1 If you'd like to learn about the split command then start up one of your Linux VMs, open a terminal session, then type man split. The command man is short for manual.
Merge
Since the files were split, we need to merge, or concatenate the parts. Start up your VM then run the Terminal program.
Use the cd command to Change Directory. The terminal has a slick auto-complete feature when you hit the TAB key so type the following cd /me<TAB>/sf_<TAB>/arm<TAB><RETURN> but hit the TAB key and ENTER/RETURN keys instead of typing the characters <TAB> or <RETURN>.
Type in ls to list the files in the folder.
We'll be using the cat command to merge the files. You can copy/paste the following into your terminal session. Use the Terminal's Edit menu or the SHIFT-CONTROL-V keyboard shortcut for the paste operation. See the end of Part 2 for Sharing the Clipboard if paste isn't working.
cat aa.bin ab.bin ac.bin > arm-2011.03-42-arm-none-eabi.bincat ba.bin bb.bin bc.bin > arm-2012.03-56-arm-none-eabi.bincat ca.bin cb.bin cc.bin > arm-2012.09-63-arm-none-eabi.bincat da.bin db.bin dc.bin > arm-2013.05-23-arm-none-eabi.bin
Tip: If you downloaded all 4 compilers, you can copy/paste all 4 of these lines at one time.
Type ls again to see that the files were merged
dash not supported
The installer doesn't support dash so we need to reconfigure Ubuntu to use bash instead. To do this, we run sudo dpkg-reconfigure -plow dash
You'll need to enter your Linux password to continue
Hit TAB to select <NO> then hit RETURN
Install
To run the installers you'll need to type ./installer_version, the leading ./ is required, it means you want to run a program located in the current directory. Remember to use the handy auto-complete feature - to install the 2011 version type in ./arm-2011<TAB>
After a short wait you'll see the Welcome screen
Go thru the next few screens, taking all the default options.
You can view the "Getting Started" guide if you'd like.
Once your prompt reappears in the terminal, log out of your linux VM then log back in.
WARNING: If you don't log out after installation, the compiler won't work.
Test
After logging back in, it's time to test that the compiler works. Open up a terminal session and change to the arm_compilers folder using the same method we did before: cd /me<TAB>/sf_<TAB>/arm<TAB><RETURN>
Unzip the test by typing in unzip test. The test.zip file is back up in the Downloads section if you missed it before.
Change into the new test directory by typing cd test
then type ls -l bin to show that nothing's been built.
type make to compile
then ls -l bin again to see custom2.bin, the compiled ARM code.
The size of custom2.bin will depend upon which C compiler you installed.
- 2011.03-42 - 8136 bytes
- 2012.03.56 - 8308 bytes
- 2012.09.63 - 8224 bytes
- 2013.05.23 - 8224 bytes
0 Comments
Recommended Comments
There are no comments to display.