We present theoretical studies for the third-order elastic constants of Mg, Be, Ti, Zn, Zr, and Cd with a hexagonal-close-packed (HCP) structure. The method of homogeneous deformation combined with first-principles total-energy calculations is employed. The deformation gradient
F
i
j
is applied to the crystal lattice vectors
r
i
, and the elastic strain energy can be obtained from the first-principles calculation. The second- and third-order elastic constants are extracted by a polynomial fit to the calculated energy-strain results. In order to assure the accuracy of our method, we calculated the complete set of the equilibrium lattice parameters and second-order elastic constants for Mg, Be, Ti, Zn, Zr, and Cd, and our results provide better agreement with the previous calculated and experimental values. Besides, we have calculated the pressure derivatives of SOECs related to third-order elastic constants, and high-pressure effects on elastic anisotropy, ductile-to-brittle criterion, and Vickers hardness are also investigated. The results show that the hardness model
H
v
=
1.877
k
2
G
0.585
is more appropriate than
H
v
=
2
k
2
G
0.585
−
3
for HCP metals under high pressure.