Forum OpenACS Q&A: OpenFTS search and PostgreSQL 7.2

Collapse
Posted by Ola Hansson on
Has anyone successfully made it through the OpenFTS installation on PG 7.2 yet? Adhering to the the giudelines in the new and remarkably cool OpenACS 4.5 docs, I managed to configure after adding a small change to the configure file (see the patch below).

make first complained about not recognizing a command, flex, so I installed the package "flex"...(I run a very sparse Debian installation so this package probably exists already on most machines).

Furthermore "make" threw this error:

nsadmin@hal:/usr/local/src/Search-OpenFTS-tcl-0.2$ make
(cd parser; make all)
make[1]: Entering directory `/usr/local/src/Search-OpenFTS-tcl-0.2/parser'
gcc -c -I. -fPIC -I../include Parser.c -o Parser.o
In file included from Parser.c:28:
../include/fts.h:16: parse error before `#'
Parser.c:40: warning: data definition has no type or storage class
Parser.c:42: parse error before `*'
Parser.c:42: warning: data definition has no type or storage class
Parser.c:43: parse error before `{'
Parser.c:54: parse error before `('
Parser.c:61: parse error before `ClientData'
Parser.c:61: warning: data definition has no type or storage class
Parser.c:62: parse error before `*'
Parser.c:62: warning: data definition has no type or storage class
Parser.c:64: parse error before `*'
Parser.c:64: warning: data definition has no type or storage class
Parser.c:65: parse error before `{'
Parser.c:70: parse error before `if'
Parser.c:74: conflicting types for `word'
Parser.c:68: previous declaration of `word'
Parser.c:74: initializer element is not constant
Parser.c:74: warning: data definition has no type or storage class
Parser.c:75: initializer element is not constant
Parser.c:75: warning: data definition has no type or storage class
Parser.c:76: parse error before `if'
Parser.c:78: parse error before `['
Parser.c:80: parse error before `('
Parser.c:89: parse error before `ClientData'
Parser.c:89: warning: data definition has no type or storage class
Parser.c:90: parse error before `*'
Parser.c:90: warning: data definition has no type or storage class
Parser.c:92: parse error before `*'
Parser.c:92: warning: data definition has no type or storage class
Parser.c:93: parse error before `{'
Parser.c:98: conflicting types for `end_parse'
../include/parser.h:27: previous declaration of `end_parse'
Parser.c:98: warning: data definition has no type or storage class
Parser.c:101: parse error before `return'
Parser.c:107: parse error before `ClientData'
Parser.c:107: warning: data definition has no type or storage class
Parser.c:108: parse error before `*'
Parser.c:108: warning: data definition has no type or storage class
Parser.c:110: parse error before `*'
Parser.c:110: warning: data definition has no type or storage class
Parser.c:111: parse error before `{'
Parser.c:118: initializer element is not constant
Parser.c:118: warning: data definition has no type or storage class
Parser.c:120: warning: parameter names (without types) in function
declaration
Parser.c:120: conflicting types for `start_parse_str'
../include/parser.h:25: previous declaration of `start_parse_str'
Parser.c:120: warning: data definition has no type or storage class
Parser.c:122: parse error before `return'
Parser.c:127: parse error before `ClientData'
Parser.c:127: warning: data definition has no type or storage class
Parser.c:128: parse error before `*'
Parser.c:128: warning: data definition has no type or storage class
Parser.c:130: parse error before `*'
Parser.c:130: warning: data definition has no type or storage class
Parser.c:131: parse error before `{'
Parser.c:135: parse error before `if'
Parser.c:144: warning: parameter names (without types) in function
declaration
Parser.c:144: conflicting types for `start_parse_fh'
../include/parser.h:26: previous declaration of `start_parse_fh'
Parser.c:144: warning: data definition has no type or storage class
Parser.c:146: parse error before `return'
Parser.c:151: parse error before `*'
Parser.c: In function `Parser_Init':
Parser.c:154: `Fts_GetDescriptObjCmd' undeclared (first use in this
function)
Parser.c:154: (Each undeclared identifier is reported only once
Parser.c:154: for each function it appears in.)
Parser.c:155: `ClientData' undeclared (first use in this function)
Parser.c:155: parse error before `0'
Parser.c:158: `Fts_GetLexObjCmd' undeclared (first use in this function)
Parser.c:159: parse error before `0'
Parser.c:162: `Fts_EndParseObjCmd' undeclared (first use in this function)
Parser.c:163: parse error before `0'
Parser.c:166: `Fts_StartParseStrObjCmd' undeclared (first use in this
function)
Parser.c:167: parse error before `0'
Parser.c:170: `Fts_StartParseFhObjCmd' undeclared (first use in this
function)
Parser.c:171: parse error before `0'
Parser.c: At top level:
Parser.c:130: warning: array `objv' assumed to have one element
make[1]: *** [Parser.o] Error 1
make[1]: Leaving directory `/usr/local/src/Search-OpenFTS-tcl-0.2/parser'
make: *** [parser] Error 2
nsadmin@hal:/usr/local/src/Search-OpenFTS-tcl-0.2$

If someone understands this please help explain it to me😊

*** configure.orig      Sun Mar  3
17:40:16 2002
--- configure   Sun Mar  3 18:18:26 2002
***************
*** 1582,1588 ****
                         if test -f
$PG_INSTALLATION_DIR/include/pgsql/postgres.h; then
                                
PG_INC="$PG_INSTALLATION_DIR/include/pgsql"
                         else
!                                { echo "configure: error: couldn't
find postgresql include files" 1>&2; exit 1; }
                         fi
                  fi
          fi
--- 1582,1592 ----
                         if test -f
$PG_INSTALLATION_DIR/include/pgsql/postgres.h; then
                                
PG_INC="$PG_INSTALLATION_DIR/include/pgsql"
                         else
!                              if test -f
$PG_INSTALLATION_DIR/include/server/postgres.h; then
!                                     
PG_INC="$PG_INSTALLATION_DIR/include/server"
!                              else
!                                      { echo "configure: error:
couldn't find postgresql include files" 1>&2; exit 1; }
!                              fi
                         fi
                  fi
          fi

The patch grew a little big because I adjusted the indentation...Sorry about that!

Cheers!
Collapse
Posted by Ola Hansson on
Unfortunately (for all of us) Neophytos vanished into thin air, like Bilbo, so I can't count on his help...

Hey! Maybe he decided to get married, and put the ring on? 😊

Collapse
Posted by Dan Wickstrom on
openfts hasn't yet been ported to work with pg 7.2 which uses the tsearch contrib module instead of intarray.  I have it to the point where it builds with pg 7.2, but I haven't tested it yet.

It might be possible to use the current version of openfts with pg 7.2, as the intarray module is still present I think?  Did you do make install-all-headers when you installed pg 7.2?

Collapse
Posted by Ola Hansson on
Yes, I did "make install-all-headers" when I installed PG, and I use Search-OpenFTS-tcl-0.2, which is the current one, right?

The "intarray" directory coexists alongside the "tsearch" directory in the PG 7.2 sources - It's always something, I guess...

Dan, I'd love to help test the new search when it is time for testing!

Collapse
5: I'm lying to you:-( (response to 1)
Posted by Ola Hansson on
Doh! The actual error message goes as follows (in my attempt to resolve this I'd been stupid enough to put a semicolon at the beginning of line 16 of ../include/fts.):
nsadmin@hal:/usr/local/src/Search-OpenFTS-tcl-0.2$ make
(cd parser; make all)
make[1]: Entering directory `/usr/local/src/Search-OpenFTS-tcl-0.2/parser'
gcc -c -I. -fPIC -I../include Parser.c -o Parser.o
In file included from Parser.c:28:
../include/fts.h:16: tcl.h: No such file or directory
make[1]: *** [Parser.o] Error 1
make[1]: Leaving directory `/usr/local/src/Search-OpenFTS-tcl-0.2/parser'
make: *** [parser] Error 2
nsadmin@hal:/usr/local/src/Search-OpenFTS-tcl-0.2$ 
Here is the beginning of /usr/local/src/Search-OpenFTS-tcl-0.2/include/fts.h ...
#include 
#include 
#include "deflex.h"
#include "parser.h"
#include "stem_english.h"
#include "crc32.h"

#ifdef WITH_AOLSERVER
#define USE_TCL8X
#include 
#include 
#define LOCK_MUTEX Ns_MutexLock(&lock);
#define UNLOCK_MUTEX Ns_MutexUnlock(&lock);
#define FTS_EXPORT
#else
#include "tcl.h"                  <-- line 16 of include/fts.h
#define LOCK_MUTEX
#define UNLOCK_MUTEX
#define FTS_EXPORT static
#endif
Collapse
Posted by Vinod Kurup on
Hey Ola!

I have successfully gotten OpenFTS working with PG7.2. You overcame the first problem -- PG 7.2's make install-all-headers installs the headers into /usr/local/pgsql/include/server instead of /usr/local/pgsql/include.

The error that you're getting occurs because ./configure doesn't properly detect where your tcl includes are. Did you follow step 3 in my OpenFTS install instructions? You need to edit Makefile.global so that the line starting with INC looks like this.

INC      = ../include -I/usr/include/tcl8.3
This will point to the proper TCL includes on Debian. Compiling should now work. (This is not the best solution -- I should probably edit the ./configure script)

The next problem will be that the packages/openfts-driver/sql/postgresql/load.sql file has the PG location hardcoded, so you'll need to adjust that before you load it into your db.

Good luck!

Collapse
Posted by Ola Hansson on
Hi Vinod!

I sure edited the INC line but forgot that the configure script rewrote the Makefile(s). Like after I had discovered the change in PG's include path and reran the configure script. Anyway it works now!

Yes, putting this in the configure script is better I suppose.

I look forward to the next problem, now that you've made me aware of it!

Many thanks,

Collapse
Posted by Janine Ohmer on
Reviving this old thread...

I'm attempting to build Search-OpenFTS-tcl-0.3.2 on RedHat Enterprise Server (with pg 7.2.4).  After finding this thread I have edited Makefile.global to specify where to find tcl.h, but I am getting (apparently bogus) syntax errors.

If I use the tcl.h from Tcl 8.3.5 I get

make[1]: Entering directory `/usr/local/src/Search-OpenFTS-tcl-0.3.2/parser'
gcc -c -I. -fPIC -I../include -I/usr/local/src/tcl8.3.5/generic -DPACKAGE=\"OPENFTS\" -DVERSION=\"0.3.2\" -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_STRERROR=1 -DHAVE_STRSTR=1 -DHAVE_STRLEN=1 -DHAVE_POLL=1 Parser.c -o Parser.o
In file included from ../include/iispell.h:5,
                from ../include/fts.h:6,
                from Parser.c:28:
/usr/local/src/tcl8.3.5/generic/regex.h:145: syntax error before "re_void"
/usr/local/src/tcl8.3.5/generic/regex.h:145: warning: data definition has no type or storage class
/usr/local/src/tcl8.3.5/generic/regex.h:314: syntax error before "_ANSI_ARGS_"
/usr/local/src/tcl8.3.5/generic/regex.h:323: syntax error before "_ANSI_ARGS_"
/usr/local/src/tcl8.3.5/generic/regex.h:326: syntax error before "_ANSI_ARGS_"

and if I use the one in aolserver (3.3+ad13) it's

make[1]: Entering directory `/usr/local/src/Search-OpenFTS-tcl-0.3.2/parser'
gcc -c -I. -fPIC -I../include -I/usr/local/src/aolserver/aolserver/include -DPACKAGE=\"OPENFTS\" -DVERSION=\"0.3.2\" -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_STRERROR=1 -DHAVE_STRSTR=1 -DHAVE_STRLEN=1 -DHAVE_POLL=1 Parser.c -o Parser.o
Parser.c: In function `Fts_GetDescriptObjCmd':
Parser.c:41: syntax error before "Tcl_Obj"
Parser.c:49: subscripted value is neither array nor pointer
Parser.c: In function `Fts_GetLexObjCmd':
Parser.c:65: syntax error before "Tcl_Obj"
(it goes on for many more lines like this)

Any ideas what I might be doing wrong?

Collapse
Posted by Cathy Sarisky on
Janine, I'm seeing the same sort of error with postgresql 7.3.4, on Debian.  Did you resolve this?
Collapse
Posted by Vinod Kurup on
Hey Cathy,

I haven't installed on Debian recently, but I recall running into something like this. Looking at Janine's message above, it seems that make is running in the parser directory. According to the AOLSERVER.INSTALL, the only directory that you need to run make in is the aolserver directory. So, run ./configure in the main directory, then cd aolserver, run make and then cp nsfts.so to aolserver's directory (and follow the rest of the instructions in AOLSERVER.INSTALL).

Collapse
Posted by Janine Ohmer on
Cathy, I never did resolve it - as I recall, I copied the built module from another system.  Hopefully Vinod's info will fix it for you.
Collapse
Posted by Cathy Sarisky on
Ah, thank you Vinod.  That's got it.  I'd missed that 'cd' in the directions. Doh :)
Collapse
Posted by Neophytos Demetriou on
<blockquote> Hey! Maybe he decided to get married, and put the ring on? 😊
</blockquote>

Actually, I got engaged last xmas but you were close... As far as your question is concerned, I'll have to get back to it at a later time since I now have around 7000 unread messages to process.

Collapse
Posted by Ryan Gallimore on
I'm using PG 7.3.6 and OpenFTS 0.3.1. I successfully make from ../Search-OpenFTS-tcl-0.3.1/ but when I cd aolserver, make fails with the following:
gcc -c -fPIC  -DWITH_AOLSERVER -DFTS_VER=\"0.3.1\" -I../include -I/usr/local/src/aolserver/aolserver/include -I/usr/local/src/aolserver/aolserver/nsd ../dict/PorterEng.c -o PorterEng.o
In file included from ../dict/PorterEng.c:28:
../include/fts.h:10:16: ns.h: No such file or directory
../include/fts.h:11:17: nsd.h: No such file or directory
In file included from ../dict/PorterEng.c:28:
../include/fts.h:29: syntax error before "clientData"
../include/fts.h:36: syntax error before "clientData"
../include/fts.h:43: syntax error before "clientData"
../include/fts.h:50: syntax error before "clientData"
../include/fts.h:57: syntax error before "clientData"
etc... Anyone else run into this issue?
Collapse
Posted by Ryan Gallimore on
I edited the Makefile with the correct Aolserver home, and the /aolserver make succeeded.

Good luck!