build as a dynamic lib