Compile with threads