Intel® Fortran Compiler XE 13.1 User and Reference Guides
To build a multithread application that uses the Fortran run-time libraries, specify the -threads (Linux* OS and 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. (Some libraries, such as those for OpenMP* or coarrays, are always linked dynamically.)
The following applies to Linux OS and 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 (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 is 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:
Make sure your IA32ROOT or IA64ROOT (Linux OS and OS X) or LIB (Windows) environment variable points to the directory containing your library files.
Compile and link the program with the -threads (Linux OS and OS X) or /threads (Windows) compiler option.
For example:
ifort -threads mythread.f90 (Linux OS and OS X)
ifort /threads mythread.f90 (Windows OS)
To compile and link your multithread program using the IDE (Windows OS):
Create a new project by clicking File > New > Project.
Click Intel® Visual Fortran Projects in the left pane to display the Intel Fortran project types. Choose the project type.
Add the file containing the source code to the project.
From the Project menu, select Properties.
The Property Pages dialog box appears.
Choose the Fortran folder, Libraries category, and set the Runtime Library to Multithreaded or Multithread DLL (or their debug equivalents).
Create the executable file by choosing Build Solution from the Build menu.