The electronic band structures were calculated for a number of chalcopyrites in both the II-IV-V2 and I-III-VI2 families using the linear muffin-tin orbital method. From these band structures, the second harmonic generation coefficients were calculated using a recently developed methodology in which a separation is made of inter- and intraband contributions. We found that the high value of d36 in CdGeAs2 is in large part due to the fact, that in this material, unlike in the other chalcopyrites, almost no compensation occurs between inter- and intraband contributions, the former one being unusually small. For the case of ZnGeP2, a detailed investigation of the band structure, reveals that it has an indirect band gap rather than a pseudodirect one. The implications of this for the interpretation of the optical spectra are discussed. Finally, for the I-III-VI2 materials, we find that the Te based materials have far higher d36 than the selenides. Combined with their potential for non-critical phase matching, this makes AgGaTe2 an interesting compound.