Exclude Game of the Amazons by default
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 15 Aug 2020 14:06:57 +0000 (16:06 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 15 Aug 2020 16:48:38 +0000 (18:48 +0200)
Avoids big stack size for standard builds.

.travis.yml
src/Makefile
src/types.h
src/variant.cpp

index 4a34f22..73bfc1c 100644 (file)
@@ -41,12 +41,12 @@ before_script:
 
 script:
   # Check perft of large-board version
-  - make clean && make -j2 ARCH=x86-64 largeboards=yes debug=yes build && ../tests/perft.sh largeboard
+  - make clean && make -j2 ARCH=x86-64 largeboards=yes all=yes debug=yes build && ../tests/perft.sh largeboard
   - ./stockfish bench xiangqi > /dev/null 2>&1
   - ./stockfish bench shogi > /dev/null 2>&1
   - ./stockfish bench capablanca > /dev/null 2>&1
   - ./stockfish bench sittuyin > /dev/null 2>&1
-  - make clean && make -j2 ARCH=x86-32 largeboards=yes debug=yes build && ../tests/perft.sh largeboard
+  - make clean && make -j2 ARCH=x86-32 largeboards=yes all=yes debug=yes build && ../tests/perft.sh largeboard
   #
   # Obtain bench reference from git log
   - git log HEAD | grep "\b[Bb]ench[ :]\+[0-9]\{7\}" | head -n 1 | sed "s/[^0-9]*\([0-9]*\).*/\1/g" > git_sig
index a40231d..a5fdd65 100644 (file)
@@ -75,6 +75,7 @@ endif
 
 ### 2.1. General and architecture defaults
 largeboards = no
+all = no
 precomputedmagics = yes
 optimize = yes
 debug = no
@@ -167,6 +168,11 @@ ifneq ($(largeboards),no)
        endif
 endif
 
+# Enable all variants, even heavyweight ones like amazons
+ifneq ($(all),no)
+       CXXFLAGS += -DALLVARS
+endif
+
 ifeq ($(COMP),)
        COMP=gcc
 endif
@@ -426,10 +432,14 @@ help:
        @echo "make build ARCH=x86-64 COMP=clang"
        @echo "make profile-build ARCH=x86-64-bmi2 COMP=gcc COMPCXX=g++-4.8"
        @echo ""
-       @echo "Version for large boards (only GCC and mingw, 64-bit required): "
+       @echo "Version for large boards: "
        @echo ""
        @echo "make build ARCH=x86-64 COMP=gcc largeboards=yes"
        @echo ""
+       @echo "Include all variants: "
+       @echo ""
+       @echo "make build ARCH=x86-64 largeboards=yes all=yes"
+       @echo ""
 
 
 .PHONY: help build profile-build strip install clean objclean profileclean \
index 9f0229d..9c8712b 100644 (file)
@@ -218,7 +218,11 @@ typedef uint64_t Bitboard;
 constexpr int SQUARE_BITS = 6;
 #endif
 
+#ifdef ALLVARS
 constexpr int MAX_MOVES = 4096;
+#else
+constexpr int MAX_MOVES = 1024;
+#endif
 constexpr int MAX_PLY   = 246;
 
 /// A move needs 16 bits to be stored
index 3e4bddf..7724b4c 100644 (file)
@@ -837,6 +837,7 @@ namespace {
                       "pPpPpPpPpP/PpPpPpPpPp/pPpPpPpPpP/PpPpPpPpPp/pPpPpPpPpP w 0 1";
         return v;
     }
+#ifdef ALLVARS
     // Game of the Amazons
     // https://en.wikipedia.org/wiki/Game_of_the_Amazons
     Variant* amazons_variant() {
@@ -852,6 +853,7 @@ namespace {
         v->arrowGating = true;
         return v;
     }
+#endif
     Variant* xiangqi_variant() {
         Variant* v = minixiangqi_variant();
         v->pieceToCharTable = "PN.R.AB..K.C..........pn.r.ab..k.c..........";
@@ -1021,7 +1023,9 @@ void VariantMap::init() {
     add("grand", grand_variant());
     add("shako", shako_variant());
     add("clobber10", clobber10_variant());
+#ifdef ALLVARS
     add("amazons", amazons_variant());
+#endif
     add("xiangqi", xiangqi_variant());
     add("manchu", manchu_variant());
     add("supply", supply_variant());