user15636: 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 << 14,
  ENPASSANT = 2 << 14,
  CASTLING  = 3 << 14
};

enum CastlingRights {
  NO_CASTLING,
  WHITE_OO,
  WHITE_OOO = WHITE_OO << 1,
  BLACK_OO  = WHITE_OO << 2,
  BLACK_OOO = WHITE_OO << 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?

user13230: Without reviewing the complete code (which is probably humongous), it is difficult to give a proven right answer.
However, it should work if you replace the lines for the black castling possibilities by BLACK_00 = 0, BLACK_000 = 0, (or respectively for the white, if you want). This should lead to all tests in the code returning 'black castling not possible', which is the intention.

user4182: 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.

15636: <p>For artistic purposes, I would like to create and study engine games in which only one side is able to castle.</p>
<p>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.</p>
<p>I have gone through the <a href="https://github.com/official-stockfish/Stockfish/blob/master/src/types.h" rel="nofollow noreferrer">types.h</a> file and found the following:</p>
<pre><code>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
};
</code></pre>
<p><strong>What can I do to disable castling in moves and calculations of Stockfish?</strong></p>
 13230: <p>Without reviewing the complete code (which is probably humongous), it is difficult to give a proven right answer.</p>
<p>However, it should work if you replace the lines for the black castling possibilities by <code>BLACK_00 = 0, BLACK_000 = 0,</code> (or respectively for the white, if you want). This should lead to all tests in the code returning 'black castling not possible', which is the intention.</p>
 4182: <p>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</p>
<p><code>rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w kq - 0 1</code></p>
<p>and the FEN for the initial position without castling rights for Black is</p>
<p><code>rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQ - 0 1</code></p>
<p>The FEN can be entered into Stockfish using the UCI command</p>
<p><code>position fen FEN</code></p>
<p>where <code>FEN</code> should be replaced by the FEN in question.</p>
