source: git/factory/README @ 9f8d5d

fieker-DuValspielwiese
Last change on this file since 9f8d5d was b7ef56, checked in by Jens Schmidt <schmidt@…>, 26 years ago
* INSTALL, README: doc fixes for the Windows NT port git-svn-id: file:///usr/local/Singular/svn/trunk@950 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 21.0 KB
Line 
1
2
3      --- This `README' file corresponds to Factory version 1.3b ---
4
5
6                          README file for Factory
7                          =======================
8
9NOTE: The copyright state of Factory is still unclear.  Sooner or later it
10will be free software, but by now please do *not* distribute the sources.
11
12
13Overview
14========
151.  What is Factory?
162.  Comments, Questions, Bug Reports
173.  Installation
184.  Distribution
195.  Prerequisites
206.  Memory Manager
217.  Stream IO
228.  Diagnostic Messages
239.  GF(q) Tables
2410. A Note on Singular
2511. Configure Options, Dependencies
2612. Linking Factory with Your Application
2713. Factory Template Instantiation
2814. Documentation
2915. Examples and Tests
3016. Editing Factory
3117. Files in the Distribution
32
33
341. What is Factory?
35===================
36  Factory is a C++ class library that implements a recursive representation
37of multivariate polynomial data.  It is being developed by Ruediger Stobbe
38and Jens Schmidt at the University of Kaiserslautern as an independent and
39self-contained part of the computer algebra system Singular (developed by
40G.-M. Greuel, G. Pfister and H. Schoenemann).
41
42  Factory handles sparse multivariate polynomials over different
43coefficient domains, such as Z, Q and GF(q), as well as algebraic
44extensions over Q and GF(q) in an efficient way.  Factory includes
45algorithms for computing univariate and multivariate gcds, resultants,
46chinese remainders, and several algorithms to factorize univariate
47polynomials over the integers and over finite fields.  Factorization of
48multivariate polynomials over the integers is in beta test stage.
49
50  The interface to the polynomial system of Factory is provided by a single
51class `CanonicalForm' which can deal with elements of the coefficient
52domain as well as polynomials.  Using operator overloading, you can handle
53polynomial data similarly to built-in types such as the machine integers.
54For example, to add two polynomials one simply uses the `+' operator.
55Because of this, Factory is easy to use even if you are not familiar with
56C++ programming.
57
58  There are a couple of utility classes provided by Factory such as lists,
59arrays, polynomial maps, etc.  These make the usage more comfortable.
60
61
622. Comments, Questions, Bug Reports
63====================================
64  Factory is a project in evolution.  That means there is no guarantee that
65Factory is bug free.  I am sure that there are bugs or at least features.
66If you find bugs or if you find a strange behavior of the library, please
67let me know (e-mail: Jens Schmidt <schmidt@mathematik.uni-kl.de>).
68Comments and questions are welcome, too.
69
70  Factory version 1.2c and newer define an external variable
71`factoryVersion' describing the version of the library.  The external
72variable `factoryConfiguration' (not present in versions 1.2c and 1.3a)
73describes the options Factory has been configured with.  Please include the
74version number and the configuration options in your bug reports.  You may
75either use the UNIX utility `what' to get this information (`what libcf.a')
76or compile and run something similar to this:
77
78  #include <factory.h>
79  main() { cout << factoryVersion << "; " << factoryConfiguration << endl; }
80
813. Installation
82===============
83NOTE: If you have received this Factory distribution together with Singular
84you do not have to worry about compilation or installation at all.  The
85installation procedure for Singular should do everything for you.  For more
86information, see the section "A Note on Singular".
87
88  See the `INSTALL' file for instructions on how to install Factory.  The
89installation procedure on UNIX platforms conforms more or less to the GNU
90standard:
91
92  ./configure; make; make gftables; make install; make installgftables
93
94However, I recommend to read the instructions since there are a lot of
95non-standard options to configure.
96
97  On platforms other than UNIX, where there is no `configure', you have to
98configure and install Factory by hand.  In particular, you have to
99create/edit the files `config.h', `factory.h', `factoryconf.h', and
100`GNUmakefile'.  For Microsoft Windows NT 4.0 with the Microsoft Visual C++
1015.0 compiler there is a preconfigured environment in the `winnt/' directory
102which you may use as an example.  For more information, confer to
103corresponding section in the `INSTALL' file and to the `INSTALL.nt' file in
104the `winnt/' directory.
105
106  In general, this `README' as well as the `INSTALL' file are written for
107UNIX platforms.  However, you may find less specific information on the
108configuration and installation process which is useful for other platforms,
109too.
110
111
1124. Distribution
113===============
114  The latest version of Factory is always available by anonymous ftp from
115
116                www.mathematik.uni-kl.de:/pub/Math/Factory
117
118The Factory distribution consists of three archives:
119
120o the Factory source code (`factory-<version>.tgz');
121o some preliminary documentation on Factory (`factory-doc-prelim.tgz');
122o Factory GF(q) addition tables (`factory-gftables.tgz', see below).
123
124
1255. Prerequisites
126================
127  You need GNU make to build and install Factory.  Furthermore, I strongly
128recommend to build Factory with GNU CC (version 2.7 or newer).  To build
129Factory and to link your programs with Factory you need the GNU Multiple
130Precision Library (GMP, version 2.0 or newer).  The GMP library is
131available at ftp.gnu.ai.mit.edu or its mirrors.  Alternatively, Factory may
132be linked with the so called small GMP library which comes with the full
133version of Singular (not recommended).
134
135Configure options:
136------------------
137  --with-gmp(=<gmp_inc_path>(,<gmp_lib_path>))
138                          specify where to find the GMP library.
139  --enable-gmp            together with `--with-Singular' means: installation
140                          in process, be graceful when there is no `gmp.h'
141
142  If <gmp_lib_path> is not given, but <gmp_inc_path> is,
143`<gmp_inc_path>/../lib/' is used as <gmp_lib_path>.  If neither
144<gmp_lib_path> nor <gmp_inc_path> is specified, `configure' looks in the
145standard system locations for GMP.
146
147  Furthermore, you may specify the symbolic directory `$(includedir)' for
148<gmp_inc_path>:
149
150  --with-gmp='$(includedir)'
151
152Do not forget the single quotes or otherwise your shell might complain.
153
154  This is useful when Factory is delivered as part of a larger package
155which also provides the GMP library.  In this case, at configuration time
156there would not be any `gmp.h'.  Without this option, Factory's `configure'
157script would exit with an error message.  If this symbolic directory is
158given, the `configure' script does not look for `gmp.h' and `libgmp.a'.
159Rather, it adds the option `-I$(includedir)' to its `$(CXXFLAGS)' and the
160option `-L$(libdir)' to its `$(LDFLAGS)' assuming that at compilation-time
161`gmp.h' and `libgmp.a' will reside in these directories.
162  The option `--enable-gmp' does the same, but it is a special (and ugly)
163gift to Singular, so it may be used with option `--with-Singular' only.
164
165
1666. Memory Manager
167=================
168  You can use one of the memory management tools provided with Factory.
169There are the "new" and the "old" memory manager.  In fact, on some systems
170the old memory management seems to be faster then the new one, but so far
171there have not been systematic timings.  If you configure Factory with
172`--with-memman=no' it will use the standard C++ operators `new'/`delete',
173which is not recommended.
174  You may trace the actions (allocate/free) of the new memory manager by
175enabling memory management debugging.  This produces a *lot* of output.
176
177Configure options:
178------------------
179  --with-memman(=<memman>) specify Factory memory manager.
180                          <memman> is either `old' (default), `new', or `no'.
181  --enable-memdebug=<level> switch on memory management debugging.  Meaningful
182                          with `--with-memman=new' only.  <level> may be either
183                          `no' (default), `normal', or `full'.
184
185
1867. Stream IO
187============
188  For use with other systems which have their own IO routines to print
189polynomials it is possible to switch off Factory's stream IO.  In this
190case, you do not need to link libg++ or libiostream with Factory.
191
192Configure options:
193------------------
194  --disable-streamio      build Factory without stream IO
195
196
1978. Diagnostic Messages
198======================
199Factory has three types of diagnostic messages:
200o Assertions (implemented by the "ASSERT macros" in `assert.h') are used to
201  ensure preconditions before running some algorithm.  A typical example is
202  to test f != 0 before dividing by f.
203o Debug output (implemented by the "DEBOUT macros" in `debug.h'/`debug.cc')
204  is used to trace complex algorithms, e.g. factorization.
205o Timing information may be accumulated and printed using the "TIMING macros"
206  in `timing.h'.
207
208  Since all diagnostic messages are implemented using preprocessor macros,
209they will completely cease when disabled, thus avoiding any impact on
210speed.  For more information, see section "Configuring and building Factory
211for different configurations" in the `INSTALL' file.  By default, all
212diagnostic messages are disabled.
213
214Configure options:
215------------------
216  --enable-assertions     build Factory with assertions activated
217  --enable-timing         build Factory so it will print timing information
218  --enable-debugoutput    build Factory so it will print debugging information
219
220
2219. GF(q) Tables
222===============
223
224NOTE: Since the format of the GF(q) tables changed from Factory Version
2251.2b to Factory Version 1.3a you should get/create them by new!
226
227  Factory uses addition tables to calculate in GF(p^n) in an efficient way.
228
229There are two possibilities to get these tables:
230o get them from the net (`factory-gftables.tgz') where you got Factory
231  from.  The files unpack into a directory `gftables/'.
232o create them with `gengftables' which is a part of Factory.  Building
233  the tables takes quite a while!
234See the `INSTALL' file for more information.
235
236
23710. A Note on Singular
238=====================
239  If you have received this Factory distribution together with Singular you
240do not have to worry about compilation or installation at all.  The
241installation procedure for Singular should do everything for you.  If you
242want to configure/build the package on your own instead of letting
243Singular's `configure' do the work you should:
244
245  ./configure --with-Singular --enable-gmp
246        (or, equivalently: )
247  ./configure --with-Singular --with-gmp='${includedir}'
248
249  Furthermore, you should specify `--prefix' so `make install' will install
250the files in the places where Singular looks for them.  By default, this is
251the top directory of the Singular distribution.  In this case you have to
252specify `--prefix=..'.
253
254  The Singular GF(q) tables are the same as the Factory GF(q) tables.
255However, Singular uses a different naming scheme.  Therefore, a Factory
256configured with `--without-Singular' will not find Singular's GF(q) tables
257as well as a Factory configured with `--with-Singular' will not find the
258GF(q) tables created by gengftables.  But this is not a major drawback
259since Singular is distributed with ready-to-use GF(q) tables.
260
261  The latest version of Singular is always available at
262www.mathematik.uni-kl.de:/pub/Math/Singular.
263
264Configure options:
265------------------
266  --with-Singular         build for use with computer algebra system Singular.
267
268  Except from setting the `#define SINGULAR', this option only changes the
269defaults to: `--with-memman=no --disable-streamio'.
270
271
27211. Configure Options, Dependencies
273===================================
274o do not configure `--with-Singular --with-memman'.  In this case
275  both Singular and the library will try to initialize their own memory
276  management.
277
278o do not configure `--disable-streamio --enable-debugoutput'.  The
279  "DEBOUT macros" need stream IO.
280
281o you may configure `--with-Singular --enable-streamio', but this
282  is not supported by Singular.  You will have to change manually
283  Singular's `Makefile'.  The same is true for `--with-Singular
284  --enable-streamio --enable-debugoutput'.
285
286o you may configure `--with-Singular --enable-timing', but this
287  will not have any visible effect (except from a slightly slower
288  running time) because Singular will not print the timing
289  results.
290
291o `--enable-gmp' has an effect only together with `--with-Singular'
292
293o `--with-memdebug' has an effect only together with
294  `--with-memman=new'
295
296
29712. Linking Factory With Your Application
298=========================================
299  To translate your application you need (apart from your
300application, of course):
301
302o the Factory user interface header file (`factory.h')
303
304  To link your application with Factory you need:
305
306o the Factory library (`libcf.a')
307o unless you configured Factory `--without-memman' you need one of the
308  Factory memory manager libraries (`libcfmem.a')
309
310o the instantiated Factory templates (`ftmpl_inst.o').
311
312o unless you configured Factory `--without-streamio' you need the stream IO
313  libraries.  With GNU CC, you do not need to care about this because they
314  are linked automatically to your application if you call the compiler
315  either as `g++' or as `c++'.  Otherwise, you need to link with library
316  `libiostream.a'.
317o The GNU Multiple Precision Library (`libgmp.a').  See section
318  "Prerequisites" in this file for more information.
319o The standard mathematical library (`libm.a')
320
321  `factory.h', `libcf.a', and `libcfmem.a' are created when you build
322Factory and installed by `make install'.  `libiostream.a', `libgmp.a', and
323`libm.a' should be already installed on your system, otherwise your
324application will fail to link.  `ftmpl_inst.o' is not installed by Factory.
325Instead, its source file `ftmpl_inst.cc' is installed and you have to build
326`ftmpl_inst.o' when you are building your application.  For more
327information on template instantiation and `ftmpl_inst.cc', see the
328following section "Factory Template Instantiation".
329
330  To give an example, look at the following one-shot solution to the
331problem "linking Factory with your application" where the "application" is
332a small test program (`application.cc') from the subdirectory `examples/'
333of the Factory source directory ('\' at the end of a line denotes line
334continuation):
335
336  g++ -c /usr/local/include/templates/ftmpl_inst.cc \
337    -fno-implicit-templates -O2 -fomit-frame-pointer -o ftmpl_inst.o
338  g++ -c application.cc -fno-implicit-templates -O2 -fomit-frame-pointer \
339    ftmpl_inst.o -lcf -lcfmem -lm -lgmp
340
341  This should work fine provided that you installed Factory in a location
342where `g++' may find it (here I have assumed `/usr/local/') and all the
343other files mentioned above are installed properly and where `g++' looks
344for them.
345
346  You may find a small `GNUmakefile' which translates `application.cc' and
347other examples in the `examples/' subdirectory of the Factory source
348directory.  For more information, see the section "Examples and Tests".
349
350
35113. Factory Template Instantiation
352==================================
353  There are a couple of classes provided by Factory such as lists, arrays,
354etc, which may be used to derive new abstract data types from already
355existing ones.  Factory uses them itself, e.g. to return the result of a
356factorization (a list of factors), and you may use them to create new
357derived abstract data types.  These classes are realized using C++
358"templates", which you need to "instantiate" befor you use them (refer to
359some introduction to C++ if you do not know these terms).
360
361  With GNU CC the most reliable way to instantiate templates is to
362
363o explicitely instantiate all necessary templates, and compile with option
364  `-fno-implicit-templates' and to
365o collect all explicit template instantiations in one single file.
366
367  This approach is the one Factory uses.  All object files of the library
368are generated with option `--fno-implicit-templates' and the explicit
369template instantiations are collected in `ftmpl_inst.cc'.  You could
370translate this file using the `make' target `ftmpl_inst.o' (see section
371"Building Factory" in the `INSTALL' file).
372
373  The consequence of this approach: since you may want to add template
374instantiations of Factory's or your own templates after the installation of
375Factory, it is necessary to install `ftmpl_inst.cc' as well as the template
376source files together with the library.  They are automatically installed
377in `$(includedir)/templates/' when you type `make install'.
378
379  To join your own template instantiations with the ones from
380`ftmpl_inst.cc' there are several possibilities:
381
382o you copy `ftmpl_inst.cc' file from the directory where it was installed
383  into your working directory and add your template instantiations after
384  the corresponig comment at the end of the file;
385o you cut the template instantiations from `ftmpl_inst.cc' and paste
386  them into your own template instantiation file.
387
388Both methods suffer from one disadvantage: each time `ftmpl_inst.cc'
389changes in a new version of Factory you will have to redo these steps.  The
390best method therefore is maybe this one:
391
392o you write your own template instantiation file with a
393  `#include <templates/ftmpl_inst.cc>' statement at the beginning of it.
394
395
39614. Documentation
397=================
398  So far there are only preliminary versions of a user/reference manual and
399a tutorial ("A quick start into Factory").  Please do not expect them to
400be error-free or even complete.  For this reason, the documentation is not
401included in the source code archive (`factory-<version>.tgz').  Instead, the
402sources and compiled DVI files reside in `factory-doc-prelim.tgz'. They will
403unpack into a directory `factory-doc-prelim/'.
404
405
40615. Examples and Tests
407======================
408  The directory `examples/' in the Factory source directory contains some
409example applications for Factory and a `GNUmakefile' to build them.  The
410main purpose of the examples is to show how to link applications with an
411installed version of Factory.  This means that you have to install Factory
412before you can build the examples (but it is not necessary to install the
413GF(q) tables).  For the same reason, the `GNUmakefile' is not configured
414automatically by `configure'.  You will have to change some of the
415variables manually.
416
417  Furthermore, you may have a look at `gengftables.cc' in the Factory
418source directory which is another application of the most basic Factory
419features.
420
421  To test whether Factory (including GF(q) tables) has been installed
422properly, use `make' target `installtest'.
423
424
42516. Editing Factory
426===================
427  Parts of Factory are written using GNU Emacs' `folding-mode'.  You may
428load this mode from Emacs with
429
430  M-x load-file RET factory-<version>/bin/folding.el RET
431
432To switch it on, say `M-x folding-mode RET'.  Alternatively, you may load
433`factory-<version>/bin/fold-docu.el' which contains some additional functions
434to fold only the documentation.  If you add the following lines to your
435`.emacs' file, all this would be done automatically for you:
436
437  (load-file "factory-<version>/bin/folding.el")
438  (load-file "factory-<version>/bin/fold-docu.el")
439  (add-hook 'c-mode-common-hook 'folding-mode)
440  (setq fold-fold-on-startup nil
441        fold-mode-marks-alist '((c++-mode "//{{{" "//}}}")))
442  (set-default 'fold-internal-margins nil)
443
444  For more information, see the respective files.
445
446
44717. Files in the Distribution
448=============================
449ChangeLog       - history of changes
450INSTALL         - installation instructions
451NEWS            - new Factory features
452README          - this file
453
454bin/install-sh  - a script version of the BSD `install' program
455bin/makeheader  - creates headers from header templates (`*.template')
456bin/mkinstalldirs - recursive `mkdir'
457bin/folding.el  - Emacs `folding-mode'
458bin/fold-docu.el - some extensions to it
459
460GNUmakefile.in  - master makefile and
461config.h.in     - configuration include file.  Run `configure' to create
462                  `GNUmakefile' and `config.h', resp.
463configure
464configure.in    - `configure' script generated with Autoconf 2.10
465                  from `configure.in'
466
467factory.template
468factoryconf.template - header templates for the user interface header
469                  files.  Run `makeheader' to create `factory.h' and
470                  `factoryconf.h', resp.
471
472ffops.cc
473ffops.h
474gf_tabutil.cc
475gf_tabutil.h
476gfops.cc
477gfops.h
478imm.h
479int_*.cc
480int_*.h         - low level classes and functions
481
482canonicalform.cc
483canonicalform.h
484cf_*.cc
485cf_*.h
486variable.cc
487variable.h      - high level classes and functions.  User interface to
488                  the polynomial (and other) arithmetic.
489
490templates/      - Factory templates
491ftmpl_inst.cc   - template instantiation for Factory templates
492
493fac_*.cc
494fac_*.h         - high level algorithms (factorization, gcd, sqfr
495                  computation, etc.)
496sm_*.c
497sm_*.h          - sparse modular gcd.  Contributed by Marion Bruder
498                  <bruder@math.uni-sb.de>
499
500parseutil.cc
501parseutil.h
502readcf.cc
503readcf.y        - Factory parser to read canonical forms.  `readcf.cc'
504                  translated with Bison 1.18 from `readcf.y'.
505
506gmpext.h
507initgmp.cc      - Factories interface to GNU MP
508singext.cc
509singext.h       - Factories interface to Singular
510
511memutil.c
512memutil.h       - "old" Factory memory manager
513memman.h
514mm*.c
515mm*.h           - "new" Factory memory manager
516newdelete.cc    - C++ interface to the memory managers
517
518assert.h        - the "ASSERT macros"
519debug.h
520debug.cc        - the "DEBOUT macros"
521timing.h        - the "TIMING macros"
522
523examples/       - some example applications for Factory and a `GNUmakefile'
524                  to build them
525gengftables.cc  - run `gengftables' to create the GF(q) addition tables
526                  necessary to work with Factory
527test_install.cc - a small program to test whether installation has
528                  been successful.  Built and called by `make' target
529                  `installtest'
Note: See TracBrowser for help on using the repository browser.