The total synthesis of a natural product HDAC inhibitor, spiruchostatin B, was successfully achieved. A 5-step synthesis that included an asymmetric aldol reaction was carried out in an automated synthesizer to provide an (E)-(S)-3-hydroxy-7-thio-4-heptenoic acid segment that is the crucial structure of cysteine-containing, depsipeptidic natural products such as spiruchostatins, FK228, FR901375, and largazole for their inhibitory activity against HDACs.