Use of barium carbonate to inhibit sulfate attack in cements