We use a recently developed ab initio approach to calculate the lattice thermal conductivities of compound semiconductors. An exact numerical solution of the phonon Boltzmann transport equation is implemented, which uses harmonic and anharmonic interatomic force constants determined from density functional theory as inputs. We discuss the method for calculating the anharmonic interatomic force constants in some detail, and we describe their role in providing accurate thermal conductivities in a range of systems. This first-principles approach obtains good agreement with experimental results for well-characterized systems (Si, Ge, and GaAs).We determine the intrinsic upper bound to the thermal conductivities of cubic aluminum-V, gallium-V, and indium-V compounds as limited by anharmonic phonon scattering. The effects of phonon-isotope scattering on the thermal conductivities are examined in these materials and compared to available experimental data. We also obtain the lattice thermal conductivities of other technologically important materials, AlN and SiC. For most materials, good agreement with the experimental lattice thermal conductivities for naturally occurring isotopic compositions is found. We show that the overall frequency scale of the acoustic phonons and the size of the gap between acoustic and optic phonons play important roles in determining the lattice thermal 2 conductivity of each system. The first-principles approach used here can provide quantitative predictions of thermal transport in a wide range of systems. 63.20.kg,