Elastic constants of crystals from linear-response theory.