• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

Doc/H03-May-2022-11690

RegressionTests/H03-May-2022-2,1591,816

SortOrders/H05-Aug-2009-1,2621,207

AUTHORSH A D05-Aug-200936 21

COPYINGH A D05-Aug-200934.3 KiB675553

CREDITSH A D05-Aug-2009283 107

ChangeLogH A D11-Jan-201038.9 KiB1,207864

ExplicateBadUTF8.cH A D05-Aug-20093.1 KiB9348

INSTALLH A D05-Aug-20099.2 KiB232177

Makefile.amH A D05-Aug-20091.1 KiB4735

Makefile.inH A D03-May-202222.2 KiB663586

NEWSH A D11-Jan-20107.6 KiB233161

READMEH A D05-Aug-200910 KiB255188

TODOH A D23-Aug-20093.7 KiB8762

aclocal.m4H A D11-Jan-201030.8 KiB863773

binfmt.cH A D26-Dec-20092.7 KiB11969

comparisons.hH A D05-Aug-2009528 1612

compdefs.hH A D05-Aug-2009468 1512

config.h.inH A D11-Jan-20105.2 KiB198133

configureH A D11-Jan-2010178.8 KiB6,1004,981

configure.acH A D11-Jan-20103.7 KiB11695

conversions.cH A D05-Aug-200951.8 KiB2,8952,859

depcompH A D05-Aug-200912.2 KiB437298

dstr.cH A D05-Aug-20092.7 KiB11172

dstr.hH A D05-Aug-2009538 1712

ex_codes.hH A D05-Aug-2009188 63

exitcode.hH A D05-Aug-2009317 1914

info.cH A D03-May-202216.3 KiB349309

input.cH A D03-May-20228 KiB333257

input.hH A D05-Aug-2009124 64

install-shH A D05-Aug-20095.4 KiB252153

iso8601.cH A D05-Aug-20096.6 KiB260160

key.hH A D05-Aug-20092.3 KiB8065

misc.cH A D05-Aug-200916 KiB726600

missingH A D05-Aug-200910 KiB337263

mkinstalldirsH A D05-Aug-20091.8 KiB10272

msg.tclH A D05-Aug-2009396 KiB10,1368,916

msort-8.53.lsmH A D11-Jan-20101.6 KiB3433

msort.1H A D11-Jan-201011.1 KiB311306

msort.cH A D03-May-2022138.6 KiB5,3134,739

msort_limits.hH A D05-Aug-2009976 3415

record.hH A D05-Aug-2009851 3925

retcodes.hH A D05-Aug-200959 62

sorts.cH A D05-Aug-20099.7 KiB393298

strs.cH A D05-Aug-200910.5 KiB437307

unicode.hH A D05-Aug-2009771 2622

uniio.cH A D05-Aug-20096 KiB207115

unorm.hH A D05-Aug-2009186 117

utf8error.hH A D05-Aug-2009280 135

README

