The optimal geometries of (CaO)n and (MgO)n clusters at n = 2–30 have been found and the enthalpies of formation of 1D, 2D, and 3D structures have been determined using quantum-chemical DFT calculations. The calculation demonstrates that the formation of linear chains of Ca and Mg oxides practically does not occur, while the formation of two-dimensional (tiled) and three-dimensional (cubic) structures proceeds with a large release of energy. The competing process of formation of molecular rods consisting of planar six-membered rings (MO)3 has been considered, and it has been shown to proceed not through the stage of preliminary formation of six-membered rings, but directly from monomer units.