DayJava: The Daylight Java Toolkit Wrapper

Michael A. Kappler, Daylight CIS, Inc.
01 Jul 2004

Background
----------

This is a Java Native Interface (JNI) to the Daylight Toolkits.

The list of supported toolkits are:
	Smiles
	Smarts
	Depict
	Fingerprint
	Program Object
	Thor
	Merlin
	HTTP

Contents
--------

The GNU uuziped tar file contains the following files:

makefile: makefile which compiles the c code and links it with the daylight
          static libraries into a shared library.
          It also will compile the Java code
*.[ch]:   the c and header files wich call the various Daylight Toolkits
          his files are required in the makefile
com/daylight/*.java:
          Java source code for the JNI Daylight Toolkit interface
          here you can lookup the function or constant declarations
com/daylight/*.class: compiled Java code

How to Use DayJava
------------------

This directory should be placed under $DY_ROOT/contrib/src.
Execute the '_INSTALL.sh' script, or mannually do of the following:

1.  Type 'make install' in this directory.  This will build the DayJava library
    named "libdj.so" and install it at $DY_ROOT/contrib/lib.  The Java byte
    code will be installed at $DY_ROOT/contrib/com/daylight and "Contrib"
    classes at $DY_ROOT/contrib/bin.

2.  Set the enviroment variable LD_LIBRARY_PATH to include the
    $DY_ROOT/contrib/lib the enviroment variable CLASSPATH to include
    $DY_ROOT/contrib and $DY_ROOT/contrib/bin.

3.  Example Java source code and compiled classes are provided in
    subdirectories.  The following is a example program which takes smiles
    from stdin and is a good test that DayJava is working properly.

% cd $DY_ROOT/contrib/bin
% echo "OCC" | java cansmi

The output should be: CCO.  If not, try debugging with "java -verbose cansmi"
and "java -verbose:jni cansmi".  To test use of of toolkits, try "make test"
in this directory or a subdirectory.

Notes
-----

Parameters for methods are the same as arguments for routines described in the
toolkit documentation, except for the following differences:

- status parameters are passed as an integer array of length 1
- string length parameters are not part of the interface
- most strings are passed and returned using Unicode
	(for info on Unicode, see http://www.cl.cam.ac.uk/~mgk25/unicode.html)
- for binary support, the following strings routines use a byte array:
	dt_stringvalue
	dt_setstringvalue
	dt_appendstringvalue
	dt_binary2ascii

The following Java Development Kit (JDK) versions were used to compile this
wrapper without errors or warnings:
	JDK 1.5.0
	JDK 1.4.2
	JDK 1.4.0
	JDK 1.3.1
	JDK 1.2.1
	JDK 1.1.6
	JDK 1.0.6

The following platforms have passed testing:
	Red Hat Linux 7.x, 9, Enterprise 2.1
	SUN Solaris 7, 8, 9

The following platforms have not passed testing:
	Mac OSX 10.2, 10.3

The following platforms have not been tested yet:
	Red Hat Enterprise 3.0
	SGI Irix 6.x

This JNI interface to the Daylight Toolkit may be freely distributed as long
as it is made clear that neither the authors nor Novartis or Daylight will be
held responsible for any damage or other results caused by the usage of this
code.  Please keep in mind that most of the code was created by an algorithm
and not tested.

For questions, you may contact Daylight support <support@daylight.com> for
assistance.
