source: git/Singular/mod2.h.in @ 996e19

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