Could anyone make me a Windows compile...?

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Could anyone make me a Windows compile...?

Post by Evert »

hgm wrote:Do you have legality testing off? For me typing a promotion is accepted, also by Sjaak, when legality testing is off. I don't have the version that highlights in magenta, so I cannot try that. But does the square actually show up in magenta? With legality testing on the highlight command is ignored.
Ah, I didn't, but if I switch it off then the square does show up as magenta and I can select a promotion piece. Otherwise it's just yellow.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Could anyone make me a Windows compile...?

Post by Evert »

hgm wrote:OK, I see. When I use the FEN without the dark squares it does work. The moves are just refused when the FEN contains dark squares.
I just retried this with legality testing off, but with the same effect: if there are dark squares in the FEN, XBoard crashes when a move is made (whether input by me or by the engine).
User avatar
hgm
Posts: 28503
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Could anyone make me a Windows compile...?

Post by hgm »

Strange. The WinBoard version I tried this with is the regular 4.8.0b.

I did not manage to get Sjaak running on Linux, so I cannot really test it with XBoard. But I would not expect XBoard and WinBoard to behave much differently in this respect.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Could anyone make me a Windows compile...?

Post by Evert »

hgm wrote: I did not manage to get Sjaak running on Linux, so I cannot really test it with XBoard. But I would not expect XBoard and WinBoard to behave much differently in this respect.
What's the problem? The Linux binaries should be static-linked and should work…

EDIT: on the other hand, you said you cannot enter moves in WinBoard either, right?
User avatar
hgm
Posts: 28503
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Could anyone make me a Windows compile...?

Post by hgm »

Code: Select all

hgm@hgm-xboard:~/SjaakIIbin$ ./sjaakii-linux64-sse42
./sjaakii-linux64-sse42: /lib/libc.so.6: version `GLIBC_2.15' not found (required by ./sjaakii-linux64-sse42)
./sjaakii-linux64-sse42: /lib/libc.so.6: version `GLIBC_2.14' not found (required by ./sjaakii-linux64-sse42)
./sjaakii-linux64-sse42: /lib/libc.so.6: version `GLIBC_2.17' not found (required by ./sjaakii-linux64-sse42)

Code: Select all

hgm@hgm-xboard:~/SjaakIIb/Build$ make
Scanning dependencies of target libsjaak
[  6%] Building C object CMakeFiles/libsjaak.dir/src/misc/aligned_malloc.o
[ 12%] Building C object CMakeFiles/libsjaak.dir/src/misc/cfgpath.o
[ 18%] Building C object CMakeFiles/libsjaak.dir/src/misc/genrand.o
[ 25%] Building C object CMakeFiles/libsjaak.dir/src/misc/keypressed.o
[ 31%] Building C object CMakeFiles/libsjaak.dir/src/misc/snprintf.o
[ 37%] Building C object CMakeFiles/libsjaak.dir/src/misc/softexp.o
[ 43%] Building CXX object CMakeFiles/libsjaak.dir/src/eval/pst.o
[ 50%] Building CXX object CMakeFiles/libsjaak.dir/src/rules/game.o
[ 56%] Building CXX object CMakeFiles/libsjaak.dir/src/rules/move.o
[ 62%] Building CXX object CMakeFiles/libsjaak.dir/src/rules/san.o
[ 68%] Building CXX object CMakeFiles/libsjaak.dir/src/rules/squares.o
[ 75%] Building C object CMakeFiles/libsjaak.dir/src/hash/hashkey.o
[ 81%] Building C object CMakeFiles/libsjaak.dir/src/hash/hashtable.o
[ 87%] Building C object CMakeFiles/libsjaak.dir/src/hash/evalhash.o
[ 93%] Building C object CMakeFiles/libsjaak.dir/src/timer/timer.o
Linking CXX static library liblibsjaak.a
[ 93%] Built target libsjaak
Scanning dependencies of target sjaakii
[100%] Building CXX object CMakeFiles/sjaakii.dir/src/xboard.o
In file included from /home/hgm/SjaakIIb/include/search.h:17,
                 from /home/hgm/SjaakIIb/include/game.h:1410,
                 from /home/hgm/SjaakIIb/include/sjaak.h:9,
                 from /home/hgm/SjaakIIb/src/xboard.cc:27:
/home/hgm/SjaakIIb/include/chase.h: In member function ‘bitboard_t<kind> game_template_t<kind>::get_chased_pieces(int) [with kind = long unsigned int]’:
/home/hgm/SjaakIIb/include/chase.h:4: warning: ‘last_move’ may be used uninitialized in this function
/home/hgm/SjaakIIb/include/chase.h: In member function ‘bitboard_t<kind> game_template_t<kind>::get_chased_pieces(int) [with kind = __uint128_t]’:
/home/hgm/SjaakIIb/include/chase.h:4: warning: ‘last_move’ may be used uninitialized in this function
In file included from /home/hgm/SjaakIIb/include/game.h:1411,
                 from /home/hgm/SjaakIIb/include/sjaak.h:9,
                 from /home/hgm/SjaakIIb/src/xboard.cc:27:
/home/hgm/SjaakIIb/include/movestring.h: In member function ‘move_t game_template_t<kind>::move_string_to_move(const char*, const movelist_t*) const [with kind = __uint128_t]’:
/home/hgm/SjaakIIb/include/movestring.h:84: warning: ‘from’ may be used uninitialized in this function
/home/hgm/SjaakIIb/include/movestring.h:84: warning: ‘to’ may be used uninitialized in this function
/home/hgm/SjaakIIb/include/movestring.h: In member function ‘move_t game_template_t<kind>::move_string_to_move(const char*, const movelist_t*) const [with kind = long unsigned int]’:
/home/hgm/SjaakIIb/include/movestring.h:84: warning: ‘from’ may be used uninitialized in this function
/home/hgm/SjaakIIb/include/movestring.h:84: warning: ‘to’ may be used uninitialized in this function
Linking CXX executable sjaakii
liblibsjaak.a(timer.o): In function `get_timer':
/home/hgm/SjaakIIb/src/timer/timer.c:43: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make[2]: *** [sjaakii] Error 1
make[1]: *** [CMakeFiles/sjaakii.dir/all] Error 2
make: *** [all] Error 2
Evert wrote:EDIT: on the other hand, you said you cannot enter moves in WinBoard either, right?
Not with legality testing off, because Sjaak sends and emty color FEN. With legality testing on Sjaak refuses the moves as illegal. In both cases WinBoard is not to blame, and shows the desired behavior.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Could anyone make me a Windows compile...?

