compile as dynamic lib