French police began clearing around 1,000 migrants from a gymnasium near the northern port of Dunkirk after a court ruled it was a health and security hazard.