[Openmp-dev] dynamic ordered for loop failure when compiling with gcc

Tianyi Zhang via Openmp-dev openmp-dev at lists.llvm.org
Mon Oct 15 06:45:39 PDT 2018


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

On Mon, Oct 15, 2018 at 3:32 AM Churbanov, Andrey <
Andrey.Churbanov at intel.com> wrote:

> 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
>
>
>
> *From:* Openmp-dev [mailto:openmp-dev-bounces at lists.llvm.org] *On Behalf
> Of *Tianyi Zhang via Openmp-dev
> *Sent:* Saturday, October 13, 2018 12:17 AM
> *To:* openmp-dev at lists.llvm.org
> *Subject:* [Openmp-dev] 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);
>         }
>     }
> }
>
>
> --------------------------------------------------------------------
> Joint Stock Company Intel A/O
> Registered legal address: Krylatsky Hills Business Park,
> 17 Krylatskaya Str., Bldg 4, Moscow 121614,
> <https://maps.google.com/?q=17+Krylatskaya+Str.,+Bldg+4,+Moscow+121614,++Russian+Federation&entry=gmail&source=g>
> Russian Federation
> <https://maps.google.com/?q=17+Krylatskaya+Str.,+Bldg+4,+Moscow+121614,++Russian+Federation&entry=gmail&source=g>
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20181015/47aab08a/attachment.html>


More information about the Openmp-dev mailing list