LOS ANGELES — There are some books you could never imagine on the big screen. “Infinite Jest,” for example, or “The Communist Manifesto.”

You might have added “Another … Night in … City” to that diverse list. A time-jumping memoir about homelessness and alcoholism, Nick Flynn’s 2004 cult hit doesn’t exactly scream Hollywood. As the actor Paul Dano puts it, “it’s nonlinear, poetic and not overtly dialogue-heavy.”

The filmmaker Paul Weitz, however, saw a movie in it. Upon reading “City” around the time of publication (the full title is unprintable in the newspaper), he and several producers were able to sell a project to Sony.

It was the beginning of an arduous trip. This weekend — after 30 screenplay drafts, eight years, three studios and one title change — a film version of that book, now called “Being Flynn” and starring Robert De Niro and Dano, hits theaters.

The story told by Flynn, who now works mainly as a teacher and poet, is a compelling one. The author grew up estranged from his father, an alcoholic con man who had spent time in prison. At 22, the younger Flynn endured the suicide of his mother. Several years later, he found himself working at a high-stress job at a homeless shelter. (The book takes place in Boston, but the movie has been relocated to New York.)

His father, Jonathan — a narcissistic, loquacious, larger-than-life dilettante convinced he is one of the world’s great writers — turns up as a client at the shelter one day, his life having taken a difficult turn. Nick, who at the time struggled with alcoholism and addiction himself, must decide how much of his father’s foibles he’s willing to overlook in the name of reconciliation.

Weitz, who is best known for comedies such as “American Pie” and “About a Boy,” found a universal human element in the story.

“The book felt like a fable of that utterly recognizable circumstance where a guy [is] in a pressure-cooker situation that’s destabilized by something,” he said. “It’s also the quintessence of everybody’s experience in mythologizing their parents: Are we fated to become our parents, and can we do anything to change that?”

After Sony decided to pass (at one point the movie’s budget was estimated at $30 million, a nearly impossible number for a quirky drama), the project moved to Fox 2000, the label behind bonbons such as “The Devil Wears Prada.” There the project attracted De Niro while the script went through more drafts, some of them to make the movie, as De Niro says, “more sitcom-y.”

Weitz kept writing and rewriting, in part to satisfy studio overlords but mostly, he says, because he wanted to hone the script’s more delicate moments. De Niro said he didn’t have any doubts about sticking with the director.

“I hate the word ‘passion’ but Paul did really feel passionate about it,” he said. “Even when I didn’t understand exactly what it would end up being about, I knew that Paul knew what it was going to be, and that would give it a special feel.”

The movie finally landed about three years ago at Focus Features, a subsidiary of Universal Pictures, which badly wanted De Niro and Weitz to make the comedy sequel “Little Fockers.”

The conventional Hollywood wisdom is that the parties came to a kind of package understanding — Focus would make “Flynn” if Weitz and De Niro agreed to make “Little Fockers” — though Weitz’s producing partner, Andrew Miano, demurred somewhat, saying that “it wasn’t exactly a ‘one for us and one for them’ situation.”

Whatever the agreement, the film was reconceived as a drama with a more modest budget (less than $10 million). Dano came aboard, and they were off.

Throughout the process, Weitz got counsel from Flynn, now in his early 50s, on the world he and his father once occupied.

Flynn was on set the entire length of the shoot and also took the director on several trips to Boston to visit homeless shelters, the two riding with an all-night rescue van and visiting men and women who were sleeping on the street. On one occasion, they were talking at 2 a.m. to a homeless person who had set up camp inside a bank vestibule when a group of hooligans came up to the glass and started banging on it, shouting threats and epithets. The moment made it into the film.

On another occasion, Flynn took De Niro to visit his father, who now resides in an assisted-living facility in Boston.

“I remember he was unimpressed by De Niro,” recalled Flynn. “In his own mind, my father had already cast the movie version of his life back in the 1970s, and there were only two people who could play Jonathan Flynn: Dustin Hoffman and Jonathan Flynn.”

De Niro said he actively tried not to go over the top in portraying the flawed father. “I can see it as a character that would chew up the scenery, but I thought there was another way to do it,” he said.

Flynn, who is married to the actress Lili Taylor (she has a small part in the movie), tried to keep a level head as the project took its lumps.

“The rhythms of Hollywood seemed so comical — you don’t hear anything for a year, and then for a week you’re the most important person in the world, and then you don’t hear anything for another year,” the author recalled. “But my wife kept telling me that this is Hollywood. No one should ever get excited until they’re sitting in front of the camera.”

Weitz had his own way of coping. He made three movies during the time it took to get “Flynn” into production. In the last one, “Fockers,” he endured what one person familiar with the process describes as disagreements with Ben Stiller in the editing room, and re-shoots and elaborate back-and-forth that can infect a major Hollywood franchise.

Weitz didn’t explicitly say it was a relief to work on a more independent-minded film such as “Flynn.” But he did note that it offered a parallel to his career. “This movie is about having dignity in your work in extreme and undignified circumstances. I think one of the things that was helpful to me was by the time I got to make this movie, I had learned a lot of lessons.”