Nucleosynthesis in the early history of the solar system