Compiling Stockfish to disable own castling while allowing opponent castling For artistic purposes, I would like to create and study engine games in which only one side is able to castle.
For this, I need to compile a version of Stockfish which never castles, and doesn't consider its own castling in its calculations, whereas calculates with castling for the opponent.
I have gone through the types.h file and found the following:
enum MoveType {
  NORMAL,
  PROMOTION = 1 &lt;&lt; 14,
  ENPASSANT = 2 &lt;&lt; 14,
  CASTLING  = 3 &lt;&lt; 14
};

enum CastlingRights {
  NO_CASTLING,
  WHITE_OO,
  WHITE_OOO = WHITE_OO &lt;&lt; 1,
  BLACK_OO  = WHITE_OO &lt;&lt; 2,
  BLACK_OOO = WHITE_OO &lt;&lt; 3,

  KING_SIDE      = WHITE_OO  | BLACK_OO,
  QUEEN_SIDE     = WHITE_OOO | BLACK_OOO,
  WHITE_CASTLING = WHITE_OO  | WHITE_OOO,
  BLACK_CASTLING = BLACK_OO  | BLACK_OOO,
  ANY_CASTLING   = WHITE_CASTLING | BLACK_CASTLING,

  CASTLING_RIGHT_NB = 16
};

What can I do to disable castling in moves and calculations of Stockfish?
There is no need to compile your own version of Stockfish for this.  Instead you can just start from a position that omits castling rights for one side or the other. The FEN for the initial position without castling rights for White is
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w kq - 0 1
and the FEN for the initial position without castling rights for Black is
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQ - 0 1
The FEN can be entered into Stockfish using the UCI command
position fen FEN
where FEN should be replaced by the FEN in question.