[petsc-dev] OpenMP compiler options

Satish Balay balay at mcs.anl.gov
Tue May 29 10:56:01 CDT 2012


Perhaps the 'empty' flag check should be at the begining of the list..

[we do have other places in configure where we fix the order in which
flags are checked - due to similar conflicts between compilers]

Satish

On Tue, 29 May 2012, Jed Brown wrote:

> The OpenMP flags do not definitively identify that OpenMP is used. In
> particular, IBM XL interprets Cray's option "-h omp" as being equivalent to
> "-soname omp", then silently ignores the Open MP pragmas. We can perhaps
> "fix" this instance by moving -qsmp up in the list, but we may eventually
> need to move it to compilerOptions.py.
> 
>   def configureLibrary(self):
>     ''' Checks for -fopenmp compiler flag'''
>     ''' Needs to check if OpenMP actually exists and works '''
>     self.setCompilers.pushLanguage('C')
>     #
>     for flag in ["-fopenmp", # Gnu
>                  "-h omp",   # Cray
>                  "-mp",      # Portland Group
>                  "-Qopenmp", # Intel windows
>                  "-openmp",  # Intel
>                  " ",        # Empty, if compiler automatically accepts
> openmp
>                  "-xopenmp", # Sun
>                  "+Oopenmp", # HP
>                  "-qsmp",    # IBM XL C/c++
>                  "/openmp"   # Microsoft Visual Studio
>                  ]:
>       if self.setCompilers.checkCompilerFlag(flag):
>         ompflag = flag
>         break
> 




More information about the petsc-dev mailing list