- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to figure out whether there is a difference between the -threads and the -pthread compiler option to IFORT. If there is a difference, what is it? Does it make sense to provide both options during compilation, or are they incompatible?
Also, if one of those options (or both) are used during compilation of one piece of code, does the same option have to be specified during linking?
Thank you,
-Gerhard
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
These are two different options, neither of which you need. -threads is obsolete and does nothing useful at this time. In the past it said that you wanted to use the thread-safe version of the language support library, but for four or five years now there is only a thread-safe version.
-pthreads is an alternate spelling of -reentrancy threaded, which tells the language support library to support a threaded application. This is the default.
Neither of these affect parallelism of your application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the explanation. Good to have it clarified that both options are basically the default now. The code I am working with calls Fortran routines from inside Pthreads that were created by a C layer. It sounds like specifying both -pthread and -threads options when compiling the Fortran portions of the code makes sense - albeit redundant with the current defaults.
-Gerhard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My preference is to not specify options you don't need. They can be confusing to others when they try to understand your build environment.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page