source: git/kernel/mod2.h.in @ 07625cb

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