source: git/Singular/mod2.h.in @ 50cbdc

spielwiese
Last change on this file since 50cbdc was 50cbdc, checked in by Hans Schönemann <hannes@…>, 23 years ago
*hannes: merge-2-0-2 git-svn-id: file:///usr/local/Singular/svn/trunk@5619 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.101 2001-08-27 14:47:11 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 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/* linear algebra extensions from pcv.h/pcv.cc */
168#define HAVE_PCV 1
169
170// procedures to compute with units
171#define HAVE_UNITS
172
173// eigenvalues of constant square matrices
174#define HAVE_EIGENVAL
175
176/* Define to use old mechanismen for saving currRing with procedures
177 * Does not work with HAVE_NAMESPACES enabled
178 */
179#undef USE_IILOCALRING
180
181
182/* Define to use scanner when loading libraries */
183#define HAVE_LIBPARSER
184
185/*#define PROFILING*/
186#ifdef PROFILING
187#define PROFILER ,0,0
188#else
189#define PROFILER
190#endif
191
192/* Define to use gmp for rational arithmetic */
193#define HAVE_GMP
194
195/*******************************************************************
196 * Evaluate the set defines
197 ******************************************************************/
198/* FGLM needs factory */
199#ifdef HAVE_FACTORY
200#define HAVE_FGLM
201#endif
202
203/* Define if you want fglm for homogeneous case */
204#ifdef HAVE_FGLM
205#undef HAVE_FGLM_HOME
206#endif
207
208/* Spectrum needs GMP */
209#ifdef HAVE_GMP
210#define HAVE_SPECTRUM 1
211#endif
212
213/* Undefine to disable real time measurments  */
214#ifdef HAVE_GETTIMEOFDAY
215#if ! defined(__MWERKS__) && ! defined(MSDOS)
216#define HAVE_RTIMER
217#else
218#undef HAVE_RTIMER
219#endif
220#endif
221
222#if SIZEOF_VOIDP == 8
223/* SIZEOF_LONG == SIZEOF_VOIDP is guaranteed by configure */
224#define ALIGN_8
225#define LOG_SIZEOF_LONG  3
226#define LOG_SIZEOF_VOIDP 3
227#else
228#define LOG_SIZEOF_LONG  2
229#define LOG_SIZEOF_VOIDP 2
230#endif
231
232#ifndef CHAR_BIT
233#define CHAR_BIT 8
234#endif
235
236#define BIT_SIZEOF_LONG CHAR_BIT*SIZEOF_LONG
237
238#define SINGULAR_VERSION (SINGULAR_MAJOR_VERSION*1000 + SINGULAR_MINOR_VERSION*100 + SINGULAR_SUB_VERSION)
239
240#if SIZEOF_EXPONENT == 1
241#define MAX_EXPONENT 0x7f
242#define MAX_COMPONENT 0xff
243#elif SIZEOF_EXPONENT == 2
244#define MAX_EXPONENT 0x7fff
245#define MAX_COMPONENT 0xffff
246#else /* SIZEOF_EXPONENT == 4 */
247#define MAX_EXPONENT 0x7fffffff
248#define MAX_COMPONENT 0xffffffff
249#endif
250
251/*******************************************************************
252 * Miscellanous Defines
253 ******************************************************************/
254/* Under HPUX 9, system(...) returns -1 if SIGCHLD does not equal
255   SIG_DFL. However, if it stays at SIG_DFL we get zombie processes
256   for terminated childs generated by fork. Therefors some special treatment
257   is necessary */
258#ifdef HPUX_9
259#include <stdlib.h>
260#define system hpux9_system
261#ifdef __cplusplus
262extern "C" {
263#endif
264int hpux9_system(const char* system);
265#ifdef __cplusplus
266}
267#endif
268#endif
269
270#ifndef HAVE_LIBPARSER
271#  undef YYLPDEBUG
272#else
273#  define YYLPDEBUG 1
274#endif
275
276#ifndef FALSE
277#define FALSE       0
278#endif
279
280#ifndef TRUE
281#define TRUE        1
282#endif
283
284#ifndef NULL
285#define NULL        (0)
286#endif
287
288#ifndef SEEK_END
289#define SEEK_END 2
290#endif
291
292#ifndef SEEK_SET
293#define SEEK_SET 0
294#endif
295
296#define HALT() m2_end(2)
297
298#define memcpy4 memcpy
299
300/* define OLD_RES for res/sres/mres(i,j,k) */
301#undef OLD_RES
302
303/* the maximal ascii length of an int number + 1 = 11 for 32 bit int */
304#define MAX_INT_LEN 11
305#define MAX_INT_VAL 0x7fffffff
306
307#ifdef DO_PROFILE
308/* define to enable explicit profiling of some crucial inline
309 * routines and defines  */
310#undef DO_DEEP_PROFILE
311#endif
312
313#define buildin_rand 1
314
315/* define to enable assume */
316#ifndef HAVE_ASSUME
317#undef HAVE_ASSUME
318#endif
319
320/* define LINKAGE to "extern C" if compiling for shared libs */
321#ifndef LINKAGE
322#if defined(PIC)
323#define LINKAGE extern "C"
324#else
325#define LINKAGE
326#endif
327#endif
328
329
330/*******************************************************************
331 * DEBUG OPTIONS
332 * -- only significant for for compiling without -DNDEBUG
333 * -- you better know what your are doing, if you touch this
334 ******************************************************************/
335#ifndef NDEBUG
336
337/* undefine to enable inline */
338#define NO_INLINE
339
340/* undefine to disable assume -- should normally be defined for NDEBUG */
341#define HAVE_ASSUME
342
343/* undef PDEBUG to disable checks of polys
344
345 define PDEBUG to
346  0 for enabling pTest
347  1 plus tests in Level 1 poly routines (operations on monomials)
348  2 plus tests in Level 2 poly routines (operations on single exponents)
349 -- see also polys.h for more info
350
351 NOTE: you can set the value of PDEBUG on a per-file basis, before
352       including mod2.h, provided ! PDEBUG is defined in mod2.h E.g.:
353
354       #define PDEBUG 2
355       #include "mod2.h"
356       ...
357
358       makes sure that all poly operations in your file are done with
359       PDEBUG == 2
360 To break after an error occured, set a debugger breakpoint on
361 dErrorBreak.
362*/
363#ifndef PDEBUG
364#define PDEBUG 0
365#endif
366
367/* define MDEBUG to enable memory checks */
368#define MDEBUG 0
369
370#ifdef MDEBUG
371/* If ! defined(OM_NDEBUG) and (defined(OM_TRACK) or defined(OM_CHECK)
372   then omDebug routines are used for memory allocation/free:
373
374   The omDebug routines are controlled by the values of OM_TRACK, OM_CHECK
375   and OM_KEEP.  There meaning is roughly as follows:
376   OM_TRACK: strored with address                              : extra space
377     0     : no additional info is stored                      : 0
378     1     : file:line of location where address was allocated : 1 word
379     2     : plus backtrace of stack where adress was allocated: 6 words
380     3     : plus size/bin info and front-, and back padding   : 9 words
381     4     : plus file:line of location where adress was freed : 10 words
382     5     : plus backtrace of stack where adress was allocated: 15 words
383   OM_CHECK: checks done
384     0     : no checks
385     1     : constant-time checks: i.e. addr checks only
386     2     : plus linear-time checks and constant related bin check
387     3     : plus quadratic-time checks and linear-time related bin checks and
388             constant time all memory checks
389     4     : and so on
390     ==> for OM_CHECK >= 3 it gets rather slow
391   OM_KEEP:  determines whether addresses are really freed  (
392     0     : addresses are really freed
393     1     : addresses are only marked as free and not really freed.
394
395   OM_CHECK, OM_TRACK, and OM_KEEP can be set on a per-file basis
396   (as can OM_NDEBUG),  e.g.:
397     #define OM_CHECK 3
398     #define OM_TRACK 5
399     #define OM_KEEP  1
400     #include "mod2.h"
401     #include "omalloc.h"
402   ensures that all memory allocs/free in this file are done with
403   OM_CHECK==3 and OM_TRACK==5, and that all addresses allocated/freed
404   in this file are only marked as free and never really freed.
405 
406   To set OM_CHECK, OM_TRACK and OM_KEEP under dynamic scope, set
407   om_Opts.MinCheck, om_Opts.MinTrack to the respectiv values and
408   om_Opts.Keep to the number of addresses which are kept before they are
409   actually freed. E.g.:
410     int check=om_Opts.MinCheck, track=om_Opts.MinTrack, keep= m_OPts.Keep;
411     om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
412     ExternalRoutine();
413     om_Opts.MinCheck = check; omOpts.MinTrack = track; omOpts.Keep = keep;
414   ensures that all calls omDebug routines  occuring during the computation of
415   ExternalRoutine() are done with OM_CHECK==3 and OM_TRACK==5, and
416   calls to omFree only mark addresses as free and not really free them.
417
418   Furthermore, the value of OM_SING_KEEP (resp. om_Opts.Keep) specifies
419   how many addresses are kept before they are actually freed, independently
420   of the value of OM_KEEP.
421
422   Some tips on possible values of OM_TRACK, OM_CHECK, OM_KEEP:
423   + To find out about an address that has been freed twice, first locate the
424     file(s) where the error occured, and then at the beginning of these files:
425       #define OM_CHECK 3
426       #define OM_TRACK 5
427       #define OM_KEEP  1
428       #include "mod2.h"
429       #include "omalloc.h"
430     Under dynamic scope, do (e.g., from within the debugger):
431       om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
432   + to find out where "memory corruption" occured, increase value of
433     OM_CHECK - the higher this value is, the more consistency checks are
434     done (However a value > 3 checks the entire memory each time an omalloc
435     routine is used!)
436   
437   Some more tips on the usage of omalloc:
438   + omAlloc*, omRealloc*, omFree*, omCheck* omDebug* omTest* rotuines
439     assume that sizes are > 0 and pointers are != NULL
440   + omalloc*, omrealloc*, omfree* omcheck*, omdebug* omtest* routines allow
441     NULL pointers and sizes == 0
442   + You can safely use any free/realloc routine in combination with any alloc
443     routine (including the debug versions): E.g., an address allocated with
444     omAllocBin can be freed with omfree, or an adress allocated with
445     om(Debug)Alloc can be freed with omfree, or omFree, or omFreeSize, etc.
446     However, keep in mind that the efficiency decreases from
447     Bin over Size to General routines (i.e., omFreeBin is more efficient than
448     omFreeSize which is more efficient than omFree, likewise with the alloc
449     routines).
450   + if OM_CHECK is undefined or 0, then all omCheck routines do nothing
451   + if OM_CHECK and OM_TRACK are both undefined (or 0), or if OM_NDEBUG is
452     defined, then the "real" alloc/realloc/free macros are used, and all
453     omTest, omDebug and omCheck routines are undefined
454   + to break after an omError occured within a debugger,
455     set a breakpoint on dErrorBreak
456   + to do checks from within the debugger, or to do checks with explicit
457     check level, use omTest routines.
458*/
459
460/* by default, store alloc info and file/line where addr was freed */
461#ifndef OM_TRACK
462#define OM_TRACK 4
463#endif
464/* only do constant-time memory checks */
465#ifndef OM_CHECK
466#define OM_CHECK 1
467#endif
468/* Do actually free memory:
469   (be careful: if this is set, memory is never really freed,
470    but only marked as free) */
471#ifndef OM_KEEP
472#define OM_KEEP 0
473#endif
474/* but only after you have freed 1000 more addresses
475   (this is actually independent of the value of OM_KEEP and used
476   to initialize om_Opts.Keep) */
477#ifndef OM_SING_KEEP
478#define OM_SING_KEEP 1000
479#endif
480
481#endif /* MDEBUG */
482
483
484/* undef KDEBUG for check of data during std computations
485 *
486 * define KDEBUG to
487 * 0 for basic tests
488 * 1 for tests in kSpoly
489 * NOTE: You can locally enable tests in kspoly by setting the
490 *       define at the beginning of kspoly.cc
491 */
492#define KDEBUG 0
493
494/* define LDEBUG checking numbers, undefine otherwise */
495#define LDEBUG
496/* define RDEBUG checking rings (together with TRACE=9) */
497#define RDEBUG
498/* define TEST for non time critical tests, undefine otherwise */
499#define TEST
500
501/* #define PAGE_TEST */
502
503/* define YYDEBUG 1 for debugging bison texts, 0 otherwise */
504#define YYDEBUG 1
505
506/* Undefine to disable debugging of MP stuff */
507#ifdef HAVE_MPSR
508#define MPSR_DEBUG
509#endif
510
511
512#ifdef TEST
513#ifndef buildin_rand
514#define buildin_rand 1
515#endif
516#endif
517
518/* define SPECTRUM_DEBUG and SPECTRUM_PRINT for debugging the spectrum code */
519/* define SPECTRUM_IOSTREAM to use C++ iostream for error messages          */
520
521/* #define SPECTRUM_DEBUG */
522/* #define SPECTRUM_PRINT */
523#undef  SPECTRUM_IOSTREAM
524
525#ifdef  SPECTRUM_DEBUG
526#define MULTICNT_DEBUG
527#define GMPRAT_DEBUG
528#define KMATRIX_DEBUG
529#define SPLIST_DEBUG
530#define NPOLYGON_DEBUG
531#define SEMIC_DEBUG
532#endif
533
534#ifdef  SPECTRUM_PRINT
535#define MULTICNT_PRINT
536#define GMPRAT_PRINT
537#define KMATRIX_PRINT
538#define SPLIST_PRINT
539#define NPOLYGON_PRINT
540#define SEMIC_PRINT
541#endif
542
543#ifdef  SPECTRUM_IOSTREAM
544#define MULTICNT_IOSTREAM
545#define GMPRAT_IOSTREAM
546#define KMATRIX_IOSTREAM
547#define SPLIST_IOSTREAM
548#define NPOLYGON_IOSTREAM
549#define SEMIC_IOSTREAM
550#endif
551
552
553#else /* not NDEBUG **************************************************** */
554
555#define NO_PDEBUG
556
557/* define YYDEBUG 1 for debugging bison texts, 0 otherwise */
558#define YYDEBUG 0
559
560#endif /* not NDEBUG */
561
562#ifdef HAVE_DYNAMIC_LOADING
563#   define HAVE_NAMESPACES 1
564#endif /* HAVE_DYNAMIC_LOADING */
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.