compile multi threads