make the default stack, heap and trail sizes configurable, and have the default show at the -? message

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@296 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
stasinos 2002-01-15 17:55:50 +00:00
parent b9b8b3d3be
commit 02b0f3be03
5 changed files with 407 additions and 256 deletions

View File

@ -94,6 +94,35 @@
/* Define the standard type of a float argument to a function */
#define FAFloat double /* manual */
/* Set the minimum and default heap, trail and stack size */
#undef MinTrailSpace
#undef MinStackSpace
#undef MinHeapSpace
#undef UsrTrailSpace
#undef UsrStackSpace
#undef UsrHeapSpace
#if (UsrTrailSpace > MinTrailSpace)
#define DefTrailSpace UsrTrailSpace
#else
#define DefTrailSpace MinTrailSpace
#endif
#if (UsrStackSpace > MinStackSpace)
#define DefStackSpace UsrStackSpace
#else
#define DefStackSpace MinStackSpace
#endif
#if (UsrHeapSpace > MinHeapSpace)
#define DefHeapSpace UsrHeapSpace
#else
#define DefHeapSpace MinHeapSpace
#endif
/* Define return type for signal */
#undef RETSIGTYPE

524
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,9 @@
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_PREREQ(2.13)
AC_INIT(console/yap.c)
AC_CONFIG_HEADER(config.h)
@ -13,35 +16,35 @@ AC_SUBST(C_INTERF_FLAGS)
AC_SUBST(C_PARSER_FLAGS)
AC_ARG_ENABLE(rational-trees,
[ --enable-rational-trees support infinite rational trees ],
[ --enable-rational-trees support infinite rational trees ],
rationaltrees="$enableval" ; rationaltrees=no)
AC_ARG_ENABLE(coroutining,
[ --enable-coroutining support co-routining, attributed variables and constraints],
[ --enable-coroutining support co-routining, attributed variables and constraints],
rationaltrees="$enableval";coroutining="$enableval", coroutining=no)
AC_ARG_ENABLE(wam-profile,
[ --enable-wam-profile support low level profiling of abstract machine ],
[ --enable-wam-profile support low level profiling of abstract machine ],
wamprofile="$enableval", wamprofile=no)
AC_ARG_ENABLE(depth-limit,
[ --enable-depth-limit support depth-bound computation ],
[ --enable-depth-limit support depth-bound computation ],
depthlimit="$enableval", depthlimit=no)
AC_ARG_ENABLE(or-parallelism,
[ --enable-or-parallelism support or-parallelism as: env-copy,sba,a-cow ],
[ --enable-or-parallelism support or-parallelism as: env-copy,sba,a-cow ],
orparallelism="$enableval", orparallelism=no)
AC_ARG_ENABLE(low-level-tracer,
[ --enable-low-level-tracer support support for procedure-call tracing ],
lowleveltracer="$enableval", lowleveltracer=no)
AC_ARG_ENABLE(tabling,
[ --enable-tabling support tabling as: batched,local ],
[ --enable-tabling support tabling as: batched,local ],
tabling="$enableval", tabling=no)
AC_ARG_ENABLE(max-performance,
[ --enable-max-performance try using the best flags for specific architecture ],
[ --enable-max-performance try using the best flags for specific architecture ],
maxperformance="$enableval", maxperformance=no)
AC_ARG_ENABLE(debug-yap,
[ --enable-debug-yap enable C-debugging for YAP ],
[ --enable-debug-yap enable C-debugging for YAP ],
debugyap="$enableval", debugyap=no)
AC_ARG_WITH(gmp,
[ --with-gmp[=DIR] use GNU Multiple Precision in DIR],
[ --with-gmp[=DIR] use GNU Multiple Precision in DIR],
if test $withval = yes; then
yap_cv_gmp=yes
elif test $withval = no; then
@ -54,7 +57,7 @@ AC_ARG_WITH(gmp,
[yap_cv_gmp=yes])
AC_ARG_WITH(readline,
[ --with-readline[=DIR] use GNU Readline Library in DIR],
[ --with-readline[=DIR] use GNU Readline Library in DIR],
if test $withval = yes; then
yap_cv_readline=yes
elif test $withval = no; then
@ -66,6 +69,54 @@ AC_ARG_WITH(readline,
fi,
[yap_cv_readline=yes])
AC_ARG_WITH(heap-space,
[ --with-heap-space[=space] default heap size in Kbytes],
if test $withval = yes; then
yap_cv_heap_space=0
elif test $withval = no; then
yap_cv_heap_space=0
else
yap_cv_heap_space=$withval
fi,
[yap_cv_heap_space=0])
AC_ARG_WITH(stack-space,
[ --with-stack-space[=space] default stack size in Kbytes],
if test $withval = yes; then
yap_cv_stack_space=0
elif test $withval = no; then
yap_cv_stack_space=0
else
yap_cv_stack_space=$withval
fi,
[yap_cv_stack_space=0])
AC_ARG_WITH(trail-space,
[ --with-trail-space[=space] default trail size in Kbytes],
if test $withval = yes; then
yap_cv_trail_space=0
elif test $withval = no; then
yap_cv_trail_space=0
else
yap_cv_trail_space=$withval
fi,
[yap_cv_trail_space=0])
if test $tabling = yes -o $orparallelism = yes
then
AC_DEFINE(MinHeapSpace, (300*SIZEOF_INT_P))
AC_DEFINE(MinStackSpace,(300*SIZEOF_INT_P))
AC_DEFINE(MinTrailSpace,( 48*SIZEOF_INT_P))
else
AC_DEFINE(MinHeapSpace, (200*SIZEOF_INT_P))
AC_DEFINE(MinStackSpace,(200*SIZEOF_INT_P))
AC_DEFINE(MinTrailSpace,( 32*SIZEOF_INT_P))
fi
eval "AC_DEFINE(UsrHeapSpace,($yap_cv_heap_space))"
eval "AC_DEFINE(UsrStackSpace,($yap_cv_stack_space))"
eval "AC_DEFINE(UsrTrailSpace,($yap_cv_trail_space))"
AC_CANONICAL_SYSTEM
AC_DEFINE_UNQUOTED(HOST_ALIAS,"${host_alias}")
@ -280,11 +331,12 @@ case $target_os in
*hpux*)
#do not use the first memory quadrant
AC_DEFINE(FORCE_SECOND_QUADRANT)
#this tells ld to export all non-static symbols,
#otherwise no external predicates.
M4="/usr/bin/m4"
SHLIB_INTERFACE="load_shl.o"
if test $CC = cc -o $CC = c89
then
#this tells ld to export all non-static symbols,
#otherwise no external predicates.
SHLIB_LD="ld -b -E ${LDFLAGS}"
DO_SECOND_LD=""
SHLIB_SUFFIX=".sl"

View File

@ -224,9 +224,9 @@ parse_yap_arguments(int argc, char *argv[], yap_init_args *init_args)
fprintf(stderr," -? Shows this screen\n");
fprintf(stderr," -b Boot file (%s)\n", StartUpFile);
fprintf(stderr," -l Prolog file\n");
fprintf(stderr," -h Heap area in Kbytes\n");
fprintf(stderr," -s Stack area in Kbytes\n");
fprintf(stderr," -t Trail area in Kbytes\n");
fprintf(stderr," -h Heap area in Kbytes (default: %d)\n", DefHeapSpace);
fprintf(stderr," -s Stack area in Kbytes (default: %d)\n", DefStackSpace);
fprintf(stderr," -t Trail area in Kbytes (default: %d)\n", DefTrailSpace);
fprintf(stderr," -w YapOr option: Number of workers (default: %d)\n", init_args->NumberWorkers);
fprintf(stderr," -sl YapOr option: Loop scheduler executions before look for hiden shared work (default: %d)\n", init_args->SchedulerLoop);
fprintf(stderr," -d YapOr option: Value of delayed release of load (default: %d)\n", init_args->DelayedReleaseLoad);

View File

@ -10,7 +10,7 @@
* File: Yap.h.m4 *
* mods: *
* comments: main header file for YAP *
* version: $Id: Yap.h.m4,v 1.16 2002-01-01 05:26:25 vsc Exp $ *
* version: $Id: Yap.h.m4,v 1.17 2002-01-15 17:55:50 stasinos Exp $ *
*************************************************************************/
#include "config.h"
@ -771,32 +771,6 @@ typedef enum {
extern prolog_exec_mode PrologMode;
extern int CritLocks;
#if SIZEOF_INT_P==4
#if defined(YAPOR) || defined(TABLING)
#define MinTrailSpace 192
#define MinStackSpace 1200
#define MinHeapSpace 1200
#else
#define MinTrailSpace 128
#define MinStackSpace 800
#define MinHeapSpace 800
#endif /* YAPOR || TABLING */
#else
#if defined(YAPOR) || defined(TABLING)
#define MinTrailSpace 384
#define MinStackSpace 2400
#define MinHeapSpace 2400
#else
#define MinTrailSpace 256
#define MinStackSpace 1600
#define MinHeapSpace 1600
#endif /* YAPOR || TABLING */
#endif
#define DefTrailSpace MinTrailSpace
#define DefStackSpace MinStackSpace
#define DefHeapSpace MinHeapSpace
/************** Access to yap initial arguments ***************************/
extern char **yap_args;