Chapter 38. Libaio Native Libraries

JBoss Messaging distributes a native library, used as a bridge between JBoss Messaging and linux libaio.

libaio is a library, developed as part of the linux kernel project. With libaio we submit writes to the operating system where they are processed asynchronously. Some time later the OS will call our code back when they have been processed.

These are the native libraries distributed by JBoss Messaging:

When using libaio, JBoss Messaging will aways try loading these files as long as they are on the library path.

38.1. Compiling the native libraries

Case you are using Linux on a platform other than x86_32, x86_64 or IA64 (Itanium), (for example IBM POWER) you may need to compile the native library, since we do not distribute binaries for those platforms with the release.

38.1.1. Install requirements


At the moment the native layer is only available on Linux. If you are in a platform other than Linux the native compilation will not work

The native library uses autoconf what makes the compilation process easy, however you need to install extra packages as a requirement for compilation:

  • gcc - C Compiler

  • gcc-c++ or g++ - Extension to gcc with support for C++

  • autoconf - Tool for automating native build process

  • make - Plain old make

  • automake - Tool for automating make generation

  • libtool - Tool for link editing native libraries

  • libaio - library to disk asynchronous IO kernel functions

  • libaio-dev - Compilation support for libaio

  • A full JDK installed with the environment variable JAVA_HOME set to its location

To perform this installation on RHEL or Fedora, you can simply type this at a command line:

sudo yum install automake libtool autoconf gcc-g++ gcc libaio libaio-dev make

Or on debian systems:

sudo apt-get install automake libtool autoconf gcc-g++ gcc libaio libaio-dev make


You could find a slight variation of the package names depending on the version and linux distribution. (for example gcc-c++ on Fedora versus g++ on Debian systems)

38.1.2. Invoking the compilation

In the distribution, in the native-src directory, execute the shell script bootstrap. This script will invoke automake and make what will create all the make files and the native library.

someUser@someBox:/messaging-distribution/native-src$ ./bootstrap 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p


configure: creating ./config.status
config.status: creating Makefile
config.status: creating ./src/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands


The produced library will be at ./native-src/src/.libs/ Simply move that file over bin on the distribution or the place you have chosen on the library path.

If you want to perform changes on the JBoss Messaging libaio code, you could just call make directly at the native-src directory.