First-principle lattice dynamics and thermodynamics of crystals