Compactications defined by arrangements II: locally symmetric varieties of type IV