Semlab : Muri : System : Howto : Gemini installation


The steps to installing Gemini (both for development and runtime use) are the following:

  1. Install cygwin

    This might be ameliorated in the future, but right now, Gemini on Windows depends on cygwin, a Unix environment for Windows. There are two reasons for this: 1) the Makefile you'll use in step 4 won't run under the normal Windows command prompt, and 2) much of Gemini depends on hard-coded pathnames relative to the cygwin directory structure.

    So install Cygwin (you can find the download on Muri2 in C:\Downloads\Dev tools\cygwin) to c:\cygwin, then continue to the next step.

  2. Copy Gemini libraries to proper places under /cygwin

    The Gemini libraries are on Muri2 in C:\Downloads\Language tools\Gemini in several .tar.gz files. Unzip these as follows:

  3. Set environment variables

    You will need to set the following environment variables:

  4. Build grammar into gemini.sav

    This step requires the grammar definition files (muri_grammar.{sem,syn,lex}); I'll assume you already have these (probably via CVS). If you just want to run, and not compile, Gemini, you can skip this step as you should be provided with Gemini already compiled into gemini.sav.

    Otherwise, it's up to you to build gemini.sav. This is a SICStus object file containing the state of the prolog interpreter at a previous moment, namely, just after it figured out what Gemini is. You want to run a cygwin shell (bash, tcsh, doesn't matter, but it can't be the normal Windows command shell), change to the csli/muri/grammar directory (or corresponding grammar directory of your own if you're not on the MURI project), and type "make". This MUST be done from inside a Unix-ish shell (bash, tcsh, sh all work). If all goes well, this will churn for a while, output a lot of information to the screen, and build gemini.sav in the grammar directory. If it fails, it's probably because SICStus is not on your path, is the wrong version, or the libraries from step (2) are missing or wrong.

  5. Test it out

    Still inside the grammar directory -- but this can be done from any command shell, Windows or Unix -- type "sicstus -r gemini.sav", which is now the canonical way to start Gemini. (The .sav file cannot be imported with use_module, ensure_loaded, consult, [], or any of the old ways of loading things: you can only load it with -r on the command line, or restore('gemini.sav') from inside the interpreter, and the restore command will clear out the database and any other definitions -- essentially making it like you just started SICStus freshly again.)

    Once you've loaded the Gemini-aware SICStus, just type: "gemini." to start the Gemini parser loop. Now you can type sentences that the grammar should know how to parse, and hopefully they'll be parsed correctly. Type "q." to end the parser loop, and "halt." to exit SICStus when you're satisfied.

  6. Running via nlagent

    Now the final test is to run Gemini inside nlagent, via OAA. Change to the nlagent directory, and invoke Gemini as: "sicstus -r [path-to-gemini.sav] -l nlagentl.pl", which means "start SICStus, restore Gemini from the saved state, then process the Prolog file nlagent.pl". Now go test the nlagent via the OAA debugger or your language system!

    NB: since nlagent is implemented in SICStus Prolog but the default OAA2 facilitator is build with Quintus Prolog, you need to add the following line to your setup.pl: "parent_dialect(quintus).". If you are using a SICStus-built facilitator, of course, ignore this.