Is one obligated to build a fence for their roof nowadays?
One is obligated to build a fence that is strong enough to prevent someone from falling.
This is governed by both a a מצות עשה and לא תעשה, as it says in the Torah דברים כב, ח) ועשית מעקה לגגך and ולא תשים דמים בביתך.
This applies to any house that human beings dwell, except the synagogue.
Since our roofs are unused and hence no one will be in harms way, you do not need to build a fence.
אדה״ז הלכות שמירת גוף ונפש ובל תשחית א.