Interatomic potentials from first-principles calculations