Fix #490: implement sophia_dir