DayPerl


Description

This program will automatically generate the perl extension module directory for a daylight toolkit wrapper. All the dt_ libraries are included (but not the dc_ Rubicon toolkit nor the du_ user functions).


Prerequisites

  1. Perl5 must be installed (5.6 - 5.8)

  2. C compiler (gcc is fine)

  3. $DY_ROOT is defined. E.g., DY_ROOT=/usr/local/daylight/v483

  4. libdl_stubs.a is built in $DY_ROOT/contrib/lib. To do this:
            cd $DY_ROOT/contrib/src
            make


Instructions

  1. Run the parse_perlv.pl program.
          perl parse_perlv.pl  

    The program will make a makefile_include specific to the platform and perl version that the script is running on.

  2. Make the DayPerl module and install it.
            make (using dynamic libs)
            or
            make static (using static libs)
      
            make test (using dynamic libs)
            or
            make test_static (using static libs)
    
            su - root  
            make install
    *Note for SGI* If you are using SGI and get errors during 'make test' remake DayPerl using static libraries.

    (You must become the owner of perl to install the package.)

  3. Test it out by running this really meager test program.
            #! /usr/bin/env perl
            use DayPerl;
            $orig = "c1c(Br)cccc1";
            $molh = dt_smilin($orig);
            print "molecule handle = $molh\n";
            $smiles = dt_cansmiles($molh,0);
            print "smiles = $smiles\n";
            print "NULL_OB = " . NULL_OB . "\n";
            print "TYP_PROGRAM = " . TYP_PROGRAM . "\n";
            print "TYP_MONOMER = " . TYP_MONOMER . "\n";
            print "DY_THOR_USMILES = " . DY_THOR_USMILES . "\n";
            print "DX_EDGE_TRI = " . DX_EDGE_TRI . "\n";

    The results should look something like:

            molecule handle = 1
            smiles = Brc1ccccc1
            NULL_OB = 0
            TYP_PROGRAM = 70
            TYP_MONOMER = 61
            DY_THOR_USMILES = 1
            DX_EDGE_TRI = 8


Example Code

Several example programs are provided with the Daylight software distribution as contributed source code, in $DY_ROOT/contrib/src/perl/examples.


How To Program With DayPerl

Use the functions as documented by the Daylight manuals.

Each dt_ function is available as a perl function. The only difference between their C syntax and perl is that string lengths are not required for passed arguments nor returned values. Likewise, constants are all defined and may be used as in C (although in perl they are actually functions).


Files to build DayPerl


COMPATIBILITY

DayPerl 1.4 has been sucessfully built with the following configurations (all w/ Daylight 4.8):


Known Bugs

  1. Invalid string = ``KLUDGE_INVALID_STRING''
  2. The toolkit defines an ``invalid string'' which is passed to or returned by a few functions. In C, the invalid string is defined as the NULL pointer. Since no such thing exists in Perl, the current implementation is to use ``KLUDGE_INVALID_STRING''. One (perhaps the only?) important functionality requiring the invalid string is regular expression searching in Merlin, which requires the function

    dt_mer_strsearch(hitlist,column,searchtype,action,find_next,status,s1,s2)

    where s2 = the invalid string.


References

  1. perlXS
    Perl 5.6 Documentation: perlXS - XS language reference manual. See http://www.perldoc.com/perl5.6/pod/perlxs.html

  2. Alex Wong's talk at MUG '96
    See http://www.daylight.com/meetings/mug96/wong/wong.html.


Revision History

        DayPerl-1.1  15 March 1996
        DayPerl-1.2  13 March 1998 (Roger E Critchlow Jr)
        DayPerl-1.3  15 January 2002 (Jeremy Yang)
        DayPerl-1.4  15 June 2003 (Margaret Kamphorst)


Copyright

        (C) 1996 Chiron Corporation
        (C) 1998-2003 Daylight CIS Inc.