NEW YORK • About a decade ago, libraries across the world faced a dilemma. They were being replaced by Amazon and e-books.
To fight for their survival, said Ms Loida Garcia-Febo, president of the American Library Association, libraries tried to determine what other role they could play.
In the past few years, dozens of new libraries have opened around the world. To attract visitors, many feature advanced, even quirky, amenities.
Here is a look at some of the newest and most creative libraries. Helsinki Central Library in Finland: Only one-third of the 185,000 sq ft space is allocated to books - the rest is community space for meetings and activities.
An urban workshop on the second floor, for example, has sewing machines, scanners and printers as well as laser cutters and soldering stations, with spaces allocated to sewing, making badges and even playing the drums. Calgary New Central Library in Canada: It has train tracks running through it, as the site was designed to accommodate an active Light Rail Transit Line that already existed.
The lobby is an arched bridge that lets locomotives go under it and in "living rooms", patrons can sit on swirly chairs and watch them zoom by all day.
On lower floors, there are two cafes, a teen centre, a children's space and a 320-seat theatre.
The highest floor is the Great Reading Room, a more traditional library space surrounded by wooden planks. Qatar National Library in Doha: Its design, by Dutch architect Rem Koolhaas, is eye-catching, but so is its programming.
Every month, the Qatar Philharmonic Orchestra performs for free.
This is only one of the 80 to 90 free events the library holds monthly. One of the most popular activities is a knitting group. Tianjin Binhai Library in China: It has everything you would expect from a library: reading rooms, learning spaces, book storage and a large archive.
But the majority of guests visit from all over the world to see the fantastical architecture created by Dutch firm MVRDV and architects from Tianjin Urban Planning And Design Institute.
"I think for the first week, the library had about 10,000 visitors a day," said Mr Winy Maas, a founding partner with MVRDV and the architect responsible for the library. "People were lining up in the street to enter."
The 363,000 sq ft space is painted floor to ceiling in pure white. In the middle of the space is a spherical auditorium nicknamed "the eye".
Around it are undulating floor-to-ceiling shelves that form waves. Central Library in Austin, Texas: It opened with the Texas belief that bigger is always better. With six floors and 200,000 sq ft of space, it is twice the size of the former Old Faulk Central Library.
The library sits next to Shoal Creek and Lady Bird Lake, areas of natural beauty. Many amenities take advantage of the location by focusing on the outdoors.
Wrap-around porches serve as reading rooms. The children's room has a reading porch adjacent to it and a giant chess set just outside.
One of the quirkier features of the new library is a "technology petting zoo" on the fifth floor where visitors can play with new gadgets.
They can draw on tablets, test Philips Hue smart Wi-Fi lights, create their own model on a 3D printer or record a song on a Spire Studio.