I'm not sure exactly where I've seen it, but I've read things suggesting that the Giza Plateau was a sacred location with astronomical associations long before the pyramids were built over the existing observation points. (It may have been one of those books which argues that the Sphinx is much older than the pyramids and originally involved nothing more than crude reshaping of a lion-like rock formation.)
My best guess would be that the building of grandiose stone monuments went along with the rise of wealthy local elites in the late Neolithic and early Bronze Age -- but that the sites themselves had been sacred for thousands of years.
Recent studies suggest that even the Australians were creating simple solar observatories 10,000 years ago -- and if they could do it without even the resources of an agricultural society, I suspect that every other culture in the world had the necessary knowledge as well.
http://www.dailymail.co.uk/sciencetech/article-1353719/Were-Aborigines-astronomers-Tribes-carefully-arranged-rocks-map-progress-sun-10-000-years-ago.htmlScientists are ecstatic following the discovery of the carefully arranged rocks, discovered on a farm near Mount Rothwell, 50 miles west of Melbourne.
For they are convinced the large stones have been laid out to map the progress of the sun - to create a primitive form of sundial. . . .
Professor Norris said the Aborigines who laid out the stones would have made their crude ground map around 10,000 years ago - thousands of years before Stonehenge and the pyramids of Egypt.
Scientific studies are continuing on the rocks, which have been laid out in a semi-circle, with two points set in perfect alignment with the setting sun on a midsummer's day.