source: git/Singular/mod2.h.in @ 23f2f57

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