Compile as lib