commit | 796ef7e575bc034c6e55aa578a2b17e774215834 | [log] [tgz] |
---|---|---|
author | Otavio R. Piske <angusyoung@gmail.com> | Sun Jan 27 14:22:54 2019 +0100 |
committer | Clebert Suconic <clebertsuconic@apache.org> | Fri Feb 22 10:36:32 2019 -0500 |
tree | cff0e8e829d53766934a414fb8fed99bb44dba96 | |
parent | 8d396712cc3bfaf4a90e285696c7bed225217174 [diff] |
ARTEMIS-2260 Refactor the library build code This refactoring changes the native library build code to allow cross-compilation and brings the following changes: - Fix the link target to the one that was actually found by find_library - Replace add definitions with standard CMake C flags handling options. Among other things, this allow greater control over which compiler flags are used and makes it easier to turn on/off debug flags by manipulating the CMAKE_USER_C_FLAGS variable as documented in the README - Updates the CMake scripts to allow cross-compilation of the artemis native library into x86 32-bit code when building on a x86 64-bit system - Updates the library documentation - Defines C99 as the C standard in use so that the native library code can be compiled in older GCC versions - Renames the readme file so it can be better visualized on the web
This is a simple tutorial about building and packaging the libartemis-native library. The libartemis-native is a thin layer library that interface with Linux' lib AIO library as part of the journaling feature of the broker when operating with AIO journal.
The lib AIO is a Linux-specific dependency, therefore having a relatively modern Linux operating system is assumed for the purpose of this documentation.
In order to build the package, make sure you install these packages:
For example, on Fedora Linux, compilation of the library requires the following specific packages:
Using a 64-bit Linux OS, it is possible to cross-compile the 32-bit version of the library. For this, the 32-bits version of the GNU C Library and lib AIO should be installed.
Once again using Fedora Linux as an example, it would mean that the following packages need to be installed:
The Lib AIO is the Linux' Kernel Asynchronous I/O Support Library. It is part of the kernel project. The library makes system calls on the kernel layer.
This is the project information:
Git Repository: git://git.kernel.org/pub/scm/libs/libaio/libaio.git Mailing List: linux-aio@kvack.org
Example:
export JAVA_HOME=/usr/share/jdk1.7
if you are missing any dependencies, autoconf would tell you what you're missing.
The produced file will be under the ./target/nar (example: ./target/nar/artemis-native-1.0.0-amd64-Linux-gpp-jni/lib/amd64-Linux-gpp/jni/libartemis-native-1.0.0.so) and you will have to rename it manually under ./bin following the appropriate pattern.
Passing additional options to the compiler: cmake -DCMAKE_USER_C_FLAGS="-fomit-frame-pointer" -DCMAKE_VERBOSE_MAKEFILE=On .
Compiling with debug options: cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=On .
Cross-compilation: cmake -DCMAKE_VERBOSE_MAKEFILE=On -DCMAKE_USER_C_FLAGS="-m32" -DARTEMIS_CROSS_COMPILE=On -DARTEMIS_CROSS_COMPILE_ROOT_PATH=/usr/lib .
Cross-compilation with debugging symbols: cmake -DCMAKE_VERBOSE_MAKEFILE=On -DCMAKE_USER_C_FLAGS="-m32" -DARTEMIS_CROSS_COMPILE=On -DARTEMIS_CROSS_COMPILE_ROOT_PATH=/usr/lib .
The User Manual, chapter 38 (Libaio Native Libraries) will provide more details about our native libraries on libaio.