Tutorial: Compiling OpenJAUS PDF Print E-mail
Written by Danny Kent   

OpenJAUS is designed to be usable on a variety of different platforms including both Microsoft Windows and various flavors of Linux. It has been extensively tested on both MS Windows XP and Debian based Linux flavors such as Ubuntu. This tutorial will guide the user on how to obtain the proper release package and compile the libjaus, libopenJaus, ojNodeManager and ojVehicleSim. For details about compiling using MS Visual Studio in Windows see here and for compiling using the GNU GCC toolchain on Linux see here.


Windows (Microsoft Visual Studio)

Requirements

The OpenJAUS code base for Windows is distributed as a Microsoft Visual Studio solution. First obtain the OpenJAUSv3.3.x-Win32-VS20xx.zip file from the Downloads section. Unzip the file to a local folder. The zip file will unzip its contents into a folder called OpenJAUSv3.3.x with the directory structure shown below:

OpenJAUSv3.3.x
  ├ libjaus
  ├ libopenJaus
  ├ ojNodeManager
  ├ ojVehicleSim
  └ ThirdParty

The Microsoft Visual Studio project file is located in the OpenJAUSv3.3.x folder and labeled OpenJAUSv3.3.x.sln. Open the solution file in Microsoft Visual Studio (MSVS). Once opened, the project's contents will be listed in the resource view on the left side of the screen. The OpenJAUS solution is comprised of four projects, mirroring the directory above. The default project is set to ojNodeManager. To compile the code base go to Build > Build Solution. This will compile all the projects with the Debug information retained. This is done to more easily facilitate debugging of applications based on the libraries. Each project has the appropriate dependencies setup using relative paths, therefore it should compile for the developer in any configuration. The libraries projects are output as DLLs into the lib directories. The libraries libjaus and libopenJaus can be linked against other projects using the .lib files. To run projects built against them, ensure the appropriate DLL files are available either locally or globally on the system. The executables projects are output to their respective bin directories. More details about running those applications can be found in the Running ojNodeManager and Running ojVehicleSim tutorials respectively.

The OpenJAUS code base relies on two external libraries which are distributed within the distribution. These are PThreads-win32 and pdcurses. These open source libraries are located in the ThirdParty folder and provided as a convenience to OpenJAUS developers. Each of these libraries is distributed under their own licenses which are located in their respective folders.


Linux (GNU GCC Toolchain)

Requirements

  • make
  • gcc
  • g++

The OpenJAUS code base for Linux is distributed as a collection of Makefiles. First obtain the OpenJAUSv3.3.0-Linux.tar.gz file from the Downloads section. Untar the file to a local directory using the command shown below.

tar -xzvf OpenJAUSv3.3.x-Linux.tar.gz

The tar file will expand its contents into a folder called OpenJAUSv3.3.x with the directory structure shown below:

OpenJAUSv3.3.x
  ├ libjaus
  ├ libopenJaus
  ├ ojNodeManager
  └ ojVehicleSim

Inside the OpenJAUSv3.3.x folder is a top-level Makefile which will compile the complete code base. Each subfolder also contains a local Makefile which can be used to specifically compile that project. To compile the code, execute the "make" command in the OpenJAUSv3.3.x folder.  It is up to the individual developer to decide how to link their code with the OpenJAUS libraries. Some developers may prefer to install the OpenJAUS header files and libraries to globally accessible directories. For example, on a Linux system: /usr/include/ and /usr/lib/. To minimize system invasiveness, OpenJAUS does not install itself into system directories, rather, all code and binaries remain in the folders included in the release download.

To execute code developed with these libraries it is recommended that the developer configure the dynamic linker runtime bindings to reference the OpenJAUS library directories /libjaus/lib/ and /libopenJaus/lib/. This is done by editing the system's ld.so.conf (most likely located at /etc/ld.so.conf) to include these directories and then by running the command: "ldconfig". Another option to this method would be to simply include the files libjaus.so and libopenJaus.so in the executable's working directory.

The default build of the libraries includes all symbols and debug information within the shared object (.so) files. This is to facilitate efficient development and use of a run-time debugger. To reduce the size of the installed libraries, the information can be removed by using the "strip"command.

 

0 Comments

Add Comment

Copyright © 2010 OpenJAUS. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.