Re: [petsc-dev] OpenMP compiler options
On Tue, May 29, 2012 at 10:56 AM, Satish Balay <[email protected]> wrote:
Perhaps the 'empty' flag check should be at the begining of the list..
No, because most compilers ignore the pragmas when no options are given. I do not know of any portable way, short of running code, to determine whether a compiler used the OpenMP pragmas or ignored them.
[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
participants (1)
-
Jed Brown