First, you should get the distribution for SMART which are (last we heard) distributed for research purpose only at ftp://ftp.cs.cornell.edu/pub/smart under the name smart.11.0.tar.Z .
First, cd to the directory under which the SMART home directory will live, then unpack the distibution. A directory named "smart.11.0" will be created. You can be enlightened now by reading the file smart.11.0/Doc/howto/install.11.0 , but bear with us: this text tries to correct a couple of quirks you may encounter while compiling SMART (particularly on a Linux machine).
Then, cd to the smart.11.0/Install directory, and edit the file named "makefile" to suit your system's needs. On my Linux box, the following have been modified: - change the SMART variable to reflect the SMART home directory you choose (that would be the full path under which SMART will live, including the "smart.11.0" bit if you chose to leave it as in the distribution). - modify the CC variable to use the gcc compiler (GNU/Linux) instead of the cc compiler (Sun and most other Unices).
Apply now the modifications distributed with this set of documentation, under the file name "smart.11.0.diff". See below for the details of the modificationss applied on the software; to actually apply the modifications, use the patch(1) program:
# if you were still in the smart.11.0/Install directory cd ../.. # apply the patch patch -p0 < smart.11.0.diff
You can now go back to the Install directory, and type 'make' to install and compile the software:
cd Install make
If you want SMART binaries readily available to you, you should also add the SMART smart.11.0/src/bin directory to your path. The following placed in your login script should do the trick:
PATH=\$PATH:/home/smart.11.0/src/bin export PATH
If you do not want to use the patches, getting SMART to compile is not a straightforward task - it does *not* compile straight from the box. Some "minor" tweaking is in order: adding some "extern" variable declarations, deleting #include lines, adding others. The various scripts in the distribution are also severely modified by the install script, so you'd better reinstall the whole thing if you move the directory where it's installed. The next step, if somebody is interested to prepare a new release, would be to use a script like GNU's configure to make the entire system OS-independant, and to remove *all* references to absolute path names. At most one configuration file should contain values like the SMART home directory, default collection directory, and default database (indexed_colls) directory.
The following is the contents of the smart.11.0.diff file, result of a diff(1) on the files I used to compile SMART on a Debian GNU/Linux system. You can use patch(1) to apply the modifications to your files before you run all the install scripts, as indicated earlier.
---8<---snip---8<---
diff -r -u smart.11.0.orig/src/h/param.h smart.11.0/src/h/param.h
--- smart.11.0.orig/src/h/param.h Tue Jul 21 15:03:14 1992
+++ smart.11.0/src/h/param.h Tue Apr 20 23:01:10 1999
@@ -6,8 +6,8 @@
/* Default pagination and editor which can be invoked when */
/* displaying documents ( see src/libtop/inter.c ) */
-#define DEF_PAGE "/usr/ucb/more -s"
-#define DEF_EDITOR "/usr/ucb/vi"
+#define DEF_PAGE "/usr/bin/less"
+#define DEF_EDITOR "/usr/bin/vi"
/* Maximum full pathname allowed by SMART (and BSD 4.2) */
#define PATH_LEN 1024
@@ -24,7 +24,9 @@
Also used in libfile/open_dict.c.
Code may have to be altered if mmap variant different from Sun's.
Note: used only on RDONLY files */
+/*
#define MMAP
+*/
/* If selective tracing facilities are wanted, define TRACE. Not terribly */
/* expensive, so might as well leave defined. */
diff -r -u smart.11.0.orig/src/h/sysfunc.h smart.11.0/src/h/sysfunc.h
--- smart.11.0.orig/src/h/sysfunc.h Tue Jul 21 15:03:19 1992
+++ smart.11.0/src/h/sysfunc.h Tue Apr 20 23:00:48 1999
@@ -6,6 +6,10 @@
suit!), this file should just include system header files from
/usr/include. Until then... */
+#include <regex.h>
+
+#if 0
+
#ifdef NeXT
#include <libc.h>
#include <stdlib.h>
@@ -89,6 +93,8 @@
#endif
#endif /* NeXT */
+
+#endif 0
#endif /* SYSFUNCH */
diff -r -u smart.11.0.orig/src/libgeneral/error_msgs.c smart.11.0/src/libgeneral/error_msgs.c
--- smart.11.0.orig/src/libgeneral/error_msgs.c Tue Jul 21 15:04:32 1992
+++ smart.11.0/src/libgeneral/error_msgs.c Tue Apr 20 23:01:56 1999
@@ -33,7 +33,7 @@
extern int errno;
extern int sys_nerr;
-extern char *sys_errlist[];
+/* extern char *sys_errlist[]; */
char *smart_errlist[] = {
"Inconsistency check",
diff -r -u smart.11.0.orig/src/liblocal/libindexing/pp_line_nc.c smart.11.0/src/liblocal/libindexing/pp_line_nc.c
--- smart.11.0.orig/src/liblocal/libindexing/pp_line_nc.c Tue Jul 21 15:05:14 1992
+++ smart.11.0/src/liblocal/libindexing/pp_line_nc.c Tue Apr 20 23:03:00 1999
@@ -78,6 +78,7 @@
char *doc_file; /* Name of current file being preparsed */
char *orig_buf; /* incore copy of part of doc_file. */
+ char *buf; /* patch CM */
long end_orig_buf; /* Current end of orig_buf */
long max_orig_buf; /* Max size of allocation for orig_buf */
long doc_offset; /* current byte offset within orig_buf */
diff -r -u smart.11.0.orig/src/utility/news_filter.c smart.11.0/src/utility/news_filter.c
--- smart.11.0.orig/src/utility/news_filter.c Tue Jul 21 15:03:40 1992
+++ smart.11.0/src/utility/news_filter.c Tue Apr 20 23:04:00 1999
@@ -591,6 +591,8 @@
int circf;
} *patterns;
+int circf=0; /* patch CM */
+
#define INIT register char *sp = instring;
#define GETC() (*sp++)
#define PEEKC() (*sp)
---8<---snip---8<---
On some platforms (Sun), you can also activate a feature called MMAP to activate a memory map of your files to let the operating system's virtual memory subsystem handle the efficient loading of the (large) files you use. MMAP is defined in src/h/param.h ; define it and recompile SMART if you need it. It is most useful on large files, simplifying and optimizing access method.
The ismart(1) script, which calls SMART using interactive mode on an indexed collection, did not work either. The script failed saying that it could not find the "spec_file" program. The following lines were modified to correct this:
if ( -e $database/spec.int ) then
spec_file = $database/spec.int
else if ( -e $database/spec ) then
spec_file = $database/spec
else
echo "Sorry, $database is not set up as a collection"
exit
endif
and have been changed to:
if ( -e $database/spec.int ) then
set spec_file = $database/spec.int
else if ( -e $database/spec ) then
set spec_file = $database/spec
else
echo "Sorry, $database is not set up as a collection"
exit
endif