Changeset 1e9048 in git for factory/README
- Timestamp:
- Nov 4, 2013, 2:46:12 PM (10 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 564e397d4ea84b6bd1320621916a970d7ecb1f14
- Parents:
- 763c4ddb0c6304b684b9b52b91d2713df4bbb4eea9b7f77507baced4cd75ddcfb401a377e267a851
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/README
r763c4d r1e9048 1 1 2 2 3 --- This `README' file corresponds to Singular-Factory version 3.1---3 --- This `README' file corresponds to Singular-Factory version 4.0 --- 4 4 5 5 … … 17 17 4. Distribution 18 18 5. Prerequisites 19 6. Memory Manager 20 7. Stream IO 21 8. Diagnostic Messages 22 9. GF(q) Tables 23 10. A Note on Singular 24 11. Configure Options, Dependencies 25 12. Linking Factory with Your Application 26 13. Factory Template Instantiation 27 14. Documentation 28 15. Examples and Tests 29 16. Editing Factory 30 17. Files in the Distribution 31 19 6. Stream IO 20 7. Diagnostic Messages 21 8. GF(q) Tables 22 9. A Note on Singular 23 11. Factory Template Instantiation 24 12. Documentation 25 13. Examples and Tests 32 26 33 27 1. What is Factory? 34 28 =================== 35 29 Factory is a C++ class library that implements a recursive representation 36 of multivariate polynomial data. It is beingdeveloped by Ruediger Stobbe30 of multivariate polynomial data. It was developed by Ruediger Stobbe 37 31 and Jens Schmidt at the University of Kaiserslautern as an independent and 38 32 self-contained part of the computer algebra system Singular (developed by 39 G.-M. Greuel, G. Pfister and H. Schoenemann) .33 G.-M. Greuel, G. Pfister and H. Schoenemann) and is now developed by Martin Lee. 40 34 41 35 Factory handles sparse multivariate polynomials over different … … 43 37 extensions over Q and GF(q) in an efficient way. Factory includes 44 38 algorithms for computing univariate and multivariate gcds, resultants, 45 chinese remainders, and several algorithms to factorize univariate46 polynomials over the integers and over finite fields. Factorization of 47 multivariate polynomials over the integers is in beta test stage.39 chinese remainders, and algorithms to factorize multivariate polynomials 40 and to compute the absolute factorization of multivariate polynomials with integer 41 coefficients. 48 42 49 43 The interface to the polynomial system of Factory is provided by a single … … 57 51 There are a couple of utility classes provided by Factory such as lists, 58 52 arrays, polynomial maps, etc. These make the usage more comfortable. 59 60 61 53 62 54 2. Comments, Questions, Bug Reports … … 86 78 information, see the section "A Note on Singular". 87 79 88 See the `INSTALL' file for instructions on how to install Factory. The 89 installation procedure on UNIX platforms conforms more or less to the GNU 80 For further information on factory's configure options see also ./configure --help. 81 82 The installation procedure on UNIX platforms conforms more or less to the GNU 90 83 standard: 91 84 92 ./configure; make; make gftables; make install; make installgftables 93 94 However, I recommend to read the instructions since there are a lot of 95 non-standard options to configure. 96 97 On platforms other than UNIX, where there is no `configure', you have to 98 configure and install Factory by hand. In particular, you have to 99 create/edit the files `config.h', `factory.h', `factoryconf.h', and 100 `GNUmakefile'. For Microsoft Windows NT 4.0 with the Microsoft Visual C++ 101 5.0 compiler there is a preconfigured environment in the `winnt/' directory 102 which you may use as an example. For more information, confer to 103 corresponding section in the `INSTALL' file and to the `INSTALL.nt' file in 104 the `winnt/' directory. 85 ./configure --without-Singular; make; make check; make install; 105 86 106 87 In general, this `README' as well as the `INSTALL' file are written for … … 109 90 too. 110 91 111 112 113 92 4. Distribution 114 93 =============== 115 The latest version of Factory is always available by anonymous ftpfrom94 The latest stable version of Factory is always available from 116 95 117 www. mathematik.uni-kl.de:/pub/Math/Singular/Factory96 www.singular.uni-kl.de 118 97 119 The Factory distribution consists of three archives: 98 For the latest development version visit 120 99 121 o the Factory source code (`factory-<version>.tgz'); 122 o some preliminary documentation on Factory (`factory-doc-prelim.tgz'); 123 o Factory GF(q) addition tables (`factory-gftables.tgz', see below). 124 100 www.github.com/Singular 125 101 126 102 5. Prerequisites 127 103 ================ 128 104 You need GNU make to build and install Factory. Furthermore, I strongly 129 recommend to build Factory with GNU CC (version 2.7 or newer). To build105 recommend to build Factory with GNU CC. To build 130 106 Factory and to link your programs with Factory you need the GNU Multiple 131 Precision Library (GMP, version 2.0 or newer). The GMP library is 132 available at ftp.gnu.ai.mit.edu or its mirrors. Alternatively, Factory may 133 be linked with the so called small GMP library which comes with the full 134 version of Singular (not recommended). 107 Precision Library (GMP). 135 108 136 109 Configure options: 137 110 ------------------ 138 --with-gmp(=<gmp_inc_path>(,<gmp_lib_path>)) 139 specify where to find the GMP library. 140 --enable-gmp together with `--with-Singular' means: installation 141 in process, be graceful when there is no `gmp.h' 111 --with-gmp=<path to GMP> enabled by default 142 112 143 If <gmp_lib_path> is not given, but <gmp_inc_path> is, 144 `<gmp_inc_path>/../lib/' is used as <gmp_lib_path>. If neither 145 <gmp_lib_path> nor <gmp_inc_path> is specified, `configure' looks in the 146 standard system locations for GMP. 147 148 Furthermore, you may specify the symbolic directory `$(includedir)' for 149 <gmp_inc_path>: 150 151 --with-gmp='$(includedir)' 152 153 Do not forget the single quotes or otherwise your shell might complain. 154 155 This is useful when Factory is delivered as part of a larger package 156 which also provides the GMP library. In this case, at configuration time 157 there would not be any `gmp.h'. Without this option, Factory's `configure' 158 script would exit with an error message. If this symbolic directory is 159 given, the `configure' script does not look for `gmp.h' and `libgmp.a'. 160 Rather, it adds the option `-I$(includedir)' to its `$(CXXFLAGS)' and the 161 option `-L$(libdir)' to its `$(LDFLAGS)' assuming that at compilation-time 162 `gmp.h' and `libgmp.a' will reside in these directories. 163 The option `--enable-gmp' does the same, but it is a special (and ugly) 164 gift to Singular, so it may be used with option `--with-Singular' only. 165 166 167 168 6. Memory Manager 169 ================= 170 You can use one of the memory management tools provided with Factory. 171 There are the "new" and the "old" memory manager. In fact, on some systems 172 the old memory management seems to be faster then the new one, but so far 173 there have not been systematic timings. If you configure Factory with 174 `--with-memman=no' it will use the standard C++ operators `new'/`delete', 175 which is not recommended. 176 You may trace the actions (allocate/free) of the new memory manager by 177 enabling memory management debugging. This produces a *lot* of output. 113 For full functionality NTL (www.shoup.net/ntl) is required. 178 114 179 115 Configure options: 180 116 ------------------ 181 --with-memman(=<memman>) specify Factory memory manager. 182 <memman> is either `old' (default), `new', or `no'. 183 --enable-memdebug=<level> switch on memory management debugging. Meaningful 184 with `--with-memman=new' only. <level> may be either 185 `no' (default), `normal', or `full'. 117 --with-ntl=<path to NTL> enabled by default 186 118 119 For optimal preformance we recommend to use FLINT (www.flintlib.org) and to use 120 Singular's memory manager omalloc 187 121 188 7. Stream IO 122 Configure options: 123 ------------------ 124 --with-flint=<path to FLINT> enabled by default 125 --with-omalloc disabled by default 126 --with-omalloc-dir=<path to omalloc> 127 128 6. Stream IO 189 129 ============ 190 130 For use with other systems which have their own IO routines to print 191 polynomials it is possible to switch off Factory's stream IO. In this 192 case, you do not need to link libg++ or libiostream with Factory. 131 polynomials it is possible to switch off Factory's stream IO. 193 132 194 133 Configure options: … … 197 136 198 137 199 8. Diagnostic Messages138 7. Diagnostic Messages 200 139 ====================== 201 140 Factory has three types of diagnostic messages: … … 210 149 Since all diagnostic messages are implemented using preprocessor macros, 211 150 they will completely cease when disabled, thus avoiding any impact on 212 speed. For more information, see section "Configuring and building Factory 213 for different configurations" in the `INSTALL' file. By default, all 214 diagnostic messages are disabled. 151 speed. By default, all diagnostic messages are disabled. 215 152 216 153 Configure options: … … 220 157 --enable-debugoutput build Factory so it will print debugging information 221 158 222 223 224 9. GF(q) Tables 159 8. GF(q) Tables 225 160 =============== 226 227 NOTE: Since the format of the GF(q) tables changed from Factory Version228 1.2b to Factory Version 1.3a you should get/create them by new!229 161 230 162 Factory uses addition tables to calculate in GF(p^n) in an efficient way. 231 163 232 There are two possibilities to get these tables: 233 o get them from the net (`factory-gftables.tgz') where you got Factory 234 from. The files unpack into a directory `gftables/'. 235 o create them with `gengftables' which is a part of Factory. Building 236 the tables takes quite a while! 237 See the `INSTALL' file for more information. 164 They can be created with `make gengftables'. Building the tables takes quite 165 a while! 238 166 239 240 10. A Note on Singular 167 9. A Note on Singular 241 168 ===================== 242 169 If you have received this Factory distribution together with Singular you 243 170 do not have to worry about compilation or installation at all. The 244 installation procedure for Singular should do everything for you. If you 245 want to configure/build the package on your own instead of letting 246 Singular's `configure' do the work you should: 171 installation procedure for Singular should do everything for you. 247 172 248 ./configure --with-Singular --enable-gmp 249 (or, equivalently: ) 250 ./configure --with-Singular --with-gmp='${includedir}' 251 252 Furthermore, you should specify `--prefix' so `make install' will install 253 the files in the places where Singular looks for them. By default, this is 254 the top directory of the Singular distribution. In this case you have to 255 specify `--prefix=..'. 256 257 The Singular GF(q) tables are the same as the Factory GF(q) tables. 258 However, Singular uses a different naming scheme. Therefore, a Factory 259 configured with `--without-Singular' will not find Singular's GF(q) tables 260 as well as a Factory configured with `--with-Singular' will not find the 261 GF(q) tables created by gengftables. But this is not a major drawback 262 since Singular is distributed with ready-to-use GF(q) tables. 263 264 The latest version of Singular is always available at 265 www.mathematik.uni-kl.de:/pub/Math/Singular. 266 267 Configure options: 268 ------------------ 269 --with-Singular build for use with computer algebra system Singular. 270 271 Except from setting the `#define SINGULAR', this option only changes the 272 defaults to: `--with-memman=no --disable-streamio'. 273 274 275 276 11. Configure Options, Dependencies 277 =================================== 278 o do not configure `--with-Singular --with-memman'. In this case 279 both Singular and the library will try to initialize their own memory 280 management. 281 282 o do not configure `--disable-streamio --enable-debugoutput'. The 283 "DEBOUT macros" need stream IO. 284 285 o you may configure `--with-Singular --enable-streamio', but this 286 is not supported by Singular. You will have to change manually 287 Singular's `Makefile'. The same is true for `--with-Singular 288 --enable-streamio --enable-debugoutput'. 289 290 o you may configure `--with-Singular --enable-timing', but this 291 will not have any visible effect (except from a slightly slower 292 running time) because Singular will not print the timing 293 results. 294 295 o `--enable-gmp' has an effect only together with `--with-Singular' 296 297 o `--with-memdebug' has an effect only together with 298 `--with-memman=new' 299 300 301 12. Linking Factory With Your Application 302 ========================================= 303 To translate your application you need (apart from your 304 application, of course): 305 306 o the Factory user interface header file (`factory.h') 307 308 To link your application with Factory you need: 309 310 o the Factory library (`libcf.a') 311 o unless you configured Factory `--without-memman' you need one of the 312 Factory memory manager libraries (`libcfmem.a') 313 314 o the instantiated Factory templates (`ftmpl_inst.o'). 315 316 o unless you configured Factory `--without-streamio' you need the stream IO 317 libraries. With GNU CC, you do not need to care about this because they 318 are linked automatically to your application if you call the compiler 319 either as `g++' or as `c++'. Otherwise, you need to link with library 320 `libiostream.a'. 321 o The GNU Multiple Precision Library (`libgmp.a'). See section 322 "Prerequisites" in this file for more information. 323 o The standard mathematical library (`libm.a') 324 325 `factory.h', `libcf.a', and `libcfmem.a' are created when you build 326 Factory and installed by `make install'. `libiostream.a', `libgmp.a', and 327 `libm.a' should be already installed on your system, otherwise your 328 application will fail to link. `ftmpl_inst.o' is not installed by Factory. 329 Instead, its source file `ftmpl_inst.cc' is installed and you have to build 330 `ftmpl_inst.o' when you are building your application. For more 331 information on template instantiation and `ftmpl_inst.cc', see the 332 following section "Factory Template Instantiation". 333 334 To give an example, look at the following one-shot solution to the 335 problem "linking Factory with your application" where the "application" is 336 a small test program (`application.cc') from the subdirectory `examples/' 337 of the Factory source directory ('\' at the end of a line denotes line 338 continuation): 339 340 g++ -c /usr/local/include/templates/ftmpl_inst.cc -fno-implicit-templates -O2 -fomit-frame-pointer -o ftmpl_inst.o 341 g++ -c application.cc -fno-implicit-templates -O2 -fomit-frame-pointer ftmpl_inst.o -lcf -lcfmem -lm -lgmp 342 343 This should work fine provided that you installed Factory in a location 344 where `g++' may find it (here I have assumed `/usr/local/') and all the 345 other files mentioned above are installed properly and where `g++' looks 346 for them. 347 348 You may find a small `GNUmakefile' which translates `application.cc' and 349 other examples in the `examples/' subdirectory of the Factory source 350 directory. For more information, see the section "Examples and Tests". 351 352 353 13. Factory Template Instantiation 173 10. Factory Template Instantiation 354 174 ================================== 355 175 There are a couple of classes provided by Factory such as lists, arrays, … … 358 178 factorization (a list of factors), and you may use them to create new 359 179 derived abstract data types. These classes are realized using C++ 360 "templates", which you need to "instantiate" befor you use them (refer to 361 some introduction to C++ if you do not know these terms). 180 templates, which are instantiated in one single file namely ftmpl_inst.cc . 362 181 363 With GNU CC the most reliable way to instantiate templates is to 364 365 o explicitely instantiate all necessary templates, and compile with option 366 `-fno-implicit-templates' and to 367 o collect all explicit template instantiations in one single file. 368 369 This approach is the one Factory uses. All object files of the library 370 are generated with option `--fno-implicit-templates' and the explicit 371 template instantiations are collected in `ftmpl_inst.cc'. You could 372 translate this file using the `make' target `ftmpl_inst.o' (see section 373 "Building Factory" in the `INSTALL' file). 374 375 The consequence of this approach: since you may want to add template 376 instantiations of Factory's or your own templates after the installation of 377 Factory, it is necessary to install `ftmpl_inst.cc' as well as the template 378 source files together with the library. They are automatically installed 379 in `$(includedir)/templates/' when you type `make install'. 380 381 To join your own template instantiations with the ones from 382 `ftmpl_inst.cc' there are several possibilities: 383 384 o you copy `ftmpl_inst.cc' file from the directory where it was installed 385 into your working directory and add your template instantiations after 386 the corresponig comment at the end of the file; 387 o you cut the template instantiations from `ftmpl_inst.cc' and paste 388 them into your own template instantiation file. 389 390 Both methods suffer from one disadvantage: each time `ftmpl_inst.cc' 391 changes in a new version of Factory you will have to redo these steps. The 392 best method therefore is maybe this one: 393 394 o you write your own template instantiation file with a 395 `#include <templates/ftmpl_inst.cc>' statement at the beginning of it. 396 397 398 399 14. Documentation 182 11. Documentation 400 183 ================= 401 184 So far there are only preliminary versions of a user/reference manual and … … 407 190 408 191 409 1 5. Examples and Tests192 12. Examples and Tests 410 193 ====================== 411 194 The directory `examples/' in the Factory source directory contains some 412 example applications for Factory and a `GNUmakefile' to build them. The 413 main purpose of the examples is to show how to link applications with an 414 installed version of Factory. This means that you have to install Factory 415 before you can build the examples (but it is not necessary to install the 416 GF(q) tables). For the same reason, the `GNUmakefile' is not configured 417 automatically by `configure'. You will have to change some of the 418 variables manually. 195 example applications for Factory. 419 196 420 Furthermore, you may have a look at `gengftables.cc' in the Factory 421 source directory which is another application of the most basic Factory 422 features. 197 'make check' will run some simple test as well. 423 198 424 To test whether Factory (including GF(q) tables) has been installed425 properly, use `make' target `installtest'.426 427 428 16. Editing Factory429 ===================430 Parts of Factory are written using GNU Emacs' `folding-mode'. You may431 load this mode from Emacs with432 433 M-x load-file RET factory-<version>/bin/folding.el RET434 435 To switch it on, say `M-x folding-mode RET'. Alternatively, you may load436 `factory-<version>/bin/fold-docu.el' which contains some additional functions437 to fold only the documentation. If you add the following lines to your438 `.emacs' file, all this would be done automatically for you:439 440 (load-file "factory-<version>/bin/folding.el")441 (load-file "factory-<version>/bin/fold-docu.el")442 (add-hook 'c-mode-common-hook 'folding-mode)443 (setq fold-fold-on-startup nil444 fold-mode-marks-alist '((c++-mode "//{{{" "//}}}")))445 (set-default 'fold-internal-margins nil)446 447 For more information, see the respective files.448 449 450 451 17. Files in the Distribution452 =============================453 ChangeLog - history of changes454 INSTALL - installation instructions455 NEWS - new Factory features456 README - this file457 458 bin/install-sh - a script version of the BSD `install' program459 bin/makeheader - creates headers from header templates (`*.template')460 bin/mkinstalldirs - recursive `mkdir'461 bin/folding.el - Emacs `folding-mode'462 bin/fold-docu.el - some extensions to it463 464 GNUmakefile.in - master makefile and465 config.h.in - configuration include file. Run `configure' to create466 `GNUmakefile' and `config.h', resp.467 configure468 configure.in - `configure' script generated with Autoconf 2.10469 from `configure.in'470 471 factory.template472 factoryconf.template - header templates for the user interface header473 files. Run `makeheader' to create `factory.h' and474 `factoryconf.h', resp.475 476 ffops.cc477 ffops.h478 gf_tabutil.cc479 gf_tabutil.h480 gfops.cc481 gfops.h482 imm.h483 int_*.cc484 int_*.h - low level classes and functions485 486 canonicalform.cc487 canonicalform.h488 cf_*.cc489 cf_*.h490 variable.cc491 variable.h - high level classes and functions. User interface to492 the polynomial (and other) arithmetic.493 494 templates/ - Factory templates495 ftmpl_inst.cc - template instantiation for Factory templates496 497 fac_*.cc498 fac_*.h - high level algorithms (factorization, gcd, sqfr499 computation, etc.)500 sm_*.c501 sm_*.h - sparse modular gcd. Contributed by Marion Bruder502 <bruder@math.uni-sb.de>503 504 parseutil.cc505 parseutil.h506 readcf.cc507 readcf.y - Factory parser to read canonical forms. `readcf.cc'508 translated with Bison 1.18 from `readcf.y'.509 510 gmpext.h511 initgmp.cc - Factories interface to GNU MP512 singext.cc513 singext.h - Factories interface to Singular514 515 NTLconvert.* - some conversion routines for using NTL516 517 memutil.c518 memutil.h - "old" Factory memory manager519 memman.h520 mm*.c521 mm*.h - "new" Factory memory manager522 newdelete.cc - C++ interface to the memory managers523 524 cf_assert.h - the "ASSERT macros"525 debug.h526 debug.cc - the "DEBOUT macros"527 timing.h - the "TIMING macros"528 529 examples/ - some example applications for Factory and a `GNUmakefile'530 to build them531 gengftables.cc - run `gengftables' to create the GF(q) addition tables532 necessary to work with Factory533 test_install.cc - a small program to test whether installation has534 been successful. Built and called by `make' target535 `installtest'
Note: See TracChangeset
for help on using the changeset viewer.