Chalcopyrite forms under a variety of conditions. Some is primary, crystallizing from melts as accessory minerals in igneous rocks. Some forms by magmatic segregation and is in the stratified rocks of a magma chamber. Some occurs in pegmatite dikes and contact metamorphic rocks. Some is disseminated through schist and gneiss. Many volcanogenic massive sulfide deposits containing chalcopyrite are known.
The most significant chalcopyrite deposits to be mined are hydrothermal in origin. In these, some chalcopyrite occurs in veins and some replaces country rock. Associated ore minerals include pyrite, sphalerite, bornite, galena, and chalcocite.
Chalcopyrite serves as the copper source for many secondary mineral deposits. Copper is removed from chalcopyrite by weathering or solution, transported a short distance, then redeposited as secondary sulfide, oxide, or carbonate minerals. Many malachite, azurite, covellite, chalcocite, and cuprite deposits contain this secondary copper.
