source: git/kernel/mod2.h.in @ 1c473f

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