source: git/kernel/mod2.h.in @ 037df4

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