Synthesis, and magnetic and optical properties of nanocrystalline alkaline-earth hexaborides