General compilation framework working