[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: detection and support of OpenMP
From: |
Paul Eggert |
Subject: |
Re: detection and support of OpenMP |
Date: |
Thu, 17 May 2007 12:14:17 -0700 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
Bruno Haible <address@hidden> writes:
>> How would one use OPENMP_CFLAGS? Does -fopenmp need to be added to
>> both CFLAGS and CPPFLAGS? Is that why it's not merely put into
>> CFLAGS?
>
> It's needed for compiling and for linking. As far as I can tell, it's not
> needed for preprocessing, since <omp.h> is found in the compiler's search
> path anyway.
Thanks, but earlier you mentioned the _OPENMP macro -- is that defined
by <omp.h>, or is it predefined by cpp? I just now checked
<http://docs.hp.com/en/B3901-90012/ch08s05.html>, and it implies
(though it doesn't say) that _OPENMP is predefined by cpp. If so,
OPENMP_CFLAGS needs to be put into CPPFLAGS too, and the problem needs
to be documented.
> When an app doesn't use OpenMP (i.e. contains no #pragma omp and no use of
> <omp.h>), compiling with -fopenmp has no effect on the generated code.
In this case, I don't see the downside of having 'configure'
manipulate CC, CFLAGS, and/or CPPFLAGS to use the -fopenmp option
uniformly for all compiles. This should be simpler and more reliable
than requiring the developer to put $(OPENMP_CFLAGS) all over the
place. And it should address the CFLAGS/CPPFLAGS issue as well.
Re: detection and support of OpenMP, Noah Misch, 2007/05/17
Re: detection and support of OpenMP, Paul Eggert, 2007/05/17