libpart code generation