Skip to content

Commit

Permalink
compiler: fix compiler flags for amd clang
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jan 31, 2023
1 parent 4c8bc4e commit acf8954
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions devito/arch/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,17 +486,16 @@ def __init__(self, *args, **kwargs):
else:
self.cflags.append('-march=native')

# For MPI, mpicc is compiled against amdclang not aompcc, so need the flags back.
if kwargs.get('mpi'):
self.ldflags.extend(['-target', 'x86_64-pc-linux-gnu'])
self.ldflags.extend(['-fopenmp',
'-fopenmp-targets=amdgcn-amd-amdhsa',
'-Xopenmp-target=amdgcn-amd-amdhsa'])
self.ldflags.append('-march=%s' % platform.march)
# amdclang flags, used to be part of aompcc
self.ldflags.extend(['-target', 'x86_64-pc-linux-gnu'])
self.ldflags.extend(['-fopenmp',
'-fopenmp-targets=amdgcn-amd-amdhsa',
'-Xopenmp-target=amdgcn-amd-amdhsa'])
self.ldflags.append('-march=%s' % platform.march)

def __lookup_cmds__(self):
self.CC = 'aompcc'
self.CXX = 'aompcc'
self.CC = 'clang'
self.CXX = 'clang++'
self.MPICC = 'mpicc'
self.MPICXX = 'mpicxx'

Expand Down

0 comments on commit acf8954

Please sign in to comment.