Post by Evert »

hgm wrote:

Code: Select all

hgm@hgm-xboard:~/SjaakIIbin$ ./sjaakii-linux64-sse42
./sjaakii-linux64-sse42: /lib/libc.so.6: version `GLIBC_2.15' not found (required by ./sjaakii-linux64-sse42)
./sjaakii-linux64-sse42: /lib/libc.so.6: version `GLIBC_2.14' not found (required by ./sjaakii-linux64-sse42)
./sjaakii-linux64-sse42: /lib/libc.so.6: version `GLIBC_2.17' not found (required by ./sjaakii-linux64-sse42)

Code: Select all

hgm@hgm-xboard:~/SjaakIIb/Build$ make
Scanning dependencies of target libsjaak
[  6%] Building C object CMakeFiles/libsjaak.dir/src/misc/aligned_malloc.o
[ 12%] Building C object CMakeFiles/libsjaak.dir/src/misc/cfgpath.o
[ 18%] Building C object CMakeFiles/libsjaak.dir/src/misc/genrand.o
[ 25%] Building C object CMakeFiles/libsjaak.dir/src/misc/keypressed.o
[ 31%] Building C object CMakeFiles/libsjaak.dir/src/misc/snprintf.o
[ 37%] Building C object CMakeFiles/libsjaak.dir/src/misc/softexp.o
[ 43%] Building CXX object CMakeFiles/libsjaak.dir/src/eval/pst.o
[ 50%] Building CXX object CMakeFiles/libsjaak.dir/src/rules/game.o
[ 56%] Building CXX object CMakeFiles/libsjaak.dir/src/rules/move.o
[ 62%] Building CXX object CMakeFiles/libsjaak.dir/src/rules/san.o
[ 68%] Building CXX object CMakeFiles/libsjaak.dir/src/rules/squares.o
[ 75%] Building C object CMakeFiles/libsjaak.dir/src/hash/hashkey.o
[ 81%] Building C object CMakeFiles/libsjaak.dir/src/hash/hashtable.o
[ 87%] Building C object CMakeFiles/libsjaak.dir/src/hash/evalhash.o
[ 93%] Building C object CMakeFiles/libsjaak.dir/src/timer/timer.o
Linking CXX static library liblibsjaak.a
[ 93%] Built target libsjaak
Scanning dependencies of target sjaakii
[100%] Building CXX object CMakeFiles/sjaakii.dir/src/xboard.o
In file included from /home/hgm/SjaakIIb/include/search.h:17,
                 from /home/hgm/SjaakIIb/include/game.h:1410,
                 from /home/hgm/SjaakIIb/include/sjaak.h:9,
                 from /home/hgm/SjaakIIb/src/xboard.cc:27:
/home/hgm/SjaakIIb/include/chase.h: In member function ‘bitboard_t<kind> game_template_t<kind>::get_chased_pieces(int) [with kind = long unsigned int]’:
/home/hgm/SjaakIIb/include/chase.h:4: warning: ‘last_move’ may be used uninitialized in this function
/home/hgm/SjaakIIb/include/chase.h: In member function ‘bitboard_t<kind> game_template_t<kind>::get_chased_pieces(int) [with kind = __uint128_t]’:
/home/hgm/SjaakIIb/include/chase.h:4: warning: ‘last_move’ may be used uninitialized in this function
In file included from /home/hgm/SjaakIIb/include/game.h:1411,
                 from /home/hgm/SjaakIIb/include/sjaak.h:9,
                 from /home/hgm/SjaakIIb/src/xboard.cc:27:
/home/hgm/SjaakIIb/include/movestring.h: In member function ‘move_t game_template_t<kind>::move_string_to_move(const char*, const movelist_t*) const [with kind = __uint128_t]’:
/home/hgm/SjaakIIb/include/movestring.h:84: warning: ‘from’ may be used uninitialized in this function
/home/hgm/SjaakIIb/include/movestring.h:84: warning: ‘to’ may be used uninitialized in this function
/home/hgm/SjaakIIb/include/movestring.h: In member function ‘move_t game_template_t<kind>::move_string_to_move(const char*, const movelist_t*) const [with kind = long unsigned int]’:
/home/hgm/SjaakIIb/include/movestring.h:84: warning: ‘from’ may be used uninitialized in this function
/home/hgm/SjaakIIb/include/movestring.h:84: warning: ‘to’ may be used uninitialized in this function
Linking CXX executable sjaakii
liblibsjaak.a(timer.o): In function `get_timer':
/home/hgm/SjaakIIb/src/timer/timer.c:43: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make[2]: *** [sjaakii] Error 1
make[1]: *** [CMakeFiles/sjaakii.dir/all] Error 2
make: *** [all] Error 2
Damn, I thought I'd fixed that.
Could you try this:
(EDIT: see below)
(snip)
Evert wrote:EDIT: on the other hand, you said you cannot enter moves in WinBoard either, right?
Not with legality testing off, because Sjaak sends and emty color FEN. With legality testing on Sjaak refuses the moves as illegal. In both cases WinBoard is not to blame, and shows the desired behavior.
Oh, right. I forgot: I only added the skipping of '*' in a FEN to Sjaak when I added Omicron chess, so the version you have will mess up the board position on reading the FEN containing '*'.

