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

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