Throughout the late 1980s, Barack Obama dated a half-Dutch, half-Japanese woman two years his junior named Sheila Jager. During a weekend away, his friends caught a glimpse of how passionate a person young Obama could be — and how that passion could get out of hand.

The couple “went back and forth, having sex, screaming yelling, having sex, screaming yelling,” to the point where those nearby had to move “to the other side of the porch just to be able to talk,” according to “Rising Star: The Making of Barack Obama,” by David J. Garrow, out Tuesday.

“Rising Star” portrays young Obama as determined and inquisitive, while conflicted about his roles as a man and as an African-American. Both factored heavily into his early relationships — and his romantic destiny.

Obama first met Alex McNear at Occidental College, where he wrote poems for a literary magazine she ran. He moved to New York to attend Columbia, and they began dating there in June 1982, becoming “very close.” McNear recalled Obama’s apartment, a sixth-floor walk-up at East 94th Street and First Avenue, as “ ‘sparsely decorated,’ with ‘very little furniture’ and remembers ‘opening the refrigerator and seeing like virtually nothing in there.’ ”

McNear returned to Occidental in September, and from there their relationship was conducted mostly through letters that reveal much about Obama’s state of mind at the time. He had literary aspirations, and his correspondence was often flowery and verbose.

“I trust you know that I miss you, that my concern for you is as wide as the air, my confidence in you as deep as the sea, my love rich and plentiful,” he wrote. “Please comfort me with another letter when you get a chance.”

Based on his letters to McNear, Obama was in a questioning phase, contemplating the nature of gender roles and his own male ego.

In one letter, after complimenting McNear’s writing, he admits that “mixed in with those feelings are bits and pieces of envy, uncertainty, some intimidation . . . the prejudiced, frightened male makes its atavistic appearance.”

Later, referencing a previous conversation, he wrote, “my insistence rises from my fear of emasculation, that if I can’t be cruel any longer, then I must not be a man.” He added, “betrayal lies in separation . . . because the initial act of separation has traditionally been from the mother, men’s retaliation is indeed towards women.”

Racial issues were on Obama’s mind as well. “There is a reason why western man has been able to subjugate women and the dark races,” he wrote to McNear. “The ideology they present is backed by a very real power.”

McNear wondered if expressing such views to her was “as close as he could get to intimacy.” Obama, she later said, “seemed to be incapable of bringing a relationship into the rest of his world.”

The beginning of the end for the couple came via an angry missive, possibly in response to something McNear had written that September.

“When I see you, the palpitations of the heart don’t boil to the surface,” he wrote. “I care for you as yourself, nothing less but also nothing more . . . When I sit down to write I no longer feel the need to bleed for brilliance on the page.” Shortly after he sent this, the pair drifted apart.

‘Intercourse was pleasant, and in bed “he neither came off as experienced or inexperienced. Sexually he really wasn’t very imaginative, but he was comfortable.'”

Soon after, Obama met Genevieve Cook, a 25-year-old graduate student, at a party in the East Village. Like Obama, Cook spent part of her childhood in Indonesia, and the two bonded over their “expatriate similarities.”

The following week, Cook met Obama at his apartment, where he cooked her dinner, and she spent the night, later writing it felt “very inevitable.” After their second night together, Cook wrote in her journal, “I have not experienced the kind of intellectual stimulation Barack offers me since I left college.”

Over the following month, Cook kept a chronicle of their time together, including intimate details.

“Intercourse was pleasant, and in bed ‘he neither came off as experienced or inexperienced,’ she later recalled. ‘Sexually he really wasn’t very imaginative, but he was comfortable. He was no kind of shrinking “Can’t handle it. This is invasive” or “I’m timid” in any way; he was quite earthy.’ ” Cook wrote two poems for him. One, “in alphabetical form, progressed from ‘B. That’s for you’ to ‘F’s for all the f—ing that we do’ to ‘L I love you . . . O is too.’ ”

The pair would party with friends. At times, both would snort cocaine, Garrow writes, although Obama seemed to be doing it more for the social bonding experience than for any lasting affinity for the drug.

“Barack’s ambivalence about those activities was crystal clear to Genevieve,” Garrow writes. “Sometimes Barack would beg off, but most times he asked Genevieve to come along . . . knowing that one or both would try to leave before the evening got ‘too out of control and manic.’ ”

Cook found him loving but at times aloof, writing that he “talked of drawing a circle around the tender in him . . . I think he also fights against showing it to others, to me.”

Her feelings toward him were clearer.

“It means so much more than lust, all this f—ing we do,” she wrote, then followed up several nights later by writing about “making love with Barack, so warm and flowing and soft but deep — relaxed and loving — opening up more.”

