source: git/Singular/mod2.h.in @ 814c11

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