Skip to content

Commit

Permalink
modified: framework/configure.py
Browse files Browse the repository at this point in the history
  • Loading branch information
psava committed Oct 7, 2024
1 parent 4b1de8f commit 6f714f3
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions framework/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1888,35 +1888,36 @@ def ncpus():

def omp(context):
context.Message("checking for OpenMP ... ")
LIBS = path_get(context,'LIBS')
CC = context.env.get('CC','gcc')
flags = context.env.get('CFLAGS','')
ccflags = context.env.get('CXXFLAGS','')
lflags = context.env.get('LINKFLAGS','')
pgcc = (CC.rfind('pgcc') >= 0)
gcc = (CC.rfind('gcc') >= 0)
icc = (CC.rfind('icc') >= 0)
clang = (CC.rfind('clang') >= 0)
LIBS = path_get(context,'LIBS')
CC = context.env.get('CC','gcc')
flags = context.env.get('CFLAGS','')
ccflags = context.env.get('CXXFLAGS','')
lflags = context.env.get('LINKFLAGS','')
pgcc = (CC.rfind('pgcc') >= 0)
gcc = (CC.rfind('gcc') >= 0)
icc = (CC.rfind('icc') >= 0)
clang = (CC.rfind('clang') >= 0)
if pgcc:
CFLAGS = flags + ' -mp'
CXXFLAGS = ccflags + ' -mp'
LINKFLAGS = lflags + ' -mp'
CFLAGS = flags + ' -mp'
CXXFLAGS = ccflags + ' -mp'
LINKFLAGS = lflags + ' -mp'
elif gcc:
LIBS.append('gomp')
CFLAGS = flags + ' -fopenmp'
CXXFLAGS = ccflags + ' -fopenmp'
LINKFLAGS = lflags + ' -fopenmp'
CFLAGS = flags + ' -fopenmp'
CXXFLAGS = ccflags + ' -fopenmp'
LINKFLAGS = lflags + ' -fopenmp'
elif clang:
CFLAGS = flags + ' -fopenmp'
CXXFLAGS = ccflags + ' -fopenmp'
LINKFLAGS = lflags + ' -fopenmp'
LIBS.append('omp')
CFLAGS = flags + ' -fopenmp'
CXXFLAGS = ccflags + ' -fopenmp'
LINKFLAGS = lflags #+ ' -fopenmp'
elif icc:
CFLAGS = flags + ' -qopenmp -D_OPENMP'
CXXFLAGS = ccflags + ' -qopenmp -D_OPENMP'
LINKFLAGS = lflags + ' -qopenmp'
CFLAGS = flags + ' -qopenmp -D_OPENMP'
CXXFLAGS = ccflags + ' -qopenmp -D_OPENMP'
LINKFLAGS = lflags + ' -qopenmp'
else:
CFLAGS = flags
CXXFLAGS = ccflags
CFLAGS = flags
CXXFLAGS = ccflags
LINKFLAGS = lflags

text = '''
Expand All @@ -1931,9 +1932,9 @@ def omp(context):
}
'''

context.env['LIBS'] = LIBS
context.env['CFLAGS'] = CFLAGS
context.env['CXXFLAGS'] = CXXFLAGS
context.env['LIBS'] = LIBS
context.env['CFLAGS'] = CFLAGS
context.env['CXXFLAGS'] = CXXFLAGS
context.env['LINKFLAGS'] = LINKFLAGS
res = context.TryLink(text,'.c')
if res:
Expand Down

0 comments on commit 6f714f3

Please sign in to comment.