source: git/Singular/mod2.h.in @ 502ea2

spielwiese
Last change on this file since 502ea2 was bb0153, checked in by Mathias Schulze <mschulze@…>, 22 years ago
*mschulze: added HAVE_GMS git-svn-id: file:///usr/local/Singular/svn/trunk@5865 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 18.2 KB
Line 
1/* -*-c++-*- */
2/*******************************************************************
3 *  Computer Algebra System SINGULAR
4 *
5 *  mod2.h: Main configuration file for Singular
6 *          DO NOT EDIT!
7 *
8 *  Version: $Id: mod2.h.in,v 1.103 2002-02-12 18:25:40 mschulze Exp $
9 *******************************************************************/
10#ifndef MOD2_H
11#define MOD2_H
12
13/*******************************************************************
14 * Defines which are set by configure
15 ******************************************************************/
16/* Define to use dynamic linking */
17#undef HAVE_DL
18/* Define to use static readline lib for fancy display */
19#undef HAVE_READLINE
20/* define to use dynamic version of readline lib */
21#undef HAVE_DYN_RL
22/* Define to have dbm links */
23#undef HAVE_DBM
24/* Define to have smallgmp */
25#undef HAVE_SMALLGMP
26/* Define to have MP links */
27#undef HAVE_MPSR
28/* Define to have factory functionality added */
29#undef HAVE_FACTORY
30/* Define to have libfac functionality added */
31#undef HAVE_LIBFAC_P
32/* Define if you have stdc headers */
33#undef STDC_HEADERS
34/* Define if you have asm/sigcontext.h */
35#undef HAVE_ASM_SIGCONTEXT_H
36/* Define if you have sys/file.h */
37#undef HAVE_SYS_FILE_H
38/* Define if you have sys/stat.h */
39#undef HAVE_SYS_STAT_H
40/* Define if you have sys/param.h */
41#undef HAVE_SYS_PARAM_H
42/* Define if you have sys/file.h */
43#undef HAVE_SYS_TYPES_H
44/* Define if you have sys/ioctl.h */
45#undef HAVE_SYS_IOCTL_H
46/* Define if you have sys/time.h */
47#undef HAVE_SYS_TIME_H
48/* Define if you have sys/times.h */
49#undef HAVE_SYS_TIMES_H
50/* io header: */
51/* Define if you have termcap.h */
52#undef HAVE_TERMCAP_H
53/* Define if you have termios.h */
54#undef HAVE_TERMIOS_H
55/* Define if you have term.h */
56#undef HAVE_TERM_H
57/* Define if you have readline/history.h */
58#undef HAVE_READLINE_HISTORY_H
59/* Define if readline/readline.h is ok */
60#undef READLINE_READLINE_H_OK
61/* Define if time.h and sys/time.h can be included at the same time */
62#undef TIME_WITH_SYS_TIME
63/* Define if you have alloca.h */
64#undef HAVE_ALLOCA_H
65/* Define if you have pwd.h */
66#undef HAVE_PWD_H
67/* Define if you have unistd.h */
68#undef HAVE_UNISTD_H
69/* define if you have malloc.h */
70#undef HAVE_MALLOC_H
71/* define if you have pwd.h*/
72#undef HAVE_PWD_H
73/* Define if you have alloca */
74#undef HAVE_ALLOCA
75/* Define if you have getpagesize */
76#undef GETPAGESIZE
77/* Define if you have vprintf */
78#undef HAVE_VPRINTF
79/* Define if you have gettimeofday */
80#undef HAVE_GETTIMEOFDAY
81/* Define if you have atexit */
82#undef HAVE_ATEXIT
83/* Define if you have bcopy, bzero and bcmp
84   Linux needs that define! */
85#undef HAVE_BCOPY
86/* Define if sprintf does not return number of printed chars */
87#undef BSD_SPRINTF
88/* define if you have explicit C++ constructors */
89#undef HAVE_EXPLICIT_CONSTR
90/* Define if you have the getcwd function.  */
91#undef HAVE_GETCWD
92/* Define if you have the getwd function.  */
93#undef HAVE_GETWD
94/* Define if you have snprintf */
95#undef HAVE_VSNPRINTF
96/* Define if you have readlink */
97#undef HAVE_READLINK
98/* Define if you have usleep */
99#undef HAVE_USLEEP
100/* Define if you have sleep */
101#undef HAVE_SLEEP
102/* Define if you have setenv */
103#undef HAVE_SETENV
104/* Define if you have petpwnam */
105#undef HAVE_GETPWNAM
106/* Define if you have popen */
107#undef HAVE_POPEN
108/* Define sizeof(char) */
109#define SIZEOF_CHAR 1
110/* Define sizeof(short) */
111#define SIZEOF_SHORT 2
112/* Define sizeof(int) */
113#define SIZEOF_INT 4
114/* Define sizeof(long) */
115#define SIZEOF_LONG 4
116/* Define sizeof(void*) */
117#define SIZEOF_VOIDP 4
118/* Define sizeof(double) */
119#define SIZEOF_DOUBLE 8
120/* Define if your integer format is big endian */
121#undef WORDS_BIGENDIAN
122/* Define major version of Singular -- should be set in ../configure.in!!!*/
123#define SINGULAR_MAJOR_VERSION 0
124/* Define minor version of Singular -- should be set in ../configure.in!!! */
125#define SINGULAR_MINOR_VERSION 0
126/* Define sub version of Singular -- should be set in ../configure.in!!! */
127#define SINGULAR_SUB_VERSION 0
128/* Define version as a string */
129#define S_VERSION1 ""
130/* Define version date as a string */
131#define S_VERSION2 ""
132/* Define uname identifier as a string */
133#define S_UNAME ""
134/* Absolute pathname of root directory of Singular source */
135#define S_ROOT_DIR ""
136/* Define to use new namespaces techniks */
137#undef HAVE_NAMESPACES
138/* Define to enable dynamic module code */
139#undef HAVE_DYNAMIC_LOADING
140/* Define to enable plural */
141#undef HAVE_PLURAL
142
143/*******************************************************************
144 * Defines which are not set by configure
145 ******************************************************************/
146
147/* Default value for timer resolution in ticks per second */
148/* set to 10 for resolution of tenth of a second, etc */
149#define TIMER_RESOLUTION 1
150
151/* Undefine to disable the quote/eval of expressions */
152#define SIQ 1
153
154/* Define to enable TCL interface */
155#undef HAVE_TCL
156
157/* Undefine to disable Gerhard's and Wilfried's fast and dirty std computations */
158#define FAST_AND_DIRTY
159#ifdef __MWERKS__
160/* includes for Metrowerks */
161#include "mod2.mwerks.h"
162#else
163/* works around a quirk in gcc in the generation of parser tables */
164#define INIT_BUG
165#endif
166
167/* Gauss-Manin system */
168#define HAVE_GMS 1
169
170/* linear algebra extensions from pcv.h/pcv.cc */
171#define HAVE_PCV 1
172
173// procedures to compute with units
174#define HAVE_UNITS
175
176// eigenvalues of constant square matrices
177#define HAVE_EIGENVAL
178
179/* Define to use old mechanismen for saving currRing with procedures
180 * Does not work with HAVE_NAMESPACES enabled
181 */
182#undef USE_IILOCALRING
183
184
185/* Define to use scanner when loading libraries */
186#define HAVE_LIBPARSER
187
188/*#define PROFILING*/
189#ifdef PROFILING
190#define PROFILER ,0,0
191#else
192#define PROFILER
193#endif
194
195/* Define to use gmp for rational arithmetic */
196#define HAVE_GMP
197
198/*******************************************************************
199 * Evaluate the set defines
200 ******************************************************************/
201/* FGLM needs factory */
202#ifdef HAVE_FACTORY
203#define HAVE_FGLM
204#endif
205
206/* Define if you want fglm for homogeneous case */
207#ifdef HAVE_FGLM
208#undef HAVE_FGLM_HOME
209#endif
210
211/* Spectrum needs GMP */
212#ifdef HAVE_GMP
213#define HAVE_SPECTRUM 1
214#endif
215
216/* Undefine to disable real time measurments  */
217#ifdef HAVE_GETTIMEOFDAY
218#if ! defined(__MWERKS__) && ! defined(MSDOS)
219#define HAVE_RTIMER
220#else
221#undef HAVE_RTIMER
222#endif
223#endif
224
225#if SIZEOF_VOIDP == 8
226/* SIZEOF_LONG == SIZEOF_VOIDP is guaranteed by configure */
227#define ALIGN_8
228#define LOG_SIZEOF_LONG  3
229#define LOG_SIZEOF_VOIDP 3
230#else
231#define LOG_SIZEOF_LONG  2
232#define LOG_SIZEOF_VOIDP 2
233#endif
234
235#ifndef CHAR_BIT
236#define CHAR_BIT 8
237#endif
238
239#define BIT_SIZEOF_LONG CHAR_BIT*SIZEOF_LONG
240
241#define SINGULAR_VERSION (SINGULAR_MAJOR_VERSION*1000 + SINGULAR_MINOR_VERSION*100 + SINGULAR_SUB_VERSION)
242
243#if SIZEOF_EXPONENT == 1
244#define MAX_EXPONENT 0x7f
245#define MAX_COMPONENT 0xff
246#elif SIZEOF_EXPONENT == 2
247#define MAX_EXPONENT 0x7fff
248#define MAX_COMPONENT 0xffff
249#else /* SIZEOF_EXPONENT == 4 */
250#define MAX_EXPONENT 0x7fffffff
251#define MAX_COMPONENT 0xffffffff
252#endif
253
254/*******************************************************************
255 * Miscellanous Defines
256 ******************************************************************/
257/* Under HPUX 9, system(...) returns -1 if SIGCHLD does not equal
258   SIG_DFL. However, if it stays at SIG_DFL we get zombie processes
259   for terminated childs generated by fork. Therefors some special treatment
260   is necessary */
261#ifdef HPUX_9
262#include <stdlib.h>
263#define system hpux9_system
264#ifdef __cplusplus
265extern "C" {
266#endif
267int hpux9_system(const char* system);
268#ifdef __cplusplus
269}
270#endif
271#endif
272
273#ifndef HAVE_LIBPARSER
274#  undef YYLPDEBUG
275#else
276#  define YYLPDEBUG 1
277#endif
278
279#ifndef FALSE
280#define FALSE       0
281#endif
282
283#ifndef TRUE
284#define TRUE        1
285#endif
286
287#ifndef NULL
288#define NULL        (0)
289#endif
290
291#ifndef SEEK_END
292#define SEEK_END 2
293#endif
294
295#ifndef SEEK_SET
296#define SEEK_SET 0
297#endif
298
299#define HALT() m2_end(2)
300
301#define memcpy4 memcpy
302
303/* define OLD_RES for res/sres/mres(i,j,k) */
304#undef OLD_RES
305
306/* the maximal ascii length of an int number + 1 = 11 for 32 bit int */
307#define MAX_INT_LEN 11
308#define MAX_INT_VAL 0x7fffffff
309
310#ifdef DO_PROFILE
311/* define to enable explicit profiling of some crucial inline
312 * routines and defines  */
313#undef DO_DEEP_PROFILE
314#endif
315
316#define buildin_rand 1
317
318/* define to enable assume */
319#ifndef HAVE_ASSUME
320#undef HAVE_ASSUME
321#endif
322
323/* define LINKAGE to "extern C" if compiling for shared libs */
324#ifndef LINKAGE
325#if defined(PIC)
326#define LINKAGE extern "C"
327#else
328#define LINKAGE
329#endif
330#endif
331
332
333/*******************************************************************
334 * DEBUG OPTIONS
335 * -- only significant for for compiling without -DNDEBUG
336 * -- you better know what your are doing, if you touch this
337 ******************************************************************/
338#ifndef NDEBUG
339
340/* undefine to enable inline */
341#define NO_INLINE
342
343/* undefine to disable assume -- should normally be defined for NDEBUG */
344#define HAVE_ASSUME
345
346/* undef PDEBUG to disable checks of polys
347
348 define PDEBUG to
349  0 for enabling pTest
350  1 plus tests in Level 1 poly routines (operations on monomials)
351  2 plus tests in Level 2 poly routines (operations on single exponents)
352 -- see also polys.h for more info
353
354 NOTE: you can set the value of PDEBUG on a per-file basis, before
355       including mod2.h, provided ! PDEBUG is defined in mod2.h E.g.:
356
357       #define PDEBUG 2
358       #include "mod2.h"
359       ...
360
361       makes sure that all poly operations in your file are done with
362       PDEBUG == 2
363 To break after an error occured, set a debugger breakpoint on
364 dErrorBreak.
365*/
366#ifndef PDEBUG
367#define PDEBUG 0
368#endif
369
370/* define MDEBUG to enable memory checks */
371#define MDEBUG 0
372
373#ifdef MDEBUG
374/* If ! defined(OM_NDEBUG) and (defined(OM_TRACK) or defined(OM_CHECK)
375   then omDebug routines are used for memory allocation/free:
376
377   The omDebug routines are controlled by the values of OM_TRACK, OM_CHECK
378   and OM_KEEP.  There meaning is roughly as follows:
379   OM_TRACK: strored with address                              : extra space
380     0     : no additional info is stored                      : 0
381     1     : file:line of location where address was allocated : 1 word
382     2     : plus backtrace of stack where adress was allocated: 6 words
383     3     : plus size/bin info and front-, and back padding   : 9 words
384     4     : plus file:line of location where adress was freed : 10 words
385     5     : plus backtrace of stack where adress was allocated: 15 words
386   OM_CHECK: checks done
387     0     : no checks
388     1     : constant-time checks: i.e. addr checks only
389     2     : plus linear-time checks and constant related bin check
390     3     : plus quadratic-time checks and linear-time related bin checks and
391             constant time all memory checks
392     4     : and so on
393     ==> for OM_CHECK >= 3 it gets rather slow
394   OM_KEEP:  determines whether addresses are really freed  (
395     0     : addresses are really freed
396     1     : addresses are only marked as free and not really freed.
397
398   OM_CHECK, OM_TRACK, and OM_KEEP can be set on a per-file basis
399   (as can OM_NDEBUG),  e.g.:
400     #define OM_CHECK 3
401     #define OM_TRACK 5
402     #define OM_KEEP  1
403     #include "mod2.h"
404     #include "omalloc.h"
405   ensures that all memory allocs/free in this file are done with
406   OM_CHECK==3 and OM_TRACK==5, and that all addresses allocated/freed
407   in this file are only marked as free and never really freed.
408 
409   To set OM_CHECK, OM_TRACK and OM_KEEP under dynamic scope, set
410   om_Opts.MinCheck, om_Opts.MinTrack to the respectiv values and
411   om_Opts.Keep to the number of addresses which are kept before they are
412   actually freed. E.g.:
413     int check=om_Opts.MinCheck, track=om_Opts.MinTrack, keep= m_OPts.Keep;
414     om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
415     ExternalRoutine();
416     om_Opts.MinCheck = check; omOpts.MinTrack = track; omOpts.Keep = keep;
417   ensures that all calls omDebug routines  occuring during the computation of
418   ExternalRoutine() are done with OM_CHECK==3 and OM_TRACK==5, and
419   calls to omFree only mark addresses as free and not really free them.
420
421   Furthermore, the value of OM_SING_KEEP (resp. om_Opts.Keep) specifies
422   how many addresses are kept before they are actually freed, independently
423   of the value of OM_KEEP.
424
425   Some tips on possible values of OM_TRACK, OM_CHECK, OM_KEEP:
426   + To find out about an address that has been freed twice, first locate the
427     file(s) where the error occured, and then at the beginning of these files:
428       #define OM_CHECK 3
429       #define OM_TRACK 5
430       #define OM_KEEP  1
431       #include "mod2.h"
432       #include "omalloc.h"
433     Under dynamic scope, do (e.g., from within the debugger):
434       om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
435   + to find out where "memory corruption" occured, increase value of
436     OM_CHECK - the higher this value is, the more consistency checks are
437     done (However a value > 3 checks the entire memory each time an omalloc
438     routine is used!)
439   
440   Some more tips on the usage of omalloc:
441   + omAlloc*, omRealloc*, omFree*, omCheck* omDebug* omTest* rotuines
442     assume that sizes are > 0 and pointers are != NULL
443   + omalloc*, omrealloc*, omfree* omcheck*, omdebug* omtest* routines allow
444     NULL pointers and sizes == 0
445   + You can safely use any free/realloc routine in combination with any alloc
446     routine (including the debug versions): E.g., an address allocated with
447     omAllocBin can be freed with omfree, or an adress allocated with
448     om(Debug)Alloc can be freed with omfree, or omFree, or omFreeSize, etc.
449     However, keep in mind that the efficiency decreases from
450     Bin over Size to General routines (i.e., omFreeBin is more efficient than
451     omFreeSize which is more efficient than omFree, likewise with the alloc
452     routines).
453   + if OM_CHECK is undefined or 0, then all omCheck routines do nothing
454   + if OM_CHECK and OM_TRACK are both undefined (or 0), or if OM_NDEBUG is
455     defined, then the "real" alloc/realloc/free macros are used, and all
456     omTest, omDebug and omCheck routines are undefined
457   + to break after an omError occured within a debugger,
458     set a breakpoint on dErrorBreak
459   + to do checks from within the debugger, or to do checks with explicit
460     check level, use omTest routines.
461*/
462
463/* by default, store alloc info and file/line where addr was freed */
464#ifndef OM_TRACK
465#define OM_TRACK 4
466#endif
467/* only do constant-time memory checks */
468#ifndef OM_CHECK
469#define OM_CHECK 1
470#endif
471/* Do actually free memory:
472   (be careful: if this is set, memory is never really freed,
473    but only marked as free) */
474#ifndef OM_KEEP
475#define OM_KEEP 0
476#endif
477/* but only after you have freed 1000 more addresses
478   (this is actually independent of the value of OM_KEEP and used
479   to initialize om_Opts.Keep) */
480#ifndef OM_SING_KEEP
481#define OM_SING_KEEP 1000
482#endif
483
484#endif /* MDEBUG */
485
486
487/* undef KDEBUG for check of data during std computations
488 *
489 * define KDEBUG to
490 * 0 for basic tests
491 * 1 for tests in kSpoly
492 * NOTE: You can locally enable tests in kspoly by setting the
493 *       define at the beginning of kspoly.cc
494 */
495#define KDEBUG 0
496
497/* define LDEBUG checking numbers, undefine otherwise */
498#define LDEBUG
499/* define RDEBUG checking rings (together with TRACE=9) */
500#define RDEBUG
501/* define TEST for non time critical tests, undefine otherwise */
502#define TEST
503
504/* #define PAGE_TEST */
505
506/* define YYDEBUG 1 for debugging bison texts, 0 otherwise */
507#define YYDEBUG 1
508
509/* Undefine to disable debugging of MP stuff */
510#ifdef HAVE_MPSR
511#define MPSR_DEBUG
512#endif
513
514
515#ifdef TEST
516#ifndef buildin_rand
517#define buildin_rand 1
518#endif
519#endif
520
521/* define SPECTRUM_DEBUG and SPECTRUM_PRINT for debugging the spectrum code */
522/* define SPECTRUM_IOSTREAM to use C++ iostream for error messages          */
523
524/* #define SPECTRUM_DEBUG */
525/* #define SPECTRUM_PRINT */
526#undef  SPECTRUM_IOSTREAM
527
528#ifdef  SPECTRUM_DEBUG
529#define MULTICNT_DEBUG
530#define GMPRAT_DEBUG
531#define KMATRIX_DEBUG
532#define SPLIST_DEBUG
533#define NPOLYGON_DEBUG
534#define SEMIC_DEBUG
535#endif
536
537#ifdef  SPECTRUM_PRINT
538#define MULTICNT_PRINT
539#define GMPRAT_PRINT
540#define KMATRIX_PRINT
541#define SPLIST_PRINT
542#define NPOLYGON_PRINT
543#define SEMIC_PRINT
544#endif
545
546#ifdef  SPECTRUM_IOSTREAM
547#define MULTICNT_IOSTREAM
548#define GMPRAT_IOSTREAM
549#define KMATRIX_IOSTREAM
550#define SPLIST_IOSTREAM
551#define NPOLYGON_IOSTREAM
552#define SEMIC_IOSTREAM
553#endif
554
555
556#else /* not NDEBUG **************************************************** */
557
558#define NO_PDEBUG
559
560/* define YYDEBUG 1 for debugging bison texts, 0 otherwise */
561#define YYDEBUG 0
562
563#endif /* not NDEBUG */
564
565#ifdef HAVE_NAMESPACES
566#  undef USE_IILOCALRING
567#endif
568
569/*******************************************************************
570 *
571 * assume(x) -- a handy macro for assumptions
572 *
573 ******************************************************************/
574
575#ifdef __cplusplus
576extern "C" {
577#endif
578// routine which is used to report the error
579// returns 0
580extern int dReportError(const char* fmt, ...);
581// within a debugger, set a breakpoint on dErrorBreak
582// which is called after the error has been reported
583extern void dErrorBreak();
584#ifdef __cplusplus
585}
586#endif
587
588#ifndef HAVE_ASSUME
589#define assume(x) ((void) 0)
590#define r_assume(x) ((void) 0)
591#else /* ! HAVE_ASSUME */
592
593#define assume_violation(s,f,l) \
594  dReportError("assume violation at %s:%d condition: %s", f,l,s)
595
596#define assume(x)   _assume(x, __FILE__, __LINE__)
597#define r_assume(x) _r_assume(x, __FILE__, __LINE__)
598
599#define _assume(x, f, l)                        \
600do                                              \
601{                                               \
602  if (! (x))                                    \
603  {                                             \
604    assume_violation(#x, f, l);                 \
605  }                                             \
606}                                               \
607while (0)
608
609#define _r_assume(x, f, l)                      \
610do                                              \
611{                                               \
612  if (! (x))                                    \
613  {                                             \
614    assume_violation(#x, f, l);                 \
615    return 0;                                   \
616  }                                             \
617}                                               \
618while (0)
619#endif /* HAVE_ASSUME */
620
621/* do have RDEBUG, unless we are doing the very real thing */
622#ifdef HAVE_ASSUME
623#ifndef RDEBUG
624#define RDEBUG
625#endif
626#endif
627
628#endif /* MOD2_H  */
Note: See TracBrowser for help on using the repository browser.