Preheat oven to 350° and grease an 8- by 8-in. baking pan. Melt butter and let cool. Whisk together flour, cinnamon, ginger, nutmeg, cloves, salt, and brown sugar. Stir in oats, raisins (if using), and pecans, then stir in melted butter.
Toss apricots with lemon juice and granulated sugar and spread in baking pan. Squeeze topping into shaggy chunks and scatter over apricots. Bake until bubbling, 40 to 50 minutes; cool at least 30 minutes, and serve with vanilla ice cream.
Note: Nutritional analysis is per serving.