Ab-initio optical spectra of complex systems