IT TOOK LONGER to build President John Fitzgerald Kennedy's library than it took him to build his career.

But next Saturday, the Kennedy Library Museum on Boston Harbor will at last be dedicated and turned over to the U.S.government.Eighteen years of planning, bickering, controversy and frustration now seem worth it.

A breathtaking site, stunning architecture and arresting displays combine in what is hardly ever achieved these days -- an eloquent public monument.

The Kennedy Library Museum's designer is Ieoh Ming Pei & Partners, architects of the much praised East Building of the National Gallery of Art.

Pei's composition -- a triangle full of books and archives, two movie theaters in the round, a busy subterranean exhibition area, and a lofty glass pavilion pointing out to sea -- adds up to a statement that seems almost as moving, unified and simple as the marble obelisk we built on the Mall to honor George Washington.

But if Washington's memorial is a symbol in stone, JFK's memorial of glass and white concrete, filled with memorabilia, electronic sound and photographic sight, is living drama. It shows us a man turned to legend, a piece of our time distilled into heroic art.

The art evokes that heady sense of excitement that seized so many nearly two decades ago when the curtain rose on Camelot. And even those who were infants or not yet born when Kennedy died will share that enthusiasm.

More than three years ago, Stephen Smith, President Kennedy's brother-in-law and the head of the Library Corporation -- which includes all the members of the Kennedy family -- announced that the $12-million building would finally be completed this summer.

Smith made the announcement after citizen protests forced the Library Museum from a site on the Charles River near Harvard Square in Cambridge, Mass., where President Kennedy had wanted it built. The citizens feared being drowned in traffic and a deluge of tourists.

After examining some 30 other locations, the Library Corporation reluctantly settled (with a one-vote majority, it was rumored) on what seemed a bleak promontory south of South Boston along Dorchester Bay.

It was mostly landfill -- 9.5 acres of it -- offered by Robert Wood, the president of the University of Massachusetts.

Not promising at first sight, perhaps.And yet no site could be more exhilerating for its purpose.

The snobbish old school tie with Harvard, to be sure, is gone. But Dorchester Bay, lined to one side with Boston's Promethean skyline, dotted with green islands, and focusing your view along a shipping lane that for nearly 200 years now has been called "President's Road," has a grandeur the dear old Charles River lacks.

The Kennedy people make much about their man's love for the sea to justify the site. But that sky, the ships and sailboats, the moddy water lapping at the bulkhead, need no justificatiion. And as to symbolism: It seems fortunate in reprospect that President Kennedy's shrine is no ivory tower among ivy-covered towers. His memorial stands in the beauty and ugliness, promise and failure, of America's late 20th-century environment.

You get there in a seven-minute taxi ride from Boston's Government Center (or a brief shuttle bus ride from the Columbia rapid transit station) along Morissey Boulevard, another messy American strip development. What catches your eye amidst the freeway loops, smokestacks and industrial structures, however, is that wonderful Boston Gas Company storage tank which, some years ago. Sister Corita Kent made so gloriously colorful.

Approaching the Library Museum, you pass a forbidding array of brick buildings, a University of Massachusetts campus, which looks like nothing so much as a Soviet chemical plant.

Next, a sewage pumping station -- a sweet little building constructed in 1897 in neo-Romanesqe style -- comes into view. Beyond that, edging the property, is a horrid public housing project, crime-ridden and half deserted when, in 1975, the Library Corporation accepted the site.

Behind you is the Boston skyline, and you sense the presence of the harbor.

The air drones with the incessant noise of nearby Logan airport. Although the view of the Bay makes up for it all, the Library Corporation's disappointment was understandable.

"We have to create our own environment," Pei said at the time.

Landscape architect Dan Kiley helped. He molded the dump into natural looking hills and dales. He planted a profusion of pines, bayberries, wild roses and other flora you would think only God could plant. He placed heaps of boulders along the concrete bulkhead and built a walkway atop it.

The driveways and tree-shaded parking lots are blended into this scenery which clothes the building, as it were, and provides a processional approach.

The building is I.M. Pei's fifth design for the Kennedy Library. The first four were scrapped because they were too expensive and grandiose and because of the changed location.

