compile as library