For caloric sufficiency, you're probably growing sweet potato or potato, at 70 Mcal/ha-day and 54 Mcal/ha-day, respectively. For a 2 Mcal/person-day diet, that's a minimum of 0.03 ha/person, or about 0.07 acre/person eating sweet potato. For potato, 0.04 ha/person, or 0.09 acre/person.
(http://www.fao.org/docrep/t0207e/T0207E04.htm)
Assuming at minimum that hydroponics provides 2.5x normal yield, and aeroponics 3.5x normal yield, one person eating exclusively aeroponically grown sweet potato would need 880 sq.ft. dedicated grow area, or 1.75x the example's (500/person) apartment floor area. If you can stack 4 levels of plants on one floor, that's still 1/3 of all building volume that would have to be occupied by growing plants.
Bear in mind that 2 Mcal/person-day is only enough to sustain children and little old ladies.
So ultralocal farming is probably not going to meet 100% of the needs of a building's residents without some extreme change in the way we design residential buildings. What you really want to grow on your roof is flavorful, nutrient-dense foods that are not quite durable enough for long-distance shipping. Then you ship the durable, bruise-resistant commodity staples from actual farms.
You eat your potatoes shipped in from the farm garnished with fresh green onion from your rooftop. You get your durum noodles from elsewhere, and eat it with sauce made from your rooftop tomatoes and herbs. Truck in the dry solid foods from far away, and grow the wet squishy foods as close as you can to your plate.