[1] Couldn't get Bob's copy of the PCKimmo stuff from /home/nl/... because I don't have an account on any of the lab's Unix boxes. [2] FTP'd the code from ftp.umiacs.umd.edu. [3] Tried to compile as per the instructions: cc -c kimmo.c gives the diagnostic "Can't find file malloc.h." No binary generated. Also, the code appears to define the same symbols multiple times: TRUE, FALSE, NORMAL_T, and BLOCK_T. [4] After consulting with an Athena C wizard, I just commented out the #include line, and it compiled. Well, sort of: it got 3 warnings of illegal pointer combinations at the three calls to myalloc in kimmo.c. A binary was generated, though. I wonder if it works -- perhaps the illegal pointer combo is due to somebody's confusion re prototypes? Could be just sloppy C code. Have to work on the lisp side to test. [5] Compiling the lisp half of the interface produced a bunch of warnings, too: > (compile-file "/mit/sgr/kimmo-c/c-interface.lisp") ;;; Reading source file "c-interface.lisp" ;;; Expanding Reserved Memory ;;; GC: 6506 words [26024 bytes] of dynamic storage in use. ;;; 254612 words [1018448 bytes] of free storage available before a GC. ;;; 515730 words [2062920 bytes] of free storage available if GC is disabled. ;;; Compiling toplevel form... ;;; Warning: Assuming LOAD_LANGUAGE is special ;;; Warning: Assuming LOAD_KIMMO_RULES is special ;;; Warning: Assuming LOAD_KIMMO_LEXICON is special ;;; Warning: Assuming DO_RECOGNITION is special ;;; Warning: Assuming DO_GENERATION is special ;;; Warning: Assuming GET_RESULT_STR1 is special ;;; Warning: Assuming GET_RESULT_STR2 is special ;;; Warning: Assuming INCREMENT_RESULT is special ;;; assembling...emitting...done. ;;; Writing binary file "c-interface.vbin" ;;; Warning: The following functions are not known to be defined: ;;; DEF-FOREIGN-FUNCTION was referenced by toplevel forms ;;; TRANSLATE::LOAD-LANGUAGE-C was referenced by toplevel forms ;;; :RETURN-TYPE was referenced by toplevel forms ;;; :NAME was referenced by toplevel forms ;;; :LANGUAGE was referenced by toplevel forms ;;; LANGUAGE was referenced by toplevel forms ;;; AUT-NAME was referenced by toplevel forms ;;; DIC-NAME was referenced by toplevel forms ;;; TRANSLATE::LOAD-RULES-C was referenced by toplevel forms ;;; TRANSLATE::LOAD-LEXICON-C was referenced by toplevel forms ;;; TRANSLATE::DO-RECOGNITION-C was referenced by toplevel forms ;;; WORD was referenced by toplevel forms ;;; TRANSLATE::DO-GENERATION-C was referenced by toplevel forms ;;; TRANSLATE::GET-RESULT-STR1 was referenced by toplevel forms ;;; TRANSLATE::GET-RESULT-STR2 was referenced by toplevel forms ;;; TRANSLATE::INCREMENT-RESULT was referenced by toplevel forms #P"/mit/sgr/kimmo-c/c-interface.vbin" > [6] Loading it goes into the debugger: > (load "/mit/sgr/kimmo-c/c-interface") ;;; Loading binary file "c-interface.vbin" >>Error: The function :RETURN-TYPE is undefined. unnamed function: :A Abort to Lisp Top Level :C Try calling :RETURN-TYPE again -> This behavior is consistent with there being no Lucid foreign function interface present! [7] Further research: these are the symbols defined in the 6.863 version of Lucid. Note that def-foreign-function is *not* among them! Apparently the vertsion we're running is out of sync with the documentation. I'll hunt around a bit to see if I can find something more up-to-date. > (apropos "FOREIGN") :FOREIGN-CODE, Keyword :FOREIGN-STATIC, Keyword :REDEFINE-RESERVED-FOREIGN-SYMBOLS, Keyword FOREIGN-STATIC-SEGMENT, Bound UNINTERN-FOREIGN-SYMBOL, Function (LUCID::NAME-OR-SYMBOL) LOAD-FOREIGN-LIBRARIES, Function (LUCID::FOREIGN-SYMBOLS &OPTIONAL (LUCID::FOREIGN-LIBRARIES (LIST "-lc"))) FOREIGN-AVAILABLE-P, Function FOREIGN-ADDRESS-OF, Function (FUNCTION) FOREIGN-LOAD-LIBRARIES, Function (LUCID::FOREIGN-SYMBOL-ALIST &OPTIONAL (LUCID::LIBRARIES (LIST "-lc"))) FOREIGN-UNDEFINED-SYMBOL-NAMES, Function DEFINE-FOREIGN-SYMBOL, Macro DEFINE-FOREIGN-FUNCTION, Function (LUCID::FUNCTION-LANGUAGE LUCID::FUNCTION-NAME LUCID::FUNCTION-TYPE) FOREIGN-CALL-FLOAT, Function FOREIGN-CALL, Function LOAD-FOREIGN-FILES, Function (LUCID::FOREIGN-FILES &OPTIONAL LUCID::FOREIGN-LIBRARIES) FOREIGN-LOAD-FILES, Function (LUCID::FILES &OPTIONAL LUCID::FOREIGN-SYMBOL-ALIST (LUCID::LIBRARIES (LIST "-lc"))) WITH-FOREIGN-AREA, Macro > [8] OK, after using the Athena-recommended version of Lucid (v 2.5 for vaxen), the file at least compiles and loads. Will have to address later the issue of getting 6.863 to use this new version. [9] The README file lies to us. The function is called LOAD-LANGUAGE-C, not LOAD-LANGUAGE. And the args are different from how they're documented, too. [10] The unix filesystem is evil. Kimmo only looks in the current dir for sublexicons; this makes it difficult to make the code work without wiring a reference to my personal directory in the software. Nonetheless, it's now all loaded, and I've managed to load English. [11] OK, got it to work. However, the files describing how to use the version from UMD are all screwed up. I finally just broke down and re-wrote the whole thing, at least the lisp side. See /mit/sgr/kimmo-c/pckimmo-interface.lisp. [12] Well, my version of the interface seems to be working: > (load "/mit/sgr/kimmo-c/pckimmo-interface") ;;; Loading binary file "/mit/sgr/kimmo-c/pckimmo-interface.vbin" ;;; Loading foreign object file "/mit/sgr/kimmo-c/kimmo.o" ;;; Reading library file "/lib/libc.a" ;;; Reading library file "/usr/lib/libm.a" #P"/mit/sgr/kimmo-c/pckimmo-inteface.vbin" >(load-language-c "english" "english.rul" "english.lex") Rules being loaded from english.rul Lexicon being loaded from english.lex 0 > (recognize-word "flies" "english") (("`fly+s" "[ N(fly)+PL ]") ("`fly+s" "[ V(fly)+3sg.PRES ]")) > (generate-word "`fly+s" "english") ("flies") > So that looks pretty good. [13] Yet to do: hook up this version of lisp to emacs (all the above is hand-typed from what I saw printed in a listener); and make gpsg stuff use it. (I assume that means the lexicon has to give class tags that are lisp-meaningful, not just strings like above?) [14] Added a generic hook to parse the feature stuff returned by the lexicon.