ports/156590: games/KnightCap: coeffs.dat: No such file or directory, hangs xboard
Kalten
kalten at gmx.at
Sat Apr 23 02:40:09 UTC 2011
>Number: 156590
>Category: ports
>Synopsis: games/KnightCap: coeffs.dat: No such file or directory, hangs xboard
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Apr 23 02:40:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Kalten
>Release: 8.2-RELEASE
>Organization:
>Environment:
FreeBSD freeHugin.Walhalla.Leben 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011 root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
When using the programm, it tells us:
---SCHNIPP---
coeffs.dat: No such file or directory
---schnapp---
When using it with games/xboard this error hangs xboard.
---SCHNIPP---
xboard: Failed to start first chess program KnightCap -n -X -A on localhost: coeffs.dat: No such file or directory
---schnapp---
And the engin continues to run.
I didn't find a coeffs.dat file in games/KnightCap/work/ even after install.
According to games/KnightCap/work/Export/README:
``[...] coeffs.dat is a binary file
that gets read when KnightCap starts up, and overwrites the values
specified in the .h files. [...]''
I mannaged to compile the programs with source in UTILS/--see patch.
But how to generate the *.dat files?
summarize and extract core dump (there is no short_coeffs.h to be opened by extract.c and--well--absolut paths in summarize.c: definitly not working).
add_updates.c and dump_coeffs.c didn't help either.
So: what to do?
>How-To-Repeat:
directly:
bla> KnightCap
using xboard:
bla> xboard -fcp "KnightCap -n -X -A"
>Fix:
Patch attached with submission follows:
--- /dev/null 2011-04-23 04:27:36.000000000 +0200
+++ files/patch-UTILS_extract.c 2011-04-23 04:13:11.000000000 +0200
@@ -0,0 +1,18 @@
+--- UTILS/extract.c.orig 1998-05-18 01:09:43.000000000 +0200
++++ UTILS/extract.c 2011-04-23 04:09:35.000000000 +0200
+@@ -1,6 +1,6 @@
+ #include <stdio.h>
+
+-main()
++int main()
+ {
+ char name[40];
+ int next, num=0, count;
+@@ -46,6 +46,7 @@
+
+ fprintf(outfile, "#define __TOTAL_COEFFS__ %d\n", num*4);
+ fprintf(namefile, "{NULL, __COEFFS_PER_STAGE__}};\n");
++return 0;
+ }
+
+
--- /dev/null 2011-04-23 04:27:36.000000000 +0200
+++ files/patch-UTILS_add_updates.c 2011-04-23 03:43:55.000000000 +0200
@@ -0,0 +1,23 @@
+--- UTILS/add_updates.c.orig 1998-05-18 01:09:43.000000000 +0200
++++ UTILS/add_updates.c 2011-04-23 03:40:32.000000000 +0200
+@@ -1,6 +1,9 @@
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <math.h>
++#include <sys/types.h>
++#include <sys/uio.h>
++#include <unistd.h>
+
+ #define EVAL_SCALE (atanh(0.25)/10000) /* tanh(1 pawn up) = 0.25 */
+ #define TD_ALPHA (0.1/(EVAL_SCALE))
+@@ -12,8 +15,8 @@
+
+ typedef int etype;
+
+-#include "eval.h"
+-#include "names.h"
++#include "../eval.h"
++#include "../names.h"
+
+ double uf[__TOTAL_COEFFS__];
+ etype new_coefficients[__TOTAL_COEFFS__];
--- /dev/null 2011-04-23 04:27:36.000000000 +0200
+++ files/patch-UTILS_dump_coeffs.c 2011-04-23 03:44:23.000000000 +0200
@@ -0,0 +1,31 @@
+--- UTILS/dump_coeffs.c.orig 1998-05-18 01:09:43.000000000 +0200
++++ UTILS/dump_coeffs.c 2011-04-23 03:41:46.000000000 +0200
+@@ -1,6 +1,11 @@
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#include <sys/types.h>
++#include <sys/uio.h>
++#include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
+
+ typedef enum {OPENING=0, MIDDLE, ENDING, MATING} GameStage;
+ #define __COEFFS_PER_STAGE__ (__TOTAL_COEFFS__/(MATING+1))
+@@ -92,7 +97,7 @@
+ }
+ }
+
+-main()
++int main()
+ {
+ struct stat st;
+ struct coefficient_name *cn;
+@@ -171,6 +176,6 @@
+ if (small)
+ fclose(small);
+
+- return;
++ return 0;
+ }
+
--- /dev/null 2011-04-23 04:27:36.000000000 +0200
+++ files/patch-UTILS_summarize.c 2011-04-23 04:14:33.000000000 +0200
@@ -0,0 +1,24 @@
+--- UTILS/summarize.c.orig 1998-05-18 01:09:43.000000000 +0200
++++ UTILS/summarize.c 2011-04-23 04:14:01.000000000 +0200
+@@ -1,4 +1,5 @@
+ #include <stdio.h>
++#include <string.h>
+
+ #define PARAM1 "/* IPAWN_POS */"
+ #define PARAM2 "IPAWN_POS"
+@@ -6,7 +7,7 @@
+ #define FIRST 0
+ #define LAST 0
+
+-main()
++int main()
+ {
+ char name[100];
+ char line[400];
+@@ -47,5 +48,6 @@
+
+ fclose(outfile);
+ }
++return 0;
+ }
+
--- files/patch-aa.orig 2011-04-23 04:26:29.000000000 +0200
+++ files/patch-aa 2011-04-23 04:17:48.000000000 +0200
@@ -55,3 +55,37 @@
$(TARGET): $(OBJS)
-mv $@ $@.old
+--- Makefile.orig 2011-04-23 03:50:30.000000000 +0200
++++ Makefile 2011-04-23 03:50:07.000000000 +0200
+@@ -47,13 +47,30 @@
+ ordering.o hash.o board.o log.o prog.o timer.o ics.o display.o \
+ testsuite.o brain.o td.o tactics.o epd.o epdglue.o
+
+-$(TARGET): $(OBJS)
++$(TARGET): $(OBJS) dump_coeffs add_updates extract summarize
+ -mv $@ $@.old
+ $(CC) $(LOPT) -o $@ $(OBJS) $(LIBS)
+
+ proto:
+ cat *.c | awk -f mkproto.awk > proto.h
+
++
++dump_coeffs: UTILS/dump_coeffs.c eval.h names.h
++ cd UTILS && \
++ $(CC) $(LOPT) -lc $(LIBS) -o ../dump_coeffs dump_coeffs.c
++
++add_updates: UTILS/add_updates.c eval.h names.h
++ cd UTILS && \
++ $(CC) $(LOPT) -lc $(LIBS) -o ../add_updates add_updates.c
++
++extract: UTILS/extract.c
++ cd UTILS && \
++ $(CC) $(LOPT) $(LIBS) -o ../extract extract.c
++
++summarize: UTILS/summarize.c
++ cd UTILS && \
++ $(CC) $(LOPT) $(LIBS) -o ../summarize summarize.c
++
+ clean:
+ /bin/rm -f *.o *~ $(TARGET)
+
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list