next up previous contents index
Next: 12.2 The Smodels Interface Up: 12.1 Installing the Interface Previous: 12.1.1 Installing the Interface   Contents   Index

12.1.2 Installing XASP under Windosw using Cygwin

To install XASP under Windows, you must use Version 3.0 of XSB or later and Version 2.31 or later of Smodels 12.4. You should also have a recent version of Cygwin (e.g. 1.5.20 or later) with all the relevant development packages installed, such as devel, make, automake, patchtools, and possibly x11 (for makedepend) Without an appropriate Cygwin build environment many of these steps will simply fail, sometimes with quite cryptic error messages.

  1. Patch and Compile Smodels First, uncompress smodels-2.31.tar.gz in some directory, (for presentation purposes we use /cygdrive/c/smodels-2.31 -- that is, c:\smodels-2.31). After that, you must apply the patch provided with this package. This patch enables the creation of a DLL from Smodels. Below is a sample session (system output omitted) with the required commands:
    $ cd /cygdrive/c/smodels-2.31
    $ cat $XSB/packages/xasp/patch-smodels-2.31 | patch -p1
    $ make lib
    
    After that, you should have a file called smodels.dll in the current directory, as well as a file called smodels.a. You should make the former "visible" to Windows. Two alternatives are either (a) change the PATH environment variable to contain c:\smodels-2.31, or (b) copy smodels.dll to some other directory in your PATH (such as c:\windows, for instance). One simple way to do this is to copy smodels.dll to $XSB/config/i686-pc-cygwin/bin, after the configure XSB step (step 2), since that directory has to be in your path in order to make XSB fully functional.

  2. Configure XSB. In order to properly configure XSB, you must tell it where the Smodels sources and library (the smodels.a file) are. In addition, you must compile XSB such that it doesn't use the Cygwin DLL (using the -mno-cygwin option for gcc). The following is a sample command:
    $ cd $XSB/build
    $ ./configure --enable-no-cygwin -with-smodels="/cygdrive/c/smodels-2.31''
    
    You can optionally include the extended Cygwin w32 API using the configuration option --with-includes=<PATH_TO_API>, (this allows XSB's build procedure to find makedepend for instance), but you'll probably do fine with just the standard Cygwin apps.

    There are some compiler variables which may not be automatically set by the configure script in xsb_config.h, namely the configuration names and some activation flags. To correct this, do the following:

    1. cd to $XSB/config/i686-pc-cygwin
    2. open the file xsb_config.h and add the following lines:
      	#define CONFIGURATION "i686-pc-cygwin"
      	#define FULL_CONFIG_NAME "i686-pc-cygwin"
      	#define SLG_GC
      

    (Still more flags may be needed depending on Cygwin configuration)

    After applying these changes, cd back to the $XSB/build directory and compile XSB:

    $ ./makexsb
    
    Now you should have in $XSB/config/i686-pc-cygwin/bin directory both a xsb.exe and a xsb.dll.

  3. Compiling XASP. First, go to the XASP directory and execute the makelinks.sh script in order to make the headers and libraries in Smodels be accessible to XSB, i.e.:
    $ cd $XSB/packages/xasp
    $ sh makelinks.sh /cygdrive/c/smodels-2.31
    
    Now you must copy the smoMakefile from the config directory to the xasp directory and run both its directives:
    $ cp $XSB/config/i686-pc-cygwin/smoMakefile .
    $ make -f smoMakefile module
    $ make -f smoMakefile all
    
    At this point, you can consult xnmr as you can with any other package, or xsb with the xnmr command line parameter, like this: (don't forget to add XSB bin directory to the $PATH environment variable)
    $ xsb xnmr
    
    Lots of error messages will probably appear because of some runtime load compiler, but if everything goes well you can ignore all of them since your xasppkg will be correctly loaded and everything will be functioning smoothly from there on out.


next up previous contents index
Next: 12.2 The Smodels Interface Up: 12.1 Installing the Interface Previous: 12.1.1 Installing the Interface   Contents   Index
Terrance Swift 2007-10-06