I should work on producing sensible error messages rather than silently failing.

EDIT:
the following change is apparently better than what I posted earlier:

Code: Select all

Index: ../src/timer/timer.c
===================================================================
--- ../src/timer/timer.c	(revision 219)
+++ ../src/timer/timer.c	(revision 221)
@@ -21,7 +21,7 @@
 #  undef min
 #else
 #  include <unistd.h>
-#  if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 199309L && defined _POSIX_TIMERS && _POSIX_TIMERS>0 && defined _POSIX_MONOTONIC_CLOCK
+#  if defined HAVE_CLOCK_GETTIME && defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 199309L && defined _POSIX_TIMERS && _POSIX_TIMERS>0 && defined _POSIX_MONOTONIC_CLOCK
 #     define USE_CLOCK_GETTIME
 #     include <time.h>
 #  else
Index: ../CMakeLists.txt
===================================================================
--- ../CMakeLists.txt	(revision 219)
+++ ../CMakeLists.txt	(revision 221)
@@ -237,10 +237,12 @@
 target_link_libraries("libsjaak" ${M_LIB})
 
 # Look for the standard math library
-find_library(RT_LIB rt)
-if (RT_LIB_FOUND)
-   target_link_libraries("libsjaak" ${RT_LIB})
-endif (RT_LIB_FOUND)
+include(CheckLibraryExists)
+CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
+if (HAVE_CLOCK_GETTIME)
+   target_link_libraries("libsjaak" rt)
+   set (CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -DHAVE_CLOCK_GETTIME")
+endif (HAVE_CLOCK_GETTIME)
 
 add_executable ("sjaakii" src/xboard.cc)
 target_link_libraries("sjaakii" libsjaak)
EDIT2: even if this will help you compile under Linux (which would be good for me to know if it solves the problem), it will not help you catch the problem with dark squares since the release version of SjaakII doesn't handle those...
User avatar
hgm
Posts: 28503
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Could anyone make me a Windows compile...?

Post by hgm »

Well, it works good enough to see a difference between my current XBoard development version, and some older compile I still had around. The latter segfaults after it sends 'lift' for the first piece I touch, never recording the reply. But my current XBoard doesn't suffer from that. It just refuses the move because Sjaak's highlight command it gets in response does tell it to do so.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Could anyone make me a Windows compile...?

Post by Evert »

hgm wrote:Well, it works good enough to see a difference between my current XBoard development version, and some older compile I still had around. The latter segfaults after it sends 'lift' for the first piece I touch, never recording the reply. But my current XBoard doesn't suffer from that. It just refuses the move because Sjaak's highlight command it gets in response does tell it to do so.
Awesome.
I just tried with the latest snapshot from your git repository and that indeed does work now with the blacked-out squares. The only issue is that the Xaw menu bar now has an underlined space in front of the character that is meant to activate them (rather than underlining the character itself). It's purely cosmetic though, and I'm probably the last person to still use the non-Gtk version.

I'll add an engine option to suppress blacked-out squares in the setup FEN, for compatibility with 4.8.
User avatar
hgm
Posts: 28503
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Could anyone make me a Windows compile...?

Post by hgm »

Ah yes, the GTK menus use the underscore to indicate a 'mnemonic' letter for the menu item, so it can be opened with Alt + letter. I added this without realizing it would spoil the Xaw menus. I guess the Xaw menu-creation function should strip them off.

I would not worry about XBoard 4.8.0 compatibility, if I were you. There obviously is a bug there, and it will be fixed in 4.8.1. (I forgot what exactly fixed it, I remember there were a number of problems in the interaction between dark squares and the Betza generator, when I tried to configure WinBoard for a variant designed by someone on www.chess.com.) Just make things as they should be eventually, and if in the mean time people cannot play Omicron Chess (great name! 8-) ) other than by downloading an XBoard snapshot, so be it. It is quite questionable anyone would want to play it anyway, which would be different if this was truly Omega Chess. (But then they would start to nagg us that the wizzard squares are not written as w1, w2 etc., so perhaps it is just as well... It is a pitty, though, that there is not a filewise equivalent to the rank 0 trick.)
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Could anyone make me a Windows compile...?

