source: git/Singular/mod2.h.in @ 10c41f

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