A08 Native Extensions

Native extension are application and libraries natively compiled for your platform. This article explains how to manage, configure and build those extensions.

 

This article is based on impulse 1.8.

There are ports and serializer that require native extensions.  
A native extension is required if a port, a serializer or any other impulse extension need:

  • external applicatiosn to be called from a serializer or port,
  • external libraries in binary format to be linked to,
  • external libraries in source fomrat (c/c++) to be integrated.

 
The external applications/libraries/sources may be part of an impulse deployment (plug-in) or a requirement that need to be downloaded from external sites and installed.
Native extension usually support the following platforms:

  • Linux x-86 32bit
  • Linux x-86 64bit
  • Windows x-86 32bit
  • Windows x-86 64bit
  • OsX x-86 32bit
  • OsX x-86 64bit

Additional platforms may be supported if users re-configure a re-compile a given native extension.
 

External Applications

External applications for serializers can be configured using the serializers preference page.  
In case of ports you will find a specific native extension preference page (impulse->Native Extensions).
 

External Libraries

To embedd the functionality of the external libraries, impulse uses converter applications only, JNI/JNA DLLs/shared libraries are not used intentionally.
Reason for this is that shared libraries may crash the runtime engine and therefor the whole eclipse IDE.  
These converter applications are simple console application, interfacing with the java domain via stdin/stdout or a tcp port.
 

Configuration and re-compilation of native extensions

There are the following reasons that may force you to er-compile a native extension:

  • A pre-compiled converter does not work in the given environment (e.g. different linux environment).
  • No pre-compiled converter is deployed because of missing libraries (to be installed by the user).
  • A user wants to update required libraries.
  • A user wants to extend the converter.

Re-compilation is easy by using the native extension preference pages.   
If the extension required external libraries/source, the preference page starts with entry fields for binaries and sources/headers.
In the below fields you can configure the make process by setting the make command, the make target and additional flags and libs.
In the the button row below you find command buttons to compile and clean. Additionally you can open and modify the converter sources (all converters are open-source) as well the Makefile.
 

Flux based converter

All native extension with signal streaming are using flux as interface between the converter and impulse.
flux supports:

  • Signal and Scope definition
  • Signal data transfer (packed/compressed)
  • Bi-directional control interface

More about flux
 

Requirments for compiling native converter

 
impulse uses the GNU toolchain (make,gcc,g++) for compilation on all platform.
 
Linux
 Please install default gcc and g++ compilers (typically already installed with standard installation).
 
Windows
 Please install "MinGw" from http://www.mingw.org/
 
MacOsX
 Please install the "Command Line Tools for Xcode" from your App Store.