source: git/Singular/mod2.h.in @ 9d72fe

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