Jump to content
  • entries
    657
  • comments
    2,692
  • views
    898,349

DPC+ARM - Part 5, C Compiler


SpiceWare

1,537 views

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.

test.zip

 

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.

 

 

terminal



blogentry-3056-0-76772900-1424828036_thumb.png

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>.

 

 

cd command



blogentry-3056-0-29862800-1424828016_thumb.png

Type in ls to list the files in the folder.

 

 

ls command



blogentry-3056-0-53526000-1424828021_thumb.png

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
 

cat commands



blogentry-3056-0-82230000-1424828014_thumb.png

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

 

 

merged files



blogentry-3056-0-21559800-1424828024_thumb.png

 

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

 

 

 

reconfigure



blogentry-3056-0-11762700-1424828034_thumb.png

You'll need to enter your Linux password to continue

 

 

configure dash



blogentry-3056-0-92394800-1424828018_thumb.png

Hit TAB to select <NO> then hit RETURN

 

 

select no



blogentry-3056-0-47599000-1424828035_thumb.png

 

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>

 

 

 

installer



blogentry-3056-0-84939400-1424827998_thumb.png

After a short wait you'll see the Welcome screen

 

 

welcome



blogentry-3056-0-20009500-1424828000_thumb.png

Go thru the next few screens, taking all the default options.

 

 

installing



blogentry-3056-0-84093200-1424827997_thumb.png

You can view the "Getting Started" guide if you'd like.

 

 

finished



blogentry-3056-0-61666600-1424827996_thumb.png

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.

 

 

unzip test



blogentry-3056-0-10822100-1424828038_thumb.png

Change into the new test directory by typing cd test

 

 

cd test



blogentry-3056-0-67020300-1424828017_thumb.png

then type ls -l bin to show that nothing's been built.

 

nothing in bin



blogentry-3056-0-31298900-1424828013_thumb.png

type make to compile

 

 

make



blogentry-3056-0-95324700-1424828022_thumb.png

then ls -l bin again to see custom2.bin, the compiled ARM code.

 

 

custom2.bin



blogentry-3056-0-39111700-1424828020_thumb.png

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.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...