source: git/Singular/mod2.h.in @ 1cb879

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