Photodimerization of anthracene derivatives in their neat solid state and in solid molecular compounds