LibSaDpPac

**** THIS DOCUMENT IS OUTDATED. ****

This directory contains SARA DPU PACKET library.

1. Scope

This library is for ones who want to use SARA data on board Chandrayaan-1.
This library is non-supported software, and provided as is.

2. Structures

2.1. Core library
The core library is developed in C++.  The library works in OSX (tested in 10.5, Leopard) and in Linux (tested in Ubuntu 6.04LTS).
No tests have been done in Windows.

Note that the library is working with G++ version 4.2, but not 4.4.

C++ source code is locate in

<root>/src/

2.1.1. Dependence on the other library

libsadppac relies on liblinlog and librice.

These libraries are located in <root>/vendor directory.
To install, follow the command.

cd vendor/librice/current
make install
cd vendor/liblinlog/current
make -f Makefile.global install

2.1.2. Compile and Install
You may need cmake to create Makefile.

% cmake .

Then, Makefile is generated.

To specify the g++ executable (for example, you want to specify using /usr/bin/g++-4.2), do like
% cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.2

Then, Makefile-s are generated.  You can compile by

% make

Installation is done by

% make install

The library is installed under ${HOME}/SARA/

2.1.2. For developer

The header files are installed in ${HOME}/SARA/include
and the library is under ${HOME}/SARA/lib/

Three library files are there.
libirfpac.a
libsarapac.a
libascfmt.a

2.2. Java library

2.2.1. Overview
By great assist of SWIG, the C++ core library is converted to Java library.
The extended java library, jsadppac, is also developed.

2.2.2. Core library
The core library developed in C++ is converted to Java library.
For the installation, you may need SWIG.

% cd java
% make linux    # for Linux user
% make osx      # for Mac user
% make install

Note that JAVA_HOME environment variable must be set, otherwise the compilation would fail.

The name of the package is sadppac and
the library is installed to ${HOME}/SARA/java/libsadppac, constituting libsadppacjava.jar and libsadppacjava.jnilib

2.2.3. JSadppac
The extended library is developed in Java.  The name of the package is jsadppac.  To use JSadppac, you may need to install core library shown above.


2.3. Python library

2.3.1. Overview
By great assist of SWIG, the C++ core library is converted to Python library.

2.3.2. Core library
The core library developed in C++ is converted to Python library.
For the installation, you need SWIG.

% cd python
% python setup.py install --home=~

The library is installed to ${HOME}/lib/python.
You may add environmental varialbe PYTHONPATH to specify the above installed directory.

2.3.2.1 Core library installation to system-wide.

System-wide installation is also possible. (not recommended... because there are a lot of bugs...)

% cd python
% python setup.py install

will install the related files.


3. Miscellaneous informations

3.1 Coding style

3.1.1 Memory and memory leak

In order to keep the structure simple, 'reference' is not used throughout the source code.
'Pointer' is used for most of the implementation.
For the contents of packets, most of the 'get' routines returns the newly allocated memory
therefore, the user must delete the returned class explicitly.

3.1.2 Operators

No overloading of operators are supported.


Author: Yoshifumi Futaana

