Posts

Integrating Intercom to cloud App keeps me out of trouble… (ARM NEON)

I have been busy over the last few days integrating Intercom into a client’s cloud app. I have integrated quite a few SaaS systems of late (and written not a few REST interfaces myself) and I am quite enjoying this integration as the data model is good and the REST interface is reasonably easy to use!

So far so good, and at least it keeps me out of trouble, the specific trouble I have in mind is to attempt to implement a visual programming front-end for the ARM NEON SIMD instructions using the very exciting noFlo Javascript library!!

The ARM NEON instructions are very powerful SIMD instructions that are very useful for optimising image processing and computer vision tasks on ARM devices. They are however quite difficult to use as each instruction has so many variants for the different input and output element types. I reckon it could be a problem well suited to visual/graph flow programming and as far as I can see the most capable people at those races are those in the noFlo team – I am getting seriously excited about their work!

Anyway back to Intercom for the moment!

Cross compiling libpng for ARM Linux with Neon and Zlib

libpng is the standard software library for creating .png image files. It can be built for arm with NEON SIMD support. Cross compiling it for ARM is reasonably straight forward. Its only dependency is zlib which configure can have problems finding.

Before building libpng you will first need to compile zlib.

Then download the libpng source from here, un-zip it etc. and then run confgure as follows:

./configure --host=arm-linux-gnueabi CC=arm-linux-gnueabi-gcc \
    AR=arm-linux-gnueabi-ar STRIP=arm-linux-gnueabi-strip RANLIB=arm-linux-gnueabi-ranlib \
   CPPFLAGS="-mfpu=neon -I/path/to/zlib/include/files" LDFLAGS="-L/path/to/zlib/lib/files"  \
   --prefix=/path/to/dir/for/output/files   

In the above command replace:

a.) the path to your zlib include files (probably inside the install directory the the zlib build installed to)
b.) the path to your zlib lib files
c.) The path to the directory into which you want all of the output files installed
d.) change the compiler names (if different from arm-linux-gnueabi-gcc etc.)

Once configure completes you make & install:

make
make install

Now copy the files from the output directory to your ARM device.