While Bradley Cooper, Jennifer Lawrence, Robert De Niro and Jacki Weaver ultimately jelled in their respective roles, they weren’t the helmer’s first choices when he undertook the project some five years ago.

Cooper, following word of his nomination in the leading actor category — his first Oscar bid ever — recounted to Variety that Anthony Hopkins once shared with him this wisdom about the twists and turns of acting: “You’re never the first choice.”

But Cooper and his castmates no doubt made Russell appreciate his ultimate choices for the roles.

The four thesps matched a feat that hasn’t happened since 1981, when Warren Beatty’s “Reds” landed noms for Beatty (lead actor), Diane Keaton (lead actress), Jack Nicholson (supporting actor) and Maureen Stapleton (supporting actress, a category she went on to win).

The film is also one of the few films to ever get nominated in all four acting categories as well as best picture, director and writing, joining a list that includes “Sunset Blvd,” “A Streetcar Named Desire,” “From Here to Eternity,” “Bonnie & Clyde,” “Guess Who’s Coming to Dinner,” “Network,” “Reds” and “Who’s Afraid of Virginia Woolf?”

Getting “Silver Linings Playbook” to this moment, however, took awhile.

“David loves actors, and these four actors were so deeply connected to the material,” Producer Josh Gordon told Variety after Thursday’s noms were announced. But there were other thesps initially lined up to make those connections.

Mark Wahlberg was all but set to play the part of Pat before falling out of the project. And prior to Lawrence coming on to the pic, Zooey Deschanel, Blake Lively and Anne Hathaway were all looked at for the role of Tiffany.

In fact, Russell said in previous interviews that had the film gotten into production when he first began working on it, Lawrence would not have made sense for the role, since she was only 16 at the time.

The long gestation ultimately helped the film, according to Russell, who adapted the material from Matthew Quick’s novel.

“It’s a very personal film to me, and the fact that it took five years to get it made means that much more,” Russell told Variety. “You benefit because you get to work harder on it and dig deeper to make it perfect.”

“Silver Linings” isn’t the only nominated film this year in which a casting change ended up spotlighting the thesp who replaced someone else. Jeremy Renner was initially tapped to play the part Joaquin Phoenix wound up playing in “The Master,” and during the long development of “Lincoln” Liam Neeson was attached to play the title character well before Daniel-Day Lewis came on.

‘Lincoln’ tops Oscar noms with 12 |

The nominations | The scorecard | Reactions to the nominations | Music brings contrasts, global view