[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_OPENMP broken for IBM xl Fortran compilers
From: |
Christian Rössel |
Subject: |
Re: AC_OPENMP broken for IBM xl Fortran compilers |
Date: |
Sun, 20 Feb 2011 11:06:40 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 |
Hi Ralf,
Am 2/20/2011 7:55 AM, schrieb Ralf Wildenhues:
> Hi Christian, Markus,
>
> * Christian Rössel wrote on Fri, Feb 18, 2011 at 03:57:30PM CET:
>> AC_OPENMP returns "none needed" for the IBM xl Fortran compilers (xlf*,
>> bgxlf*, mpixlf*). This is wrong, you need to use -qsmp=omp.
>>
>> configure tries to compile following program:
>>
>> | program main
>> | call omp_get_num_threads
>> | end
>>
>> Compilation succeeds without specifying any OpenMP flag. If you modify
>> the test program to
>>
>> program main
>> implicit none
>> !$ integer tid
>> tid = 42
>> call omp_set_num_threads(2)
>> end
>>
>> the correct flags are detected.
>
> Thanks for the bug report and patch. I have one question (and I'd still
> like to do some testing before pushing): Isn't the '!' line a Fortran
> 90 comment, and doesn't that have to be written differently for pure
> Fortran 77?
you are right, a '!' is usually a comment in Fortran. But in the context
of OpenMP and combined with the '$' it is interpreted as a conditional
compilation sentinel, i.e. if no OpenMP flags are passed to the
compiler, the line is interpreted as a comment, otherwise '!$' is
replaced by two spaces and the line gets compiled. See 2.2.1 and 2.2.2
in the OpenMP specification
(http://www.openmp.org/mp-documents/spec30.pdf). The patch should work
for Fortran 77 and 90.
Regards,
Christian
>> See the attached patch where I also
>> added OpenMP flags for the Cray and NEC compilers. If you are happy with
>> this patch, please add Markus Geimer to THANKS, too.
>
> Yes, that part is quite obviously good (it has a near-zero chance of
> regressing anything!).
>
> Thanks,
> Ralf