fairy-stockfish / Fairy-Stockfish

chess variant engine supporting Xiangqi, Shogi, Janggi, Makruk, S-Chess, Crazyhouse, Bughouse, and many more
https://fairy-stockfish.github.io/
GNU General Public License v3.0
619 stars 196 forks source link

Failed to compile large boards #16

Closed gbtami closed 5 years ago

gbtami commented 5 years ago

I wanted to try shogi on my Ubuntu 18.04 laptop. The compiled stockfish doesn't start (segmentation error).

tamas@tami:~/Fairy-Stockfish/src$ make build ARCH=x86-64 COMP=gcc largeboards=yes

Config:
debug: 'no'
sanitize: 'no'
optimize: 'yes'
arch: 'x86_64'
bits: '64'
kernel: 'Linux'
os: 'GNU/Linux'
prefetch: 'yes'
popcnt: 'no'
sse: 'yes'
pext: 'no'

Flags:
CXX: g++
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto
LDFLAGS:  -m64 -Wl,--no-as-needed -lpthread -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto

Testing config sanity. If this fails, try 'make help' ...

make ARCH=x86-64 COMP=gcc all
make[1]: Entering directory '/home/tamas/Fairy-Stockfish/src'
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o benchmark.o benchmark.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o endgame.o endgame.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o evaluate.o evaluate.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o main.o main.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o material.o material.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o misc.o misc.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o movegen.o movegen.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o movepick.o movepick.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o pawns.o pawns.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o position.o position.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o psqt.o psqt.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o search.o search.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o thread.o thread.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o timeman.o timeman.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o uci.o uci.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o ucioption.o ucioption.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto   -c -o variant.o variant.cpp
g++ -o stockfish benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o search.o thread.o timeman.o tt.o uci.o ucioption.o variant.o syzygy/tbprobe.o  -m64 -Wl,--no-as-needed -lpthread -Wall -Wcast-qual -fno-exceptions -std=c++11  -DLARGEBOARDS -DPRECOMPUTED_MAGICS -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto
types.h:274:6: warning: type ‘Square’ violates the C++ One Definition Rule [-Wodr]
 enum Square : int {
      ^
types.h:274:6: note: an enum with different value name is defined in another translation unit
 enum Square : int {
      ^
types.h:334:6: warning: type ‘Rank’ violates the C++ One Definition Rule [-Wodr]
 enum Rank : int {
      ^
types.h:334:6: note: an enum with different value name is defined in another translation unit
 enum Rank : int {
      ^
types.h:324:6: warning: type ‘File’ violates the C++ One Definition Rule [-Wodr]
 enum File : int {
      ^
types.h:324:6: note: an enum with different value name is defined in another translation unit
 enum File : int {
      ^
bitboard.h:114:8: warning: type ‘struct Magic’ violates the C++ One Definition Rule [-Wodr]
 struct Magic {
        ^
bitboard.h:114:8: note: a different type is defined in another translation unit
 struct Magic {
        ^
bitboard.h:115:13: note: the first difference of corresponding definitions is field ‘mask’
   Bitboard  mask;
             ^
bitboard.h:115:13: note: a field of same name but different type is defined in another translation unit
   Bitboard  mask;
             ^
types.h:109:18: note: type ‘Bitboard’ should match type ‘Bitboard’
 typedef uint64_t Bitboard;
                  ^
types.h:106:27: note: the incompatible type is defined here
 typedef unsigned __int128 Bitboard;
                           ^
types.h:308:6: warning: type ‘Direction’ violates the C++ One Definition Rule [-Wodr]
 enum Direction : int {
      ^
types.h:308:6: note: an enum with different values is defined in another translation unit
 enum Direction : int {
      ^
variant.h:34:8: warning: type ‘struct Variant’ violates the C++ One Definition Rule [-Wodr]
 struct Variant {
        ^
syzygy/../variant.h:34:8: note: a different type is defined in another translation unit
 struct Variant {
        ^
variant.h:36:20: note: the first difference of corresponding definitions is field ‘pocketSize’
   int pocketSize = 0;
                    ^
syzygy/../variant.h:36:18: note: a field with different name is defined in another translation unit
   int pocketSize = 0;
                  ^
position.h:39:8: warning: type ‘struct StateInfo’ violates the C++ One Definition Rule [-Wodr]
 struct StateInfo {
        ^
syzygy/../position.h:39:8: note: a different type is defined in another translation unit
 struct StateInfo {
        ^
position.h:50:10: note: the first difference of corresponding definitions is field ‘epSquare’
   Square epSquare;
          ^
syzygy/../position.h:50:10: note: a field of same name but different type is defined in another translation unit
   Square epSquare;
          ^
types.h:274:6: note: type ‘Square’ itself violates the C++ One Definition Rule
 enum Square : int {
      ^
position.h:78:7: warning: type ‘struct Position’ violates the C++ One Definition Rule [-Wodr]
 class Position {
       ^
syzygy/../position.h:78:7: note: a different type is defined in another translation unit
 class Position {
       ^
position.h:249:24: note: the first difference of corresponding definitions is field ‘board’
   Piece board[SQUARE_NB];
                        ^
syzygy/../position.h:245:24: note: a field of same name but different type is defined in another translation unit
   template<bool Do>
                        ^
position.h:78:7: note: array types have different bounds
 class Position {
       ^
types.h:128:6: warning: type ‘Move’ violates the C++ One Definition Rule [-Wodr]
 enum Move : int {
      ^
syzygy/../types.h:128:6: note: an enum with different values is defined in another translation unit
 enum Move : int {
      ^
movegen.h:39:8: warning: type ‘struct ExtMove’ violates the C++ One Definition Rule [-Wodr]
 struct ExtMove {
        ^
syzygy/../movegen.h:39:8: note: a different type is defined in another translation unit
 struct ExtMove {
        ^
movegen.h:40:8: note: the first difference of corresponding definitions is field ‘move’
   Move move;
        ^
syzygy/../movegen.h:40:8: note: a field of same name but different type is defined in another translation unit
   Move move;
        ^
types.h:128:6: note: type ‘Move’ itself violates the C++ One Definition Rule
 enum Move : int {
      ^
syzygy/../types.h:128:6: note: the incompatible type is defined here
 enum Move : int {
      ^
types.h:133:6: warning: type ‘MoveType’ violates the C++ One Definition Rule [-Wodr]
 enum MoveType : int {
      ^
syzygy/../types.h:133:6: note: an enum with different values is defined in another translation unit
 enum MoveType : int {
      ^
syzygy/tbprobe.h:52:6: warning: ‘root_probe’ violates the C++ One Definition Rule  [-Wodr]
 bool root_probe(Position& pos, Search::RootMoves& rootMoves);
      ^
syzygy/tbprobe.cpp:1446:6: note: type mismatch in parameter 1
 bool Tablebases::root_probe(Position& pos, Search::RootMoves& rootMoves) {
      ^
syzygy/../position.h:78:7: note: type ‘struct Position’ itself violates the C++ One Definition Rule
 class Position {
       ^
position.h:78:7: note: the incompatible type is defined here
 class Position {
       ^
syzygy/tbprobe.cpp:1446:6: note: ‘root_probe’ was previously declared here
 bool Tablebases::root_probe(Position& pos, Search::RootMoves& rootMoves) {
      ^
syzygy/tbprobe.cpp:1446:6: note: code may be misoptimized unless -fno-strict-aliasing is used
syzygy/tbprobe.h:53:6: warning: ‘root_probe_wdl’ violates the C++ One Definition Rule  [-Wodr]
 bool root_probe_wdl(Position& pos, Search::RootMoves& rootMoves);
      ^
syzygy/tbprobe.cpp:1515:6: note: type mismatch in parameter 1
 bool Tablebases::root_probe_wdl(Position& pos, Search::RootMoves& rootMoves) {
      ^
syzygy/../position.h:78:7: note: type ‘struct Position’ itself violates the C++ One Definition Rule
 class Position {
       ^
position.h:78:7: note: the incompatible type is defined here
 class Position {
       ^
syzygy/tbprobe.cpp:1515:6: note: ‘root_probe_wdl’ was previously declared here
 bool Tablebases::root_probe_wdl(Position& pos, Search::RootMoves& rootMoves) {
      ^
syzygy/tbprobe.cpp:1515:6: note: code may be misoptimized unless -fno-strict-aliasing is used
syzygy/../position.h:841:13: warning: ‘do_move’ violates the C++ One Definition Rule  [-Wodr]
 inline void Position::undrop_piece(Piece pc_hand, Piece pc_drop, Square s) {
             ^
position.h:817:13: note: implicit this pointer type mismatch
 inline void Position::do_move(Move m, StateInfo& newSt) {
             ^
position.h:78:7: note: type ‘struct Position’ itself violates the C++ One Definition Rule
 class Position {
       ^
syzygy/../position.h:78:7: note: the incompatible type is defined here
 class Position {
       ^
position.h:817:13: note: ‘do_move’ was previously declared here
 inline void Position::do_move(Move m, StateInfo& newSt) {
             ^
position.h:817:13: note: code may be misoptimized unless -fno-strict-aliasing is used
syzygy/tbprobe.h:50:10: warning: ‘probe_wdl’ violates the C++ One Definition Rule  [-Wodr]
 WDLScore probe_wdl(Position& pos, ProbeState* result);
          ^
syzygy/tbprobe.cpp:1348:10: note: type mismatch in parameter 1
 WDLScore Tablebases::probe_wdl(Position& pos, ProbeState* result) {
          ^
syzygy/../position.h:78:7: note: type ‘struct Position’ itself violates the C++ One Definition Rule
 class Position {
       ^
position.h:78:7: note: the incompatible type is defined here
 class Position {
       ^
syzygy/tbprobe.h:50:10: warning: ‘probe_wdl’ violates the C++ One Definition Rule  [-Wodr]
 WDLScore probe_wdl(Position& pos, ProbeState* result);
          ^
syzygy/tbprobe.cpp:1348:10: note: type mismatch in parameter 1
 WDLScore Tablebases::probe_wdl(Position& pos, ProbeState* result) {
          ^
syzygy/../position.h:78:7: note: type ‘struct Position’ itself violates the C++ One Definition Rule
 class Position {
       ^
position.h:78:7: note: the incompatible type is defined here
 class Position {
       ^
syzygy/tbprobe.cpp:1348:10: note: ‘probe_wdl’ was previously declared here
 WDLScore Tablebases::probe_wdl(Position& pos, ProbeState* result) {
          ^
syzygy/tbprobe.cpp:1348:10: note: code may be misoptimized unless -fno-strict-aliasing is used
syzygy/tbprobe.h:51:5: warning: ‘probe_dtz’ violates the C++ One Definition Rule  [-Wodr]
 int probe_dtz(Position& pos, ProbeState* result);
     ^
syzygy/tbprobe.cpp:1380:5: note: type mismatch in parameter 1
 int Tablebases::probe_dtz(Position& pos, ProbeState* result) {
     ^
syzygy/../position.h:78:7: note: type ‘struct Position’ itself violates the C++ One Definition Rule
 class Position {
       ^
position.h:78:7: note: the incompatible type is defined here
 class Position {
       ^
syzygy/tbprobe.cpp:1380:5: note: ‘probe_dtz’ was previously declared here
 int Tablebases::probe_dtz(Position& pos, ProbeState* result) {
     ^
syzygy/tbprobe.cpp:1380:5: note: code may be misoptimized unless -fno-strict-aliasing is used
syzygy/../position.h:201:8: warning: ‘undo_move’ violates the C++ One Definition Rule  [-Wodr]
   void do_move(Move m, StateInfo& newSt, bool givesCheck);
        ^
position.cpp:1245:6: note: implicit this pointer type mismatch
 void Position::undo_move(Move m) {
      ^
position.h:78:7: note: type ‘struct Position’ itself violates the C++ One Definition Rule
 class Position {
       ^
syzygy/../position.h:78:7: note: the incompatible type is defined here
 class Position {
       ^
position.cpp:1245:6: note: ‘undo_move’ was previously declared here
 void Position::undo_move(Move m) {
      ^
position.cpp:1245:6: note: code may be misoptimized unless -fno-strict-aliasing is used
syzygy/../position.h:200:8: warning: ‘do_move’ violates the C++ One Definition Rule  [-Wodr]
   void do_move(Move m, StateInfo& newSt);
        ^
position.cpp:953:6: note: implicit this pointer type mismatch
 void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
      ^
position.h:78:7: note: type ‘struct Position’ itself violates the C++ One Definition Rule
 class Position {
       ^
syzygy/../position.h:78:7: note: the incompatible type is defined here
 class Position {
       ^
position.cpp:953:6: note: ‘do_move’ was previously declared here
 void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
      ^
position.cpp:953:6: note: code may be misoptimized unless -fno-strict-aliasing is used
syzygy/../position.h:221:8: warning: ‘has_repeated’ violates the C++ One Definition Rule  [-Wodr]
   bool is_game_end(Value& result, int ply = 0) const;
        ^
position.cpp:1664:6: note: ‘has_repeated’ was previously declared here
 bool Position::has_repeated() const {
      ^
position.cpp:1664:6: note: code may be misoptimized unless -fno-strict-aliasing is used
syzygy/../position.h:188:8: warning: ‘gives_check’ violates the C++ One Definition Rule  [-Wodr]
   bool capture_or_promotion(Move m) const;
        ^
position.cpp:884:6: note: type mismatch in parameter 1
 bool Position::gives_check(Move m) const {
      ^
types.h:128:6: note: type ‘Move’ itself violates the C++ One Definition Rule
 enum Move : int {
      ^
syzygy/../types.h:128:6: note: the incompatible type is defined here
 enum Move : int {
      ^
position.cpp:884:6: note: ‘gives_check’ was previously declared here
 bool Position::gives_check(Move m) const {
      ^
position.cpp:884:6: note: code may be misoptimized unless -fno-strict-aliasing is used
syzygy/../position.h:88:13: warning: ‘set’ violates the C++ One Definition Rule  [-Wodr]
   Position& set(const std::string& code, Color c, StateInfo* si);
             ^
position.cpp:549:11: note: return value type mismatch
 Position& Position::set(const string& code, Color c, StateInfo* si) {
           ^
position.h:78:7: note: type ‘struct Position’ itself violates the C++ One Definition Rule
 class Position {
       ^
syzygy/../position.h:78:7: note: the incompatible type is defined here
 class Position {
       ^
position.cpp:549:11: note: ‘set’ was previously declared here
 Position& Position::set(const string& code, Color c, StateInfo* si) {
           ^
position.cpp:549:11: note: code may be misoptimized unless -fno-strict-aliasing is used
syzygy/../movegen.h:56:10: warning: ‘generate’ violates the C++ One Definition Rule  [-Wodr]
 ExtMove* generate(const Position& pos, ExtMove* moveList);
          ^
movegen.cpp:477:10: note: return value type mismatch
 ExtMove* generate<LEGAL>(const Position& pos, ExtMove* moveList) {
          ^
movegen.h:39:8: note: type ‘struct ExtMove’ itself violates the C++ One Definition Rule
 struct ExtMove {
        ^
syzygy/../movegen.h:39:8: note: the incompatible type is defined here
 struct ExtMove {
        ^
movegen.cpp:477:10: note: ‘generate’ was previously declared here
 ExtMove* generate<LEGAL>(const Position& pos, ExtMove* moveList) {
          ^
movegen.cpp:477:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:98:17: warning: type of ‘BetweenBB’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard BetweenBB[SQUARE_NB][SQUARE_NB];
                 ^
bitboard.cpp:35:10: note: array types have different bounds
 Bitboard BetweenBB[SQUARE_NB][SQUARE_NB];
          ^
bitboard.cpp:35:10: note: ‘BetweenBB’ was previously declared here
bitboard.cpp:35:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:99:17: warning: type of ‘LineBB’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard LineBB[SQUARE_NB][SQUARE_NB];
                 ^
bitboard.cpp:36:10: note: array types have different bounds
 Bitboard LineBB[SQUARE_NB][SQUARE_NB];
          ^
bitboard.cpp:36:10: note: ‘LineBB’ was previously declared here
bitboard.cpp:36:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:107:17: warning: type of ‘LeaperMoves’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard LeaperMoves[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
                 ^
bitboard.cpp:44:10: note: array types have different bounds
 Bitboard LeaperMoves[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
          ^
bitboard.cpp:44:10: note: ‘LeaperMoves’ was previously declared here
bitboard.cpp:44:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:105:17: warning: type of ‘PseudoMoves’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard PseudoMoves[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
                 ^
bitboard.cpp:42:10: note: array types have different bounds
 Bitboard PseudoMoves[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
          ^
bitboard.cpp:42:10: note: ‘PseudoMoves’ was previously declared here
bitboard.cpp:42:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:100:17: warning: type of ‘DistanceRingBB’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard DistanceRingBB[SQUARE_NB][FILE_NB];
                 ^
bitboard.cpp:37:10: note: array types have different bounds
 Bitboard DistanceRingBB[SQUARE_NB][FILE_NB];
          ^
bitboard.cpp:37:10: note: ‘DistanceRingBB’ was previously declared here
bitboard.cpp:37:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:92:17: warning: type of ‘BoardSizeBB’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard BoardSizeBB[FILE_NB][RANK_NB];
                 ^
bitboard.cpp:29:10: note: array types have different bounds
 Bitboard BoardSizeBB[FILE_NB][RANK_NB];
          ^
bitboard.cpp:29:10: note: ‘BoardSizeBB’ was previously declared here
bitboard.cpp:29:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:102:17: warning: type of ‘PassedPawnMask’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard PassedPawnMask[COLOR_NB][SQUARE_NB];
                 ^
bitboard.cpp:39:10: note: array types have different bounds
 Bitboard PassedPawnMask[COLOR_NB][SQUARE_NB];
          ^
bitboard.cpp:39:10: note: ‘PassedPawnMask’ was previously declared here
bitboard.cpp:39:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:103:17: warning: type of ‘PawnAttackSpan’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard PawnAttackSpan[COLOR_NB][SQUARE_NB];
                 ^
bitboard.cpp:40:10: note: array types have different bounds
 Bitboard PawnAttackSpan[COLOR_NB][SQUARE_NB];
          ^
bitboard.cpp:40:10: note: ‘PawnAttackSpan’ was previously declared here
bitboard.cpp:40:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:101:17: warning: type of ‘ForwardFileBB’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard ForwardFileBB[COLOR_NB][SQUARE_NB];
                 ^
bitboard.cpp:38:10: note: array types have different bounds
 Bitboard ForwardFileBB[COLOR_NB][SQUARE_NB];
          ^
bitboard.cpp:38:10: note: ‘ForwardFileBB’ was previously declared here
bitboard.cpp:38:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:97:17: warning: type of ‘ForwardRanksBB’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard ForwardRanksBB[COLOR_NB][RANK_NB];
                 ^
bitboard.cpp:34:10: note: array types have different bounds
 Bitboard ForwardRanksBB[COLOR_NB][RANK_NB];
          ^
bitboard.cpp:34:10: note: ‘ForwardRanksBB’ was previously declared here
bitboard.cpp:34:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:96:17: warning: type of ‘AdjacentFilesBB’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard AdjacentFilesBB[FILE_NB];
                 ^
bitboard.cpp:33:10: note: array types have different bounds
 Bitboard AdjacentFilesBB[FILE_NB];
          ^
bitboard.cpp:33:10: note: ‘AdjacentFilesBB’ was previously declared here
bitboard.cpp:33:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:94:17: warning: type of ‘FileBB’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard FileBB[FILE_NB];
                 ^
bitboard.cpp:31:10: note: array types have different bounds
 Bitboard FileBB[FILE_NB];
          ^
bitboard.cpp:31:10: note: ‘FileBB’ was previously declared here
bitboard.cpp:31:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:95:17: warning: type of ‘RankBB’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard RankBB[RANK_NB];
                 ^
bitboard.cpp:32:10: note: array types have different bounds
 Bitboard RankBB[RANK_NB];
          ^
bitboard.cpp:32:10: note: ‘RankBB’ was previously declared here
bitboard.cpp:32:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:135:14: warning: ‘RookMagics’ violates the C++ One Definition Rule  [-Wodr]
 extern Magic RookMagics[SQUARE_NB];
              ^
bitboard.cpp:46:7: note: array types have different bounds
 Magic RookMagics[SQUARE_NB];
       ^
bitboard.cpp:46:7: note: ‘RookMagics’ was previously declared here
bitboard.cpp:46:7: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:136:14: warning: ‘BishopMagics’ violates the C++ One Definition Rule  [-Wodr]
 extern Magic BishopMagics[SQUARE_NB];
              ^
bitboard.cpp:47:7: note: array types have different bounds
 Magic BishopMagics[SQUARE_NB];
       ^
bitboard.cpp:47:7: note: ‘BishopMagics’ was previously declared here
bitboard.cpp:47:7: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:106:17: warning: type of ‘LeaperAttacks’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard LeaperAttacks[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
                 ^
bitboard.cpp:43:10: note: array types have different bounds
 Bitboard LeaperAttacks[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
          ^
bitboard.cpp:43:10: note: ‘LeaperAttacks’ was previously declared here
bitboard.cpp:43:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:31:6: warning: ‘probe’ violates the C++ One Definition Rule  [-Wodr]
 bool probe(Square wksq, Square wpsq, Square bksq, Color us);
      ^
bitbase.cpp:76:6: note: type mismatch in parameter 1
 bool Bitbases::probe(Square wksq, Square wpsq, Square bksq, Color us) {
      ^
types.h:274:6: note: type ‘Square’ itself violates the C++ One Definition Rule
 enum Square : int {
      ^
bitbase.cpp:76:6: note: ‘probe’ was previously declared here
 bool Bitbases::probe(Square wksq, Square wpsq, Square bksq, Color us) {
      ^
bitboard.h:93:17: warning: type of ‘SquareBB’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard SquareBB[SQUARE_NB];
                 ^
bitboard.cpp:30:10: note: array types have different bounds
 Bitboard SquareBB[SQUARE_NB];
          ^
bitboard.cpp:30:10: note: ‘SquareBB’ was previously declared here
bitboard.cpp:30:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:104:17: warning: type of ‘PseudoAttacks’ does not match original declaration [-Wlto-type-mismatch]
 extern Bitboard PseudoAttacks[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
                 ^
bitboard.cpp:41:10: note: array types have different bounds
 Bitboard PseudoAttacks[COLOR_NB][PIECE_TYPE_NB][SQUARE_NB];
          ^
bitboard.cpp:41:10: note: ‘PseudoAttacks’ was previously declared here
bitboard.cpp:41:10: note: code may be misoptimized unless -fno-strict-aliasing is used
bitboard.h:90:12: warning: type of ‘SquareDistance’ does not match original declaration [-Wlto-type-mismatch]
 extern int SquareDistance[SQUARE_NB][SQUARE_NB];
            ^
bitboard.cpp:27:5: note: array types have different bounds
 int SquareDistance[SQUARE_NB][SQUARE_NB];
     ^
bitboard.cpp:27:5: note: ‘SquareDistance’ was previously declared here
make[1]: Leaving directory '/home/tamas/Fairy-Stockfish/src'
ianfab commented 5 years ago

@gbtami Thanks for the report. As a first note, I would recommend to always do a make clean before switching between compilation of the normal and the large-board version, then the warnings you have seen should not appear. However, this most likely is not the reason for the segfault.

On Ubuntu 16.04 it works fine for me. If the segfault is reproducible for you, could you please collect a stacktrace, e.g., with gdb, and post it here?

make clean
make build ARCH=x86-64 COMP=gcc largeboards=yes debug=yes
gdb -ex run -ex bt --args ./stockfish bench shogi
gbtami commented 5 years ago

make clean did the trick, it's running OK now. Sry for the noise.

ianfab commented 5 years ago

Good to hear that it is working now. I will add a short note to the compilation instructions in the wiki.