It's also produced by honeybees to mark the location of their hives & nectar-bearing plants. It's part of a group of terpenes called 'monoterpenes', all of which have both medical & cosmetic applications, & generally smell pretty damn awesome.
Geraniol isn't the only compound that makes roses smell as they do; there's a whole bunch of others, particularly citronellol. See some info here on what's in a rose: https://books.google.com/books
So hey, #TIL about citronellol too. Here's the Wikipedia article on it - yeah, it's Wikipedia, check the bibliography. https://en.wikipedia.org/wiki/Citronellol
Here's more chemical info on citronellol: https://pubchem.ncbi.nlm.nih.gov/compound/3_7-dimethyloct-6-en-1-ol
& here's a fun article from the American Chemical Society on some of the important molecules that make roses smell like roses: https://www.acs.org/molecule-of-the-week/archive/c/citronellol.html
Here's a paper on recent developments in the use of monoterpenes: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7582973/