dynamic ordered for loop failure when compiling with gcc

Hi,
I have the following code failure when compiling with gcc.

It seems that under kmp_gsupport.cpp, the long*p_lb is not properly read.

Could anyone help with this?

Thanks!


int main(){
#pragma omp parallel for schedule(dynamic) ordered
    for (int i = 0; i < 10; i++)
    {
#pragma omp ordered
        {
            printf("%d\n ", i);
        }
    }
}

Hi,

Your code fails to compile because “printf” is undeclared.

If I add #include <stdio.h> the code works fine when compiled with gcc:

bash-4.2$ gcc -fopenmp -std=c99 gcc-ordered.c -L.

bash-4.2$ KMP_VERSION=1 ./a.out

Intel(R) OMP version: 5.0.20140926

Intel(R) OMP library type: performance

Intel(R) OMP link type: dynamic

Intel(R) OMP build time: no_timestamp

Intel(R) OMP build compiler: GCC 4.8

Intel(R) OMP alternative compiler support: yes

Intel(R) OMP API version: 5.0 (201611)

Intel(R) OMP dynamic error checking: no

Intel(R) OMP thread affinity support: not used

0

1

2

3

4

5

6

7

8

9

bash-4.2$ gcc --version

gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-16)

Regards,

Andrey

Thanks for your reply ! I just found that I modified the openmp source code in a wrong way which caused the issue.