Like all of Pei's recent work, notably the National Gallery East Building, the Library is a cerebral exercise in geometry, constructed with luxurious attention to detail.

Pei's geometry, precisely worked out with his associate Ted Musho, is simple in concept, becomes incredibly complex in all its refinements, and appears simple again once you see the building as a whole.

There are three distinct elements: The 110-foot-high triangular library tower; the museum; and the soaring pavilion, which half embraces the first two elements like a cape on a man.

The pavilion is astonishing. It is just glass-enclosed space, much like a cathedral, left vacant to be filled with the emotions of the people who enter it. The tinted glass is held up, even on its roof, by a spaceframe, a three-dimensional web of metal tubes that needs no structure to support it.

The tower and drum are gleaming white, clad in concrete panels, so metriculously cast that they resemble white marble.

The complexity appears in the way these three simple elements and their adjacent terraces and stairs emerge from the ground and interlock into one strange form. But, as at the East Building, once you enter the building and perceive how it all works, it seems simple again. The strange form becomes convincing. Once you take in the beauty and craftsmanship of such details as the polished steel entrance doors or the exterior granite stairway that hugs the building as it takes you down to the water, the building has won your affection.

As in Colonial Williamsburg style, JFK Library visitors are first processed through twin theaters to see a 25-minute film produced by Charles Guggenheim.

The theaters empty onto the floor below, where a series of exhibits, designed by graphic artists Ivan Chermayeff and Tom Geismar, in collaboration with Kennedy family members and friends, explore various aspects of the president's private and public life. One slide show depicts a day in the president's life (September 25, 1962). Another shows excerpts from press conferences. Still another illustrates his program for the mentally retarded.

There are more than 750 photographs and more than 3,000 objects from personal scrapbooks and collections. There are larger-than-life color transparencies. There is something for everyone -- from Jacqueline Kennedy's dresses to a U.S. marshal's helmet dented in a civil-rights demonstration.

There are culture and humor, schmaltz and grandeur, pictures of celist Pablo Casals and astronaut Alan B. Shepard Jr.

There is much about Robert F. Kennedy.

From all this, you step into that vast glass enclosure looking out on the open ocean.

Dry-docked in the foreground is the "Victura," President Kennedy's sailboat. Behind you is the library tower with a concave wall of window ribbons, an architecture tour-de-force. The tower holds 13,657 momentoes, to say nothing of six million feet of motion picture film, tapes of some 1,000 oral history interviews and a large room of manuscripts and other papers of Ernest Hemingway's donated by his widow.

The idea for a Kennedy Library was first voiced in November 1961, by the president himself. He wished, he announced, to follow the precedent established by Franklin D. Roosevelt and donate his papers and memorabilia to the National Archives. He asked his friends to build a library to house them. The library was to be associated with Harvard University.

In October 1963, on his last visit to Boston, Kennedy, accompanied by architect John Carl Warnecke, looked at several sites. He was most attracted by the car barn of the MBTA (Metropolitan Boston Transit Authority), which blighted the entrance to Harvard. Twelve years later, when, after endless complications, this site had finally become available, the Library Corporation lost it to Cambridge citizen opposition.

I.M. Pei entered three years after Dallas, when Kennedy's widow -- assisted by her friend William Walton, a painter and then chairman of the Washington Fine Arts Commission -- was looking for an architect for the library. She interviewed 18 world renowned architects, including Mies van der Rohe and Louis Kahn, but finally selected Pei, who was little-known at the time. "Pei's work, as John Kennedy's in 1960, was yet to come," Mrs. Kennedy said.

It did: Pei got such prestige jobs as the National Gallery because he had been chosen for the JFK Library.

At the ceremony next Saturday, Sen. Edward M. Kennedy will transfer this family shrine to the National Archives and Record Service of the General Services Administration, which administers the presidential library system.

The Library will finally open 18 years after President Kennedy first asked for it. It took him only 14 years from the time he was first elected to Congress to become president. The Lyndon B. Johnson Library in Austin, Tex., in contrast, was dedicated in May 1971, two years before Johnson died on Jan.11, 1973.

The money to build the Library was collected from the pennies of school children, the donations of corporations, and the grants of foundations. Library director Dan H. Fenn Jr. says that some 30 million people from all over the world contributed.