Dear Sr, to calculate the formation energy of a compound you need to know the total energy of the compound and the total energy of each pure element (in its equilibrium state) that composes it. These energies can be calculated using Wien2k. See for example: