Charm production at RHIC to O(αs3)