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

Option -qopenmp-lib not supported by ifx

martinmath
New Contributor I
952 Views

Current ifx does not support command line option qopenmp-lib (e.g. with -qopenmp-lib=compat for linking with gcc compiled C code). In the documentation I could not find any hint as to what should be done with ifx. Is this option still necessary? Is it planned to be added later on?

 

0 Kudos
1 Solution
Barbara_P_Intel
Employee
925 Views

-qopenmp-lib is on the "options being removed" list. See ifx -qnextgen-diag for a list of options planned and removed.

 

View solution in original post

0 Kudos
6 Replies
Barbara_P_Intel
Employee
926 Views

-qopenmp-lib is on the "options being removed" list. See ifx -qnextgen-diag for a list of options planned and removed.

 

0 Kudos
Ron_Green
Moderator
919 Views

The fact that ifx does not support -qopenmp-lib=compat is a surprise to me.   If your Fortran main wants to call an external C library with Openmp from gomp or MS, why would ifx be any different from ifort, which supports this option? I am baffled.

 

I will dig into this a bit deeper.  

 

ron

0 Kudos
Barbara_P_Intel
Employee
861 Views

@Ron_Green and I did some digging. What do you expect to happen when you use -qopenmp-lib=compat? Do you have a reproducer?

 

0 Kudos
martinmath
New Contributor I
837 Views

This option has been present for ages in my makefile, but it does not seem to be necessary anymore, even with a couple years old classical ifort. Originally it was necessary to link gcc compiled library with fortran code using ifort for the linking.

Here is a small test code, compiled with (source files are omp_c.c and omp_f.f90)

gcc -fopenmp -c omp_c.c -o omp_c.o

ifort -qopenmp omp_c.o omp_f.f90 -o omp_cf.x

 

int run_c(int N) {
    int i, s;

    s = 0;

    #pragma omp parallel for private(i) reduction(+:s)
    for(int i = 1; i <= N; i++) {
      s += i;
    }
    return s;
}
program omp_f

use iso_c_binding, only: c_int
implicit none

interface
   function run_c(N) result(s) bind(c, name="run_c")
      import :: c_int
      integer(c_int) :: s
      integer(c_int), value :: N
   end function run_c
end interface

integer :: s, N

N = 10000
s = run_c(N)
print *, N, s

end program omp_f

 

0 Kudos
Barbara_P_Intel
Employee
815 Views

Thank you, @martinmath, for confirming that -qopenmp-lib=compat is no longer needed and for the reproducer.

Migrating applications to a new compiler can be a challenge. We recently added a section to the Intel Fortran Porting Guide, Compiler Options for Intel Fortran Compiler First Use. That includes a number of compiler options that check your application for validity before doing any optimizations. Another suggestion is to recompile only with "-O2 -xhost" as a start.

 

0 Kudos
Barbara_P_Intel
Employee
793 Views

I submitted a documentation bug report to deprecate the compiler option -qopenmp-lib, /Qopenmp-lib, for ifort and to clarify that it is an ifort only compiler option.



0 Kudos
Reply