compile with -threaded