source: git/Singular/mod2.h.in @ 5c7562

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