Skip to content

PetDependencies

FrancisBond edited this page May 3, 2005 · 26 revisions

Overview

In order to compile all of the PET functionality, several external libraries are required. Following are some brief comments on which aspects of PET require what external package and some suggestions on obtaining and installing these packages. However, when in doubt, use the documentation that comes with individual packages, specifically when compiling for an unusual target platform or using versions different from the ones listed below.

The default linking regime for PET is dynamic (thus creating references to library files that are resolved at run-time). Thus most of the libraries described in the following will be needed both to compile and to run PET binaries. Where it is desirable to run the same binary on more than one machine, it will be necessary to arrange for both PET and its external dependencies to be installed into directories that are visible (using the same naming scheme and directory structure) on all hosts that are to run PET.

UniCode Support

To process anything that exceeds 7-bit ASCII (which is no longer sufficient, even, for the [http://www.delph-in.net/erg/ English Resource Grammar]), PET makes use of the [http://ibm.com/software/globalization/icu/ International Components for UniCode] (ICU) library which is available in open-source from IBM. As of February 2005, ICU version 3.2 is known to work, but earlier revisions (starting from, say, 2.6 upwards) should also be suitable. The build process for ICU is simple; the following worked for me (in its source/ sub-directory):

  ./configure --prefix=/lingo/local
  make
  make install

Installing ICU into a system directory like /usr/local/ will require system administrator priviliges on typical Unix systems. With a general tool like ICU (and likewise ECL; see below), it is generally desirable to install it in a location that will be easily accessible to others, but where write permission for system directories is not an option, any path should be suitable as the value of -prefix in the above example. Note that the choice of -prefix during ICU installation needs to be reflected as the value of the ICUROOT variable in Makefile settings when building PET (at least for the oe branch).

For debian based distributions, the following puts the libraries where cheap can find them:

sudo apt-get install libicu28-dev

[incr tsdb()] Integration

The [incr tsdb()] [http://www.delph-in.net/itsdb/ Competence and Performance Profiler] provides a wrapper around PET (and other processing engines) for automated batch processing and regression testing. In order to use the PET parser cheap with [incr tsdb()], it needs to be linked against the [incr tsdb()] client library libitsdb.a (or libitsdb.so), which in turn require availability of PVM support. All header files and libraries needed to compile [incr tsdb()] support into PET are provided with [incr tsdb()] distributions, i.e. a functional [incr tsdb()] installation should suffice to also compile PET with [incr tsdb()] support.

[incr tsdb()] is available as open-source from the [http://lingo.stanford.edu/ftp/ LinGO download site], and most people use [incr tsdb()] in connection with the [http://www.delph-in.net/lkb/ LKB] grammar development environment. Users with access to the LinGO CVS repository can get both packages by checking out the lkb module and making sure that they have a current head revision (or, minimally, a source tree more recent than 02/22/05). Both the LKB and [incr tsdb()] are available as a set of archives files from the [http://lingo.stanford.edu/ftp/ http://lingo.stanford.edu/ftp/] download site; grab the appropriate archives for your platform and unpack all of them into a common directory; this directory will then correspond to the LKBROOT variable for PET Makefiles. The LinGO download site is organized according to build dates, where [http://lingo.stanford.edu/ftp/latest/ http://lingo.stanford.edu/ftp/latest/] corresponds to the most recent available version. Make sure to get the build of 02/21/05 or a later one.

There is experimental support for an automated installation of the LKB and [incr tsdb()] for Linux (x86, 32- and 64-bit) and Solaris (sparc, 32-bit) target platforms. Maybe try the following (assuming your login shell is bash or another Bourne-compatible shell):

  export DELPHINHOME=${HOME}/delphin
  wget http://lingo.stanford.edu/ftp/etc/install
  bash install

Assuming a directory choice as above, the value of the LKBROOT variable in PET Makefile settings should then be the path corresponding to ${HOME}/delphin/lkb/. For futher information on installing the LKB and [incr tsdb()], watch the LkbTop and ItsdbTop pages, where more detailed instructions should become available over time.

NOTE: Currently the lkb libraries are distributed for both 32 and 64 bit linuxes. This means that the relevant files are in:

lkb/lib/linux.x86.32
lkb/lib/linux.x86.64

However cheap looks for them in lkb/lib/linux. You may need to symbolic link the relevant libraries to compile cheap.

Embedded Common-Lisp and MRS Output

For PET to output MRSs in various formats, the current solution is to compile in the MRS code used in the [http://www.delph-in.net/lkb/ LKB] too. The MRS Common-Lisp code is first compiled into a function library (libmrs.a, see instructions on the PetTop page) which is subsequently linked into the main PET parser executable cheap. To allow cheap to invoke Lisp code at run-time, the [http://ecls.sourceforge.net Embedded Common Lisp] (ECL) package serves to first compile the MRS sources into standard C code, then use gcc to translate it into architecture-specific binary code, and finally combine the set of resulting object files into a standard C-callable library (using the Unix ar utility). These steps are performed off-line and require a working ecl binary. At run-time, cheap will use code from the ECL library (typically libecl.so) to invoke the compiled MRS code; thus, in the default dynamic compilation regime, the ECL run-time library will need to be accesible to cheap.

To install ECL, download a recent version from the project [http://sourceforge.net/projects/ecls/ download page]; as of February 2005, the latest available version is 0.9e which appears to work well. Earlier versions (starting from 0.9b) seemed to sufficient too, although there still is non-trivial variation in how the library is built and what needs to be done to sucessfully link it into cheap. Thus, we strongly recommend the use of ECL 0.9e. With the one exception of the (apparently) mandatory --with-cmuformat option, ECL configures and builds straightforwardly. The following worked for me (on stock FC1 and RH9):

  ./configure --prefix=/lingo/local --with-cmuformat
  make
  make install

See the remarks on installation into system directories above. As with the other external libraries, the value of --prefix when building ECL must later be used as the ECLROOT variable in PET Makefile settings.

Boost C++ Libraries

For debian based distributions, the following puts the libraries where flop can find them:

sudo apt-get install libboost-graph-dev 

Apache Xerces XML Parser

For debian based distributions, the following installs the libraries:

sudo apt-get install libxerces26-dev

Configure pet with ./configure --with-xml=/usr/lib.

Clone this wiki locally