diff -urN palp-2.12.orig/Coord.c palp-2.12/Coord.c --- palp-2.12.orig/Coord.c 2020-08-12 14:27:56.000000000 +0200 +++ palp-2.12/Coord.c 2020-08-26 12:13:49.000000000 +0200 @@ -110,13 +110,15 @@ if (codim > 1){ printf("Please increase POLY_Dmax to at least %d = %d + %d - 1\n", (polyDim + codim - 1), polyDim, codim); - puts("(nef.x requires POLY_Dmax >= dim N + codim - 1)");} + printf("(%snef%s requires POLY_Dmax >= dim N + codim - 1)\n", + PALP_Prefix, PALP_Suffix);} else printf("Please increase POLY_Dmax to at least %d\n", polyDim); exit(0); }} else if (POLY_Dmax < polyDim +1){ printf("Please increase POLY_Dmax to at least %d = %d + 1\n", (polyDim + 1), polyDim); - puts("(nef.x -G requires POLY_Dmax >= dim(cone) = dim(support) + 1)"); + printf("(%snef%s -G requires POLY_Dmax >= dim(cone) = dim(support) + 1)\n", + PALP_Prefix, PALP_Suffix); exit(0);} } @@ -205,7 +207,8 @@ { Long sum = _CW->d[i] * index, *w = _CW->W[i]; for(j=0;j<_CW->N;j++) { assert(w[j]>=0); sum-=w[j]; } if((sum)&&(index==1)){ - printf("Use poly.x -l for (single) WeightSystems with "); + printf("Use %spoly%s -l for (single) WeightSystems with ", + PALP_Prefix, PALP_Suffix); printf("d!=\\sum(w)\n(only Read_Weight makes the correct "); puts("PolyPointList in that case)"); exit(0);} } @@ -325,10 +328,13 @@ MAP: for(i=0;i<_CW->nw;i++) /* check consistency of CWS */ { Long sum=_CW->d[i], *w=_CW->W[i]; for(j=0;j<_CW->N;j++) { assert(w[j]>=0); sum-=w[j]; } - if(sum){ printf("Use poly.x -w for (single) WeightSystems with "); - printf("d!=\\sum(w)\n(only Read_Weight makes the correct "); - puts("PolyPointList in that case)"); exit(0);} - } + if(sum){ /*printf("Use poly.x -w for (single) WeightSystems with "); + printf("d!=\\sum(w)\n(only Read_Weight makes the correct "); + puts("PolyPointList in that case)"); exit(0);*/ + printf("%smori%s cannot handle (single) WeightSystems with ", + PALP_Prefix, PALP_Suffix); + printf("d!=\\sum(w)\n"); + exit(0);}} _CW->nz=0; if(!Read_CWS_Zinfo(inFILE,_CW)) /* read Z to EOL */ { if(!InputOK) puts("-h gives you help\n"); return 0;} diff -urN palp-2.12.orig/E_Poly.c palp-2.12/E_Poly.c --- palp-2.12.orig/E_Poly.c 2020-08-06 15:46:26.000000000 +0200 +++ palp-2.12/E_Poly.c 2020-08-26 12:20:37.000000000 +0200 @@ -1419,7 +1419,8 @@ if (POLY_Dmax < _P->n + 1){/* only relevant if index == 1 */ printf("Please increase POLY_Dmax to at least %d = %d + 1\n", (_P->n + 1), _P->n); - puts("(nef.x -G requires POLY_Dmax >= dim(cone) = dim(support) + 1)"); + printf("(%snef%s -G requires POLY_Dmax >= dim(cone) = dim(support) + 1)\n", + PALP_Prefix, PALP_Suffix); assert(*_codim == 1); exit(0);} /* Print_PPL(_P, "_P before sorting");fflush(0); */ diff -urN palp-2.12.orig/GNUmakefile palp-2.12/GNUmakefile --- palp-2.12.orig/GNUmakefile 2020-05-21 11:54:07.000000000 +0200 +++ palp-2.12/GNUmakefile 2020-08-26 15:01:02.000000000 +0200 @@ -2,6 +2,28 @@ # main programs: class.c cws.c poly.c nef.c mori.c +ifndef NO_PALP_PREFIX +NO_PALP_PREFIX=1 +endif + +ifndef NO_SUFFIX_X +NO_SUFFIX_X=0 +endif + +ifeq ($(NO_PALP_PREFIX),0) +PREFIX= palp_ +CPPFLAGS += -DNO_PALP_PREFIX=0 +else +PREFIX= +endif + +ifeq ($(NO_SUFFIX_X),0) +SUFFIX= .x +else +SUFFIX= +CPPFLAGS += -DNO_SUFFIX_X=1 +endif + SOURCES= Coord.c Rat.c Vertex.c Polynf.c OBJECTS= $(SOURCES:.c=.o) @@ -32,23 +54,28 @@ clean: ; rm -f *.o -cleanall: ; rm -f *.o *.x core +cleanall: ; rm -f *.o *.x palp_* core poly: poly.o $(OBJECTS) LG.o Global.h LG.h - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o poly.x poly.o $(OBJECTS) LG.o + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(PREFIX)poly$(SUFFIX) \ + poly.o $(OBJECTS) LG.o class: class.o $(OBJECTS) $(CLASS_OBJ) Global.h Subpoly.h - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o class.x class.o $(OBJECTS) $(CLASS_OBJ) + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(PREFIX)class$(SUFFIX) \ + class.o $(OBJECTS) $(CLASS_OBJ) cws: cws.o $(OBJECTS) LG.o Global.h LG.h - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o cws.x cws.o $(OBJECTS) LG.o + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(PREFIX)cws$(SUFFIX) \ + cws.o $(OBJECTS) LG.o nef: nef.o $(OBJECTS) $(NEF_OBJ) Global.h - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o nef.x nef.o $(OBJECTS) $(NEF_OBJ) + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(PREFIX)nef$(SUFFIX) \ + nef.o $(OBJECTS) $(NEF_OBJ) mori: mori.o $(OBJECTS) $(MORI_OBJ) LG.o Mori.h - $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o mori.x mori.o $(OBJECTS) $(MORI_OBJ) LG.o + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(PREFIX)mori$(SUFFIX) \ + mori.o $(OBJECTS) $(MORI_OBJ) LG.o @@ -74,21 +101,3 @@ cws.o: Global.h LG.h Rat.h nef.o: Global.h Nef.h LG.h mori.o: Global.h LG.h Mori.h - - - -# experimental stuff ... -# -#bpoly: bpoly.o Global.h $(OBJECTS) -# $(CC) $(CFLAGS) -o bpoly.x bpoly.o $(OBJECTS) - -#bpoly.o: bpoly.c Global.h - -#vnl: vnl.o $(OBJECTS) Global.h -# $(CC) $(CFLAGS) -o vnl.x vnl.o $(OBJECTS) - -#vnl.o: vnl.c Global.h - -#gen: gen.o $(OBJECTS) $(NEF_OBJ) Global.h -# $(CC) $(CFLAGS) -o gen.x gen.o $(OBJECTS) $(NEF_OBJ) -#gen.o: gen.c diff -urN palp-2.12.orig/Global.h palp-2.12/Global.h --- palp-2.12.orig/Global.h 2020-08-12 14:50:35.000000000 +0200 +++ palp-2.12/Global.h 2020-08-26 15:06:46.000000000 +0200 @@ -7,6 +7,17 @@ These are include files that should exist in your C library. */ +/* Prefix and suffix for names of executables: */ +#ifndef NO_PALP_PREFIX +#define NO_PALP_PREFIX 1 /* default: no prefix of "_palp" */ +#endif +#ifndef NO_SUFFIX_X +#define NO_SUFFIX_X 0 /* default: suffix ".x" */ +#endif +#define PALP_Prefix ( NO_PALP_PREFIX ? "" : "palp_" ) +#define PALP_Suffix ( NO_SUFFIX_X ? "" : ".x" ) + + /* ============ basic choice of PARAMETERS ============ */ #define Long long diff -urN palp-2.12.orig/MoriCone.c palp-2.12/MoriCone.c --- palp-2.12.orig/MoriCone.c 2020-08-18 15:41:33.000000000 +0200 +++ palp-2.12/MoriCone.c 2020-08-26 11:46:38.000000000 +0200 @@ -1184,7 +1184,9 @@ return; } else if((P->n!=4)||(p>v+3)) { - puts("P* requires triangulation. `mori.x' can triangulate only 4-polytopes"); + printf("P* requires triangulation. `%smori%s' can ", + PALP_Prefix, PALP_Suffix); + puts("triangulate only 4-polytopes"); puts("with up to 3 points that are neither vertices nor interior to P* or"); puts("a facet. Use option `-M' for providing a triangulation as input."); exit(1);} diff -urN palp-2.12.orig/Polynf.c palp-2.12/Polynf.c --- palp-2.12.orig/Polynf.c 2020-08-06 15:13:24.000000000 +0200 +++ palp-2.12/Polynf.c 2020-08-26 11:40:35.000000000 +0200 @@ -1046,7 +1046,8 @@ { Long *Z=P->x[0],*N[4*VERT_Nmax]; int i,j,n=0; assert(P->n==4); for(i=0;inv;i++){ if (V->v[i] >= V->nv) - puts("Please do not use weight input with 'poly.x -C2'!"); + printf("Please do not use weight input with '%spoly%s -C2'!\n", + PALP_Prefix, PALP_Suffix); assert(V->v[i]nv);} for(i=V->nv;inp;i++){Long *X=P->x[i]; if((X[0]-Z[0])%2==0) if((X[1]-Z[1])%2==0)if((X[2]-Z[2])%2==0)if((X[3]-Z[3])%2==0) N[n++]=X;} @@ -1200,7 +1201,8 @@ h12=1+ndpt-rk-py, /* 1 + doublePts - rk - facetIP(\D')=pyramid */ vol=LatVol_Barycent(P,V,xB,&xN); if (0!=vol%16) - puts ("poly.x -C2 requires polytopes divisible by 2 as input!"); + printf("%spoly%s -C2 requires polytopes divisible by 2 as input!\n", + PALP_Prefix, PALP_Suffix); assert(0==vol%16);vol/=16; /* degree */ if((PIC==0)||(PIC==pic)) /* restrict output to PIC=pic */ { printf("pic=%d deg=%2d h12=%2d rk=%d #sq=%d ",pic,vol,h12,rk,nsq); @@ -1253,7 +1255,8 @@ Sort_VL(V); for(i=0;inv;i++){ if (V->v[i] >= V->nv) - puts("Please do not use weight input with 'poly.x -E'!"); + printf("Please do not use weight input with '%spoly%s -E'!\n", + PALP_Prefix, PALP_Suffix); assert(V->v[i]nv);} if(NR) for(i=0;ine;i++) d[i]=E->e[i].c; LatVol_Barycent(P,V,C,&N);bcz=(N==0);if(bcz)bary++;/*BaryCenterZero*/ diff -urN palp-2.12.orig/Subadd.c palp-2.12/Subadd.c --- palp-2.12.orig/Subadd.c 2020-08-06 14:35:01.000000000 +0200 +++ palp-2.12/Subadd.c 2020-08-26 11:57:36.000000000 +0200 @@ -1381,7 +1381,7 @@ VertexNumList V; EqList F; assert(_NFL!=NULL); if(!(*polyo)) { puts("You have to specify an output file via -po in -a-mode!\n"); - puts("For more help type `class.x -h'\n"); + printf("For more help type `%sclass%s -h'\n", PALP_Prefix, PALP_Suffix); exit(0);} _NFL->of=0; _NFL->rf=0; _NFL->iname=polyi; _NFL->oname=polyo; _NFL->dbname=dbin; diff -urN palp-2.12.orig/Subdb.c palp-2.12/Subdb.c --- palp-2.12.orig/Subdb.c 2020-08-06 14:45:07.000000000 +0200 +++ palp-2.12/Subdb.c 2020-08-26 12:01:24.000000000 +0200 @@ -1759,7 +1759,8 @@ assert(_L!=NULL); if(!(*polyo)) { puts("You have to specify an output file via -po in -sv-mode."); - puts("For more help type `class.x -h'"); exit(0);} + printf("For more help type `%sclass%s -h'\n", PALP_Prefix, PALP_Suffix); + exit(0);} _L->of=0; _L->rf=0; _L->iname=polyi; _L->oname=polyo; _L->dbname=dbin; Init_NF_List(_L); _L->SL=0; while(Read_H_poly_from_DB_or_inFILE(DB,_P)) diff -urN palp-2.12.orig/Subpoly.c palp-2.12/Subpoly.c --- palp-2.12.orig/Subpoly.c 2020-08-06 14:55:24.000000000 +0200 +++ palp-2.12/Subpoly.c 2020-08-26 14:55:06.000000000 +0200 @@ -809,7 +809,7 @@ assert(_NFL!=NULL); if(!(*polyo)) { puts("You have to specify an output file via -po in -a-mode!\n"); - puts("For more help type `class.x -h'\n"); + printf("For more help type `%sclass%s -h'\n", PALP_Prefix, PALP_Suffix); exit(0);} _NFL->of=0; _NFL->rf=0; _NFL->iname=polyi; _NFL->oname=polyo; _NFL->dbname=dbin; @@ -843,7 +843,8 @@ time_t W_SAVE_TIME=time(NULL); if(!(*polyo)) { puts("You have to specify an output file via -po!\n"); - puts("For more help type `class.x -h'\n"); exit(0);} + printf("For more help type `%sclass%s -h'\n", PALP_Prefix, PALP_Suffix); + exit(0);} assert(_NFL!=NULL); _NFL->of=oFlag; _NFL->rf=rFlag; _NFL->kf=kFlag; _NFL->iname=polyi; _NFL->oname=polyo; _NFL->dbname=dbin; Init_NF_List(_NFL); @@ -1128,7 +1129,7 @@ assert(_NFL!=NULL); if(!(*polyo)) { puts("You have to specify an output file via -po in -sm-mode."); - puts("For more help type `class.x -h'"); + printf("For more help type `%sclass%s -h'\n", PALP_Prefix, PALP_Suffix); exit(0);} _NFL->of=0; _NFL->rf=0; _NFL->iname=polyi; _NFL->oname=polyo; _NFL->dbname=dbin; diff -urN palp-2.12.orig/class.c palp-2.12/class.c --- palp-2.12.orig/class.c 2020-08-19 12:20:03.000000000 +0200 +++ palp-2.12/class.c 2020-08-26 12:04:22.000000000 +0200 @@ -13,7 +13,6 @@ * Polynf normal form and symmetries * SubAdd sorting * Subdb data base - * -> poly.x class.x */ #include "Global.h" @@ -234,7 +233,9 @@ char Blank=0, *dbin=&Blank, *dbsub=&Blank, *dbout=dbin, *x_string=&Blank, *polyi=dbin, *polya=dbin, *polys=dbin, *polyo=dbin, mFlag=0, HFlag=0, sFlag=0; static CWS W; PolyPointList *_P; - if(narg==1) {puts("\nFor help type `class.x -h'\n");exit(0);} + if(narg==1) { + printf("For help type `%sclass%s -h'\n", PALP_Prefix, PALP_Suffix); + exit(0);} _P = (PolyPointList *) malloc(sizeof (PolyPointList)); if(_P==NULL) {puts("Unable to allocate space for _P"); exit(0);} diff -urN palp-2.12.orig/cws.c palp-2.12/cws.c --- palp-2.12.orig/cws.c 2020-08-17 14:44:28.000000000 +0200 +++ palp-2.12/cws.c 2020-08-26 11:53:37.000000000 +0200 @@ -13,13 +13,11 @@ typedef struct { int u[NFmax]; int nu; } CWS_type; -#define OSL (26) /* opt_string's length */ +#define OSL (24) /* opt_string's length */ void PrintCWSUsage(){ int i; char *opt_string[OSL]={ -"This is `cws.x': create weight systems and combined weight systems.", -"Usage: cws.x -; the first option must be -w, -c, -i, -d or -h.", "Options: -h print this information", " -f use as filter; otherwise parameters denote I/O files", " -w# [L H] make IP weight systems for #-dimensional polytopes.", @@ -45,6 +43,10 @@ " -2 adjoin a weight of 1/2 to the input weight system.", " -N make CWS for PPL in N lattice." }; + printf("This is `%scws%s': ", PALP_Prefix, PALP_Suffix); + puts("create weight systems and combined weight systems."); + printf("Usage: %scws%s -; ", PALP_Prefix, PALP_Suffix); + puts("the first option must be -w, -c, -i, -d or -h."); for (i=0;i] [in-file [out-file]]\n", c); @@ -181,7 +182,8 @@ if (POLY_Dmax < (_P->np - _P->n)){ printf("Please increase POLY_Dmax to at least %d = %d - %d - 1\n", (_P->np - _P->n -1), _P->np, _P->n); - puts("(mori.x -M requires POLY_Dmax >= #(points) - dim N -1)"); + printf("(%smori%s -M requires POLY_Dmax >= #(points) - dim N -1)\n", + PALP_Prefix, PALP_Suffix); exit(0); } } HyperSurfDivisorsQ(_P,&V,E,&Flag); fflush(outFILE); } diff -urN palp-2.12.orig/nef.c palp-2.12/nef.c --- palp-2.12.orig/nef.c 2012-04-17 16:23:02.000000000 +0200 +++ palp-2.12/nef.c 2020-08-26 12:21:33.000000000 +0200 @@ -286,7 +286,8 @@ if (POLY_Dmax < (_P->n + codim - 1)){ printf("Please increase POLY_Dmax to at least %d = %d + %d - 1\n", (_P->n + codim - 1), _P->n, codim); - puts("(nef.x requires POLY_Dmax >= dim N + codim - 1)"); + printf("(%snef%s requires POLY_Dmax >= dim N + codim - 1)\n", + PALP_Prefix, PALP_Suffix); exit(0); } Make_E_Poly(outFILE, &CW, _P, _V, _E, &codim, &F, &D[0]); } else{ diff -urN palp-2.12.orig/poly.c palp-2.12/poly.c --- palp-2.12.orig/poly.c 2020-08-12 14:28:03.000000000 +0200 +++ palp-2.12/poly.c 2020-08-26 11:57:45.000000000 +0200 @@ -9,7 +9,6 @@ * Rat rational functions * Vertex computes Vertices and Faces * Polynf normal form and symmetries - * -> class.x */ #include "Global.h"