source: git/Singular/mod2.h.in @ aa0dc7

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