Got advanced compilation mostly working