To build a multithread application that uses the Fortran run-time libraries, specify the -threads (Linux* OS and Mac OS* X) or /threads (Windows* OS) compiler option from the command line. For Windows systems, you can use also use the Microsoft integrated development environment (IDE), as described later in this topic.
You must also link with the correct library files.
The following applies to Linux OS and Mac OS X:
To create statically linked multithread programs, link with the static library named libifcoremt.a. To use shared libraries, link your application with libifcoremd.so (Linux OS) or libifcoremd.dylib (Mac OS X).
The following applies to Windows OS:
To create statically linked multithread programs, link with the re-entrant support library LIBIFCOREMT.LIB. To use shared libraries, use the shared LIBIFCOREMD.DLL library, which also re-entrant, and is referenced by linking your application with the LIBIFCOREMD.LIB import library.
Programs built with LIBIFCOREMT.LIB do not share Fortran run-time library code or data with any dynamic-link libraries they call. You must link with LIBIFCOREMD.LIB if you plan to call a DLL.
Additional Notes for Windows OS:
The /threads compiler option is automatically set when you specify a multithread application in the visual development environment.
Specify the compiler options /libs=dll and /threads if you are using both multithreaded code and DLLs. You can use the /libs=dll and /threads options only with Fortran Console projects, not QuickWin applications.
To compile and link your multithread program from the command line:
ifort -threads mythread.f90 (Linux OS and Mac OS X)
ifort /threads mythread.f90
(Windows OS)
To compile and link your multithread program using the IDE (Windows OS):