Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28602 Discussions

how to compile&link if my main program is parallel with openmp

xsxcn
Beginner
219 Views
I have several files(for example, sub1.f90, sub2.f90, main.f90). Only the main.f90 contains openmp sentence. How should I compile and link? Suppose for some reason, I need to ifort 'sub1.f90' and ifort 'sub2.f90' first. thus, I need to compile like:
ifort [options] sub1.o sub2.o main.o -o run
0 Kudos
1 Reply
TimP
Honored Contributor III
219 Views
If you declare all the subroutines and functions with RECURSIVE, any options you choose will be compatible with -openmp. Otherwise, you must build them all with -auto or -openmp so that they don't default to local static arrays. You will need the -openmp for the compilation of main.o and for the final link.
0 Kudos
Reply