Calculation of the free energy of crystalline solids