Later, writing that she was falling in love with him, she described their sexual relations as “really communicating instead of merely getting off.”

Still, Obama could be distant, with Cook referring to a “coolness” in him toward her. This might have been partially racial, as Cook was white and Obama was wrestling with his place in the racial firmament.

“Detecting a ‘deliberate distancing’ on his part, she wrote, ‘I think I am probably being rejected more for what I represent in Barack’s mind than for who I am.’”

“She imagined that Barack would be more comfortable with a black woman,” Garrow writes.

Obama’s ambivalence about gender roles, burnished with a healthy dose of male ego, also may have been a factor.

Once, enjoying the summer weather in Prospect Park, Cook challenged him to a running race, and “to his utter amazement and chagrin,” Cook won.

“Barack couldn’t really believe it,” she said, “and continued to feel a bit unsettled by it all weekend. Being beaten by a woman really unsettled him.”

Cook and Obama lived together briefly in Park Slope, but by May 1985, the relationship had deteriorated. At one point, Cook told a friend, of Obama, “I just wanted to chop his d–k off. I called him a prick.” She said she has since forgotten what made her so angry.

Toward the end of their relationship, Cook wrote a poem about Obama that included the lines, “You masquerade, you pompous jive, you act, but clothes don’t make a man, and I know you just coverin’ a whole lot of pain and confusion.”

‘Barack’s political destiny meant that he and Sheila could not have a long-term future together, no matter how deeply they loved each other … he felt trapped between the woman he loved and the destiny he knew was his.’

In May 1986 — a point at which Obama, then 24, told a friend he had gone almost a year without “female companionship” — he met Jager. The pair hit it off and Obama was smitten, writing that she had “specks of green in her eyes.”

They grew closer over the next few months, and soon moved in together. Within four months, they were flying out to California to spend Christmas with her family, and having serious discussions about marriage.

But racial considerations were growing in Obama’s mind, especially as he became more active in Chicago politics, and wrestled, as someone of mixed race, with his place in the black community.

Garrow notes that before asking Jager to move in with him, he asked intense questions of a colleague about “the long-term dynamics of interracial marriage and raising half-black, half-white children.”

According to Jager, Obama proposed in the winter of 1986, during the visit to her parents. But the trip did not go well, as Obama wound up in a heated political argument with Jager’s father, a conservative Republican.

The book doesn’t spell out the details of the dispute, but Mike Dees, a friend of Jager’s father and fellow conservative who was there, recalled that Obama “thought he was going to lecture to us … and we kind of shot him down.” By the end of the visit, Jager’s father made it clear he did not approve of Obama marrying his daughter, and marriage talk was put on hold.

Throughout 1987, Jager noticed a change in Obama, watching him become a “powerfully ambitious person,” and someone “quite extraordinary.”

By this time, Jager said, he “already had his sights on becoming president.” This included a belief that he had “a calling,” and “a heightened awareness that to pursue it he had to fully identify as African-American.”

“‘There was a problem there,’ Mike [Dees] recalled. ‘He was concerned if he was going to take the steps to the presidency with a white wife.’”

“Barack’s political destiny,” Garrow writes, “meant that he and Sheila could not have a long-term future together, no matter how deeply they loved each other . . . he felt trapped between the woman he loved and the destiny he knew was his.”

The relationship collapsed in May 1988, when Jager, angry after an argument, read Obama’s journal.

Without sharing details, the book notes that Jager was particularly incensed about something he had written about someone else — another woman, presumably — and she moved out shortly thereafter. They continued dating for a time, and Obama even asked her to marry him a second time, as he prepared to leave Chicago for Harvard. But Jager, sensing desperation, said no.

In 1989, Obama took a summer job at Sidley & Austin, a Chicago law firm. A young lawyer there, just a year out of Harvard Law School, was assigned to be his adviser — Michelle Robinson.

They met on his first day of work. Despite his “bad sport jacket” and the “cigarette dangling from his mouth,” she found him to be “cute . . . articulate and impressive.” His take on their meeting was stronger, with him telling a friend, “My mentor is really hot.” While Robinson was initially reticent to date him due to their working together, Obama was smitten and pursued her, and they began seeing each other.

Even so, Obama continued to see Jager on and off throughout 1990, when he was already dating Robinson. “I always felt bad about it,” Jager later said.

Obama and Jager finally drifted apart for good, and Robinson went on to become Michelle Obama when she married the future president on Oct. 3, 1992.

This marked the end of Obama’s dating life, but while he and Michelle were clearly in love, some believe the marriage served another function as well.

According to “one local African-American scholar” who was not alone in this belief, marrying Michelle was “the single most important step that he was to make in his journey to define himself and reconcile his search for racial identity.”