source: git/kernel/mod2.h.in @ 585bbcb

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