Question. Let $\mathfrak{g}$ be a real semisimple Lie algebra admitting an invariant inner-product. Is every connected Lie group with Lie algebra $\mathfrak{g}$ compact?
I know that the converse is true: If $G$ is a compact connected Lie group, then the Haar measure may be used to give an invariant inner-product on $\mathrm{Lie}(G)$. Also, semisimplicity is necessary since $\mathrm{Lie}(\mathbb{R})=\mathbb{R}$ trivially admits an invariant inner-product.
Yes, that's true: If $\langle-,-\rangle$ is an invariant inner product on ${\mathfrak g}$, then $\text{Aut}({\mathfrak g})^{\circ}\subset\text{O}({\mathfrak g},\langle -,-\rangle)$ is at least some compact Lie group with Lie algebra ${\mathfrak g}$. Next, the fundamental group of a compact semisimple Lie group is finite (see e.g. https://mathoverflow.net/questions/95637/connected-compact-semisimple-lie-group-finite-fundamental-group), and applying this to $\text{Aut}({\mathfrak g})^{\circ}$ shows that the simply connected Lie group with Lie algebra ${\mathfrak g}$ - call it $\widetilde{G}$ - is compact, too. Finally, an arbitrary connected Lie group $G$ with Lie algebra ${\mathfrak g}$ is a quotient of $\widetilde{G}$, hence compact.