From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,4606073b0875bd5d X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-03-08 03:33:46 PST Newsgroups: comp.unix.osf.osf1 Path: gmd.de!newsserver.jvnc.net!yale.edu!nigel.msen.com!sdd.hp.com!cs.utexas.edu!howland.reston.ans.net!EU.net!sunic!kidec.cmb.ki.se!calypso.kib.ki.se!user From: Ulf@argo.kib.ki.se (Ulf Kronman) Subject: Re: WAIS on OSF/1 1.3A? Message-ID: Followup-To: comp.unix.osf.osf1 Sender: news@kidec.cmb.ki.se (USENET News System) Nntp-Posting-Host: calypso.kib.ki.se Organization: Library of Karolinska Institute, Stockholm, Sweden References: <1994Mar2.222033.16015@mnemosyne.cs.du.edu> Date: Tue, 8 Mar 1994 11:33:46 GMT In article <1994Mar2.222033.16015@mnemosyne.cs.du.edu>, jmaynard@nyx10.cs.du.edu (Jay Maynard) wrote: > I can't seem to get WAIS 8b5.1 (I think that's the version) to compile on our > Alpha 3000/400 with OSF/1 1.3A. It seems it can't figure out that it's a > standard C compiler. I'm sure someone out there has gotten this running...how > did you do it? I posted this to the list wais-talk@think.com a week ago. I think the changes below should be valid for freeWAIS 0.1 (which I think is equal to wais-8b5.1). Original posting: ============================================================================== I downloaded FreeWAIS 0.202 from CNIDR some time ago, and have been trying to make it to work on my Alpha off and on since then. With some help from David Kulp , and a lot of help from Bernard Szelag , I think that I have sorted out most of the problems involved in the port. Here is a list of things that I have changed in the original CNIDR code to make it work on my Alpha. The Alpha-specific changes are set by compiler flags, and the hard-coded changes seems mostly to be bugs (?). Would it be possible to have someone at CNIDR to look at this and maybe include these changes in the upcoming code for freeWAIS 1.0, so we can make it compile easily on OSF1 when it arrives? If you have any questions about these changes, you may ask me, but don't expect any clever answers, because Bernard Szelag is the one responsible for the code analysis - I'm just reporting it (I can't C - yet :-). OK, so here's the list: 1. The most important change seems to be the use of cc with -taso argument. It compiles and loads with 32 bits pointers. In the top Makefile: CFLAGS = -O -taso -I$(SUPDIR) -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DUSG -DBOOLEANS -DPARTIALWORD -DLITERAL -DAXP 2. I had to define the compiler as ANSI_LIKE in the ir/cdialect.h file. This can be done by adding a -DAXP compiler directive in the top Makefile: CFLAGS = -O -taso -I$(SUPDIR) -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DUSG -DBOOLEANS -DPARTIALWORD -DLITERAL -DAXP And then in ir/cdialect.h: #ifdef AXP /* for 64 bits alpha risc processor */ #define ANSI_LIKE #endif /* def AXP */ 3. A math problem (division by zero? bug?) in ir/sersrch.c for the line: weight/=doc_entry.document_length I think it was this one that made waissearch dump with a floating point exception. Should be changed to: if (doc_entry.document_length != 0) weight/=doc_entry.document_length; 4. There are also some changes (which I don't understand) in ir/irsearch.c, where (time_t)0L is changed to (time_t)0. See the diff listing below. Are these typos? 5. In ir/trie.c, you have to change if (!(tmp->tries = make_allocator(sizeof(trie),free_trie))) { to if (!(tmp->tries = make_allocator(sizeof(trie),(void *)free_trie))) { (What does void mean in C ?) 6. In the lib/Makefile it seems as if the compiler flags from the top Makefile are overridden by local CFLAGS. On recommendation from Bernard Szelag, I commented them away. #CFLAGS = -DUSG -g -I. 7 . In lib/pdftw.h, we have to make OSF known: Change #if defined(USG) || defined(_IBMR2) to #if defined(USG) || defined(_IBMR2) || defined(AXP) 8. The x/Imakefile: Change INCLUDES = -I$(SRCDIR) -I$(SUPDIR) -I$(UIDIR) -I/usr/openwin/include to INCLUDES = -I$(SRCDIR) -I$(SUPDIR) -I$(UIDIR) 9. The x/Imakefile: For 32 bits pointer under osf1.3 use a copy of LDOPTIONS and add -taso LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -taso 10. In x/Xwais a lot of parameters pointing to local files have to be set. See the diff listing below. Here is Bernard Szelag's "diff -r" between the original version and his Alpha version: -------------------------------------------------------------------------- diff -r orig/freeWAIS-0.202/Makefile freeWAIS-0.202/Makefile 51a52 > TOP=/usr/local2/wais/freeWAIS-0.202 53,54c54,55 < comment-me: < @echo You must set "\$$(TOP)" to point to the freeWAIS src directory --- > #comment-me: > # @echo You must set "\$$(TOP)" to point to the freeWAIS src directory 96c97 < CFLAGS = -g -I$(SUPDIR) -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DUSG -DBOOLEANS -DPARTIALWORD -DLITERAL --- > CFLAGS = -O -taso -I$(SUPDIR) -DSECURE_SERVER -DRELEVANCE_FEEDBACK -DUSG -DBOOLEANS -DPARTIALWORD -DLITERAL -DAXP --- diff -r orig/freeWAIS-0.202/ir/cdialect.h freeWAIS-0.202/ir/cdialect.h 28a29,32 > #ifdef AXP /* for 64 bits alpha risc processor */ > #define ANSI_LIKE > #endif /* def AXP */ > --- diff -r orig/freeWAIS-0.202/ir/irsearch.c freeWAIS-0.202/ir/irsearch.c 457c457 < (time_t)0L, --- > (time_t)0, 489c489 < (time_t)0L, --- > (time_t)0, 509c509 < (time_t)0L, --- > (time_t)0, --- diff -r orig/freeWAIS-0.202/ir/sersrch.c freeWAIS-0.202/ir/sersrch.c 354c354 < weight/=doc_entry.document_length; --- > if (doc_entry.document_length != 0) weight/=doc_entry.document_length; --- diff -r orig/freeWAIS-0.202/ir/trie.c freeWAIS-0.202/ir/trie.c 147c147 < if (!(tmp->tries = make_allocator(sizeof(trie),free_trie))) { --- > if (!(tmp->tries = make_allocator(sizeof(trie),(void *)free_trie))) { --- diff -r orig/freeWAIS-0.202/lib/Makefile freeWAIS-0.202/lib/Makefile 21,22c21,22 < CC = cc < CFLAGS = -DUSG -g -I. --- > #CC = cc > #CFLAGS = -DUSG -g -I. --- diff -r orig/freeWAIS-0.202/lib/pdftw.h freeWAIS-0.202/lib/pdftw.h 28c28 < #if defined(USG) || defined(_IBMR2) --- > #if defined(USG) || defined(_IBMR2) || defined(AXP) --- diff -r orig/freeWAIS-0.202/x/Imakefile freeWAIS-0.202/x/Imakefile 46c46 < INCLUDES = -I$(SRCDIR) -I$(SUPDIR) -I$(UIDIR) -I/usr/openwin/include --- > INCLUDES = -I$(SRCDIR) -I$(SUPDIR) -I$(UIDIR) 63a64,73 > > /* > For 32 bits pointer under osf1.3 use a copy of LDOPTIONS > and add -taso > > LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -taso > */ > > LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -taso > diff -r orig/freeWAIS-0.202/x/Xwais freeWAIS-0.202/x/Xwais 9c9 < # for example... --- > ! # for example... 37c37 < Xwais*commonSourceDirectory: /proj/wais/wais/wais-sources/ --- > Xwais*commonSourceDirectory: /usr/local2/wais/freeWAIS-0.202/wais-sources/ 40,41c40,41 < xwais*helpFile: /proj/wais/wais/x/XwaisHELP < xwaisq*helpFile: /proj/wais/wais/x/XwaisqHELP --- > xwais*helpFile: /usr/local2/wais/freeWAIS-0.202/x/XwaisHELP > xwaisq*helpFile: /usr/local2/wais/freeWAIS-0.202/x/XwaisqHELP diff -r orig/freeWAIS-0.202/x/Xwais.raw freeWAIS-0.202/x/Xwais.raw 9c9 < # for example... --- > ! # for example... 37c37 < Xwais*commonSourceDirectory: /proj/wais/wais/wais-sources/ --- > Xwais*commonSourceDirectory: /usr/local2/wais/freeWAIS-0.202/wais-sources/ 40,41c40,41 < xwais*helpFile: /proj/wais/wais/x/XwaisHELP < xwaisq*helpFile: /proj/wais/wais/x/XwaisqHELP --- > xwais*helpFile: /usr/local2/wais/freeWAIS-0.202/x/XwaisHELP > xwaisq*helpFile: /usr/local2/wais/freeWAIS-0.202/x/XwaisqHELP -------------------------------------------------------------------------- Ulf Kronman Systems Engineer KIBIC Voice: +46 8 7286846 Box 200 Fax: +46 8 301739 S-171 77 Stockholm, SWEDEN Internet: Ulf.Kronman@kib.ki.se _____________________________________________________________________