First-principles calculations of second-and third-order elastic constants for single crystals of arbitrary symmetry