Jun 12 2008

How-To: Compile applications natively on the PIKA WARP

Published by skar at 5:01 pm under How-To

This How-To details how to compile applications natively on the PIKA WARP. The main reason you might want to do this instead of cross compiling in PADS, the PIKA Application Development Suite, is that the application will not cross compile. You might also just find it easier to compile on the WARP directly. This How-To will guide you through all the steps required to compile your application natively on the WARP.

 

WARNING: Native compiling an application should only be used to help create your image and as such, it should be used only when you are running the WARP from an NFS share during the development process. Details on setting the WARP up to run from an NFS share can be found here under the Getting Started, Development System Setup section. This How-To assumes that you are developing using an NFS share and running the appliance from it.

 

 Step one of the process is to install the gcc package for your WARP.

[root@warphost pads]#  cd package

[root@warphost pads]#  mkdir gcc

[root@warphost pads]#  svn co http://svn.pikatech.com/pads/extra_packages/gcc/ ./gcc

[root@warphost pads]#  cd ../

[root@warphost pads]#  make gcc-install

 

At this point gcc is installed on your warp. You are ready to compile applications on the WARP. The following assumes that we are to compile the imaginary appX that has a standard configure, make and install setup. First copy the source code for appX to the appliance.

[root@warphost pads]#  cp -R appX/ buildwarp/root/root

 

 Now we need to log into the WARP and compile the application.

[root@warphost pads]#  ssh mywarp

~ #  cd appX

~/appX #  ./configure

~/appX #  make

~/appX #  make install

 

Assuming no compile errors, we have appX successfully installed on the appliance, may as well run it to test it.

~/appX #  appX

I am appX, bow before my awesomeness!

~/appX #  

 

Now let’s clean up before we try to make an image to burn to our WARP. We will remove our source folder,  remove gcc and then create an image.

~/appX #  exit

[root@warphost pads]#  rm -rf buildwarp/root/root/appX

[root@warphost pads]#  make gcc-clean

[root@warphost pads]#  make image

 

Assuming appX is not too large an application, you now have an image availble to burn to your WARP that includes appX. For details on how to burn an image to your WARP, please consult the PADS documentation found here under the Advanced Topics, Building and Updating Software in the NOR Flash.

 

There are some things to watch out for when compiling natively however. These would include:

  1. Use of the compile flag -mlittle-endian in the Makefiles. Since the processor on the WARP is big endian, this flag will produce unusable executeables.
  2. Compile flags that optimize for processor types other than ppc should be avoided.

 

3 responses so far

3 Responses to “How-To: Compile applications natively on the PIKA WARP”

  1. Skaron 12 Jun 2008 at 8:55 pm

    I just wanted to add a comment that I have used this method to successfully compile and run perl-5.8.8 and about 20 add on modules for it.

  2. [...] applications will just not cross compile. In that case read here for an optional method to get the application onto the [...]

  3. marekon 14 Jan 2009 at 4:21 pm

    If you are running gcc on the appliance to create natively compiled applications you may sometimes see errors about

    make[2]: Warning: File ‘filename’ has modification time ##s in the future
    make[2]: warning: Clock skew detected. Your build may be incomplete.

    This will happen if you are running from an NFS mount and the time on your PC is ahead of the time on your appliance. In order to get rid of these errors sync the time of the PC and appliance.

Trackback URI | Comments RSS

Leave a Reply