Post by Evert »

hgm wrote: I would not worry about XBoard 4.8.0 compatibility, if I were you. There obviously is a bug there, and it will be fixed in 4.8.1. (I forgot what exactly fixed it, I remember there were a number of problems in the interaction between dark squares and the Betza generator, when I tried to configure WinBoard for a variant designed by someone on www.chess.com.)
Well, the work-around is rather easy, so I threw it in. It's disabled by default though.
Just make things as they should be eventually, and if in the mean time people cannot play Omicron Chess (great name! 8-) ) other than by downloading an XBoard snapshot, so be it.
The name "Small Omega" was bugging me, and I was trying to come up with alternatives. "Alpha" is an obvious one, but seemed to miss the mark, "Epsilon" felt a bit too geeky. I was racking my brain trying to think of a Greek letter that would get across "small omega" when it hit me, and then I felt stupid for not thinking of it immediately.
It is quite questionable anyone would want to play it anyway, which would be different if this was truly Omega Chess.
I suppose that's true; I don't know how big of an Omega Chess community there is, the website rather suggests that there isn't much of one, or at least doesn't link to it (but it does link to some dubious on-line gambling stuff). Not that http://www.seirawanchess.com is any better...

If I make the board 12x10 and place the extra squares beside the board, I could fit everything in easily. Then I would need to remove the wizard squares from the slider move tables so the board effectively becomes 10x10 with two inactive borders, then hack the move tables so that say "Bd3-a1" becomes a legal move if b1 can be reached and is empty.
For leapers I would need to go over each of the wizard squares, remove it as a valid destination for any of the squares it thinks it can reach, shift the destinations by one rank and then mark the wizard square as a possible destination for all squares that can be reached from it.
The really tricky part might be to prevent things like b9xa10…

Might be fun, actually. However, I don't think I should be hacking in stuff like this in a "release candidate", so if I do something like this it'll be for post 1.0.
(But then they would start to nagg us that the wizzard squares are not written as w1, w2 etc., so perhaps it is just as well... It is a pitty, though, that there is not a filewise equivalent to the rank 0 trick.)
In Sjaak the square names are just an array, indexed by square number. Normally it's initialised using something like snprintf("%c%d", 'a'+file, 1+rank) but it would be easy to relabel them any way you can think of.