A sawmill or lumber mill is a facility where logs are cut into lumber. Before the invention of the sawmill, boards were made in various manual ways, either rived (split) and planed, hewn, or more often hand sawn by two men with a whipsaw, one above and another in a saw pit below. The earliest known mechanical mill is the Hierapolis sawmill, a Roman water-powered stone mill at Hierapolis, Asia Minor dating back to the 3rd century AD. Other water-powered mills followed and by the 11th century they were widespread in Spain and North Africa, the Middle East and Central Asia, and in the next few centuries, spread across Europe. The circular motion of the wheel was converted to a reciprocating motion at the saw blade. Generally, only the saw was powered, and the logs had to be loaded and moved by hand. An early improvement was the development of a movable carriage, also water powered, to move the log steadily through the saw blade.
By the time of the Industrial Revolution in the 18th century, the circular saw blade had been invented, and with the development of steam power in the 19th century, a much greater degree of mechanisation was possible. Scrap lumber from the mill provided a source of fuel for firing the boiler. The arrival of railroads meant that logs could be transported to mills rather than mills being built besides navigable waterways. By 1900, the largest sawmill in the world was operated by the Atlantic Lumber Company in Georgetown, South Carolina, using logs floated down the Pee Dee River from the Appalachian Mountains. In the 20th century the introduction of electricity and high technology furthered this process, and now most sawmills are massive and expensive facilities in which most aspects of the work is computerized. Besides the sawn timber, use is made of all the by-products including sawdust, bark, woodchips, and wood pellets, creating a diverse offering of forest products.