To build the library, the Civilization that is building it needs to have acquired the Civilization Advance of Literacy and somehow rustle up 600 resource shields of production, a lot of gold, or a combination of the two.

In Civilization, the library expires with the advance of the University, and in Civilization II, with the advance of Electricity.