1This package consists of two related programs.
2The first, msort, is the actual sort program.
3It has a command-line interface and is written in C.
4The code is quite standard and no exotic libraries
5are required, so it should compile and run on
6any POSIX-compliant system.
7
8The one non-standard library required is
9Ville Laurikari's TRE regular expression library,
10available at http://laurikari.net/tre/.
11
12The second program, msg, is a graphical front end
13to msort. It isn't of any real use without msort,
14but it doesn't literally depend on it. You can
15run it on a system lacking msort. When it starts
16up it will report that it cannot find msort, and
17therefore of course it will not actually sort
18anything, but if it amuses you, you can still play
19with it. msg is written in Tcl and uses the
20Tk toolkit. It is meant to be run under wish, the
21Tcl/Tk windowing shell. So long as you have
22Tcl/Tk/wish available, there is nothing much
23to be done to install msg. Since Tcl is
24interpreted, no compilation is necessary.
25
26If you do not have Tcl/Tk, don't worry, it is easy
27to obtain and install. For most platforms, the easiest
28approach is to obtain the ActiveTcl distribution from:
29http://www.activestate.com/Products/ActiveTcl
30Further information is available at:
31http://billposer.org/Software/msort.html
32
33
34FURTHER DETAILS ON MSORT
35
36Msort has been developed and tested primarily under
37GNU/Linux. I also have access to a machine running
38FreeBSD and am able to test it there. According to
39reports from others, it compiles and runs under
40Solaris and Mac OS X.
41
42The man page only gives basic information.
43The real reference manual is Doc/msort.pdf.
44
45DEPENDENCIES
46
47Msort makes use of several libraries that are not routinely installed.
48The first is Ville Laurikari's regular expression library, wihch may be
49obtained from: http://laurikari.net/tre/. This library is reported to
50work on pretty much all varieties of Unix, including Mac OS X, as well
51as MS Windows XP.
52
53Second, msort requires support for Unicode normalization. It can be compiled to
54use either libicu (International Components for Unicode), which may be obtained
55from http://www.icu-project.org/, or libutf8proc, which may be obtained from
56http://www.flexiguided.de/publications.utf8proc.en.html. ICU is fairly widely
57used, so you already have it on your system. To use it, give the option
58--disable-utf8proc to configure. msort defaults to using utf8proc because
59utf8proc is smaller and easier to install.
60
61Third, msort optionally uses libuninum to handle numbers in systems other than
62the usual Indo-Arabic system. Libuninum is my own library and may be obtained
63from http://billposer.org/Software/libuninum.html. Packages for a variey of systems
64are available. If you do not need support for exotic number systems, you may build
65msort without libuninum. To do this, give the option --disable-uninum to configure.
66
67Libuninum in turn uses the GNU MP library for arbitrary precision arithmetic.
68It is available from http://www.swox.com/gmp/. libgmp is required if libuninum is linked.
69
70To summarize, if you want to build msort with the minimum of trouble,
71you will need libtre and either libutf8proc or libicu. If the latter is
72not already installed, you will probably find it easier to go with the
73libutf8, which is the default. If you do not need to handle exotic number
74systems, you can forgo libuninum and libgmp. To build this minimal configuration,
75call configure as follows:
76
77configure --disable-uninum
78
79On some systems, the autoconfiguration system will not detect the need to link
80to libintl. If this happens to you, give the flag:
81
82   LIBS="-lintl"
83
84to configure, e.g.:
85
86 	./configure LIBS="-lintl"
87
88
89INSTALLATION
90
91If you have the GNU autoconf system available, follow the
92generic installation instructions in INSTALL. In short, these are:
93
94./configure
95make
96make test
97(su)
98make install-strip
99
100The last command arranges for the symbol table to be removed from
101the executable file when it is installed, which results in a substantial
102reduction in size. If you want to be able to use a debugger on msort
103you will want to preserve the symbol table, in which case you should
104give the command:
105
106make install
107
108instead.
109
110"make test" is optional. It executes a set of regression tests.
111The tests run very quickly so don't hesitate to try it.
112The results will be written to the file RegressionTests/TestResults.
113
114There are a few additional tests that are not executed by "make test".
115These are tests that depend on the correct functioning of the locale
116system, including the ability to switch into certain particular locales.
117They are kept separate because they can fail even if msort itself is
118working perfectly. To execute these tests, give the command:
119
120make localetest
121
122The results will be written to the file RegressionTests/LocaleTestResults.
123
124
125There are several non-standard options to configure:
126
127--disable-allocaok
128
129By default, in certain situations msort uses the alloca routine to allocate
130storage on the stack, which is faster than allocating it on the heap.
131However, alloca is buggy on some systems. If you give configure the option
132--disable-allocaok, msort will not use alloca. If you know that alloca
133is funky on your system, or if msort seems to behave strangely, configuring
134msort with this flag is wise.
135
136--disable-uninum
137
138Build without reliance on libuninum. This eliminates the ability to handle
139exotic number systems.
140
141--disable-utf8proc
142
143Use libicu rather than the default of utf8proc for Unicode normalization.
144
145--disable-comparison-count
146
147Eliminates the comparison count. In theory this will speed things up slightly,
148but the speed-up is unlikely to be noticable.
149
150--enable-debugbuild
151
152This adds replaces the default compiler options "-g -O2" with "-ggdb -g3",
153causing the resulting executable to contain the maximum amount of useful
154information for gdb and disabling optimazation. This eliminates the need
155for manual editing of the Makefile. It also defines the MACRO DEBUGBUILD
156in the C files, allowing conditional compilation of code for debugging.
157
158
159For generic details on installation using the the autoconf system, see the
160file "INSTALLATION". The standard option you are most likely to be
161interested in is: --prefix=foo, which changes the directories in which
162msort is installed. For example, by default the executables will be installed
163in /usr/local/bin. If you prefer to install the executables in your personal
164bin, in my case, /home/poser/bin, you can configure msort using the command:
165
166./configure --prefix=/home/poser
167
168This will result in the executables being put in /home/poser/bin, the manual page
169in /home/poser/man/man1, etc.
170
171If you do not have autoconf/automake, or if a problem arises,
172look in the Doc directory for the file OriginalMakefile
173and make a copy of it in this directory named Makefile.
174
175To compile, first see if there is anything in the Makefile
176that you want to change.  You may wish to change the default
177installation directories BINDIR, where the executable goes,
178and MANDIR, where the manual page goes. The compiler is also
179set to gcc.  If you don't have gcc, or want to use another
180compiler, change the value of CC.
181
182Then a simple "make" should suffice to compile msort.
183
184To install, su if necessary, then "make install".
185
186Msort uses the TRE regular expression library to match tags
187and to perform substitutions on keys. This library is
188available for a wide range of systems but in source form. It
189must be compiled and installed. Clear instructions for
190compiling and installing it are provided with the
191package. However, those not experienced with installing
192libraries may encounter difficulties.
193
194One problem that you may encounter is that, even after you
195install the library, the linker (part of the compilation
196process) says that it cannot find it. This is probably the
197result of the library having been installed in a directory
198that the linker does not know about.
199
200To remedy this, you need to run the ldconfig program. On
201Linux systems this should be located in /sbin, a directory
202that contains programs normally used only by the system
203administrator. You will need to be root to run ldconfig.
204
205Ldconfig indexes the standard directories /usr/lib and /lib,
206any directories listed in the file /etc/ld.so.conf, and
207directories listed on the command line.  If you install the
208TRE library in a directory other than /lib or /usr/lib, such
209as the default /usr/local/lib, you will need to tell
210ldconfig to search that directory. You can do this either by
211adding the name of the directory to /etc/ld.so.conf or
212supplying the directory name on the command line, e.g.:
213
214/sbin/ldconfig /usr/local/lib
215
216Another approach is to give the compiler options that it will
217pass on to the linker to tell it where to look.
218There are two such options: -L and -rpath.
219On some systems -L is used for static libraries and -rpath
220for shared libraries, but there is some variation. It appears
221always to work if you just use both.
222
223This is especially useful if you do not have root privileges
224on the system.
225
226In the msort Makefile, the relevant portion looks like this:
227
228
229msort:		${OBJS}
230		${CC} -o msort ${OBJS} -ltre
231
232This says that "msort" depends on the files listed in the
233variable OBJS, namely msort.o, misc.o, etc., and that
234"msort" is created from these files by running the command
235that is the value of the variable CC.  The value of CC will
236generally be "gcc". The flag -ltre indicates that the TRE
237library should be loaded. To tell the linker that the files
238for the TRE library are located in /usr/local/lib/, change
239the second line above to:
240
241	${CC} -o msort ${OBJS} -L /usr/local/lib -rpath /usr/local/lib -ltre
242
243Of course, if you don't have root privileges you probably can't install
244TRE in /usr/local/lib. If you install it in one of your own directories,
245give that directory as argument to -L and -rpath instead, e.g.:
246
247	${CC} -o msort ${OBJS} -L /home/wjposer/Src/lib -rpath /home/wjposer/Src/lib -ltre
248
249
250Some sample sort order definition files are provided in the SortOrders subdirectory.
251In addition to serving as examples, some of them may be useful, if, for example,
252you need to sort country names in United Nations order, sort by the Chinese
253Heavenly Stems, or handle traditional Armenian dates.
254
255