Skip to content

Commit 5efb668

Browse files
committed
arch: fix cuda linker opt
1 parent e8d3a53 commit 5efb668

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

devito/arch/compiler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def __init__(self):
180180
"""
181181

182182
fields = {'cc', 'ld'}
183+
linker_opt = '-Wl,'
183184
_default_cpp = False
184185
_cxxstd = 'c++14'
185186
_cstd = 'c99'
@@ -425,7 +426,7 @@ def add_library_dirs(self, dirs, rpath=False):
425426
if rpath:
426427
# Add rpath flag to embed library dir
427428
for d in as_list(dirs):
428-
self.ldflags.append(f'-Wl,-rpath,{d}')
429+
self.ldflags.append(f'{self.linker_opt}-rpath,{d}')
429430

430431
def add_libraries(self, libs):
431432
self.libraries = filter_ordered(self.libraries + as_list(libs))
@@ -662,6 +663,7 @@ def __lookup_cmds__(self):
662663
class CudaCompiler(Compiler):
663664

664665
_default_cpp = True
666+
linker_opt = "--linker-options="
665667

666668
def __init_finalize__(self, **kwargs):
667669

0 commit comments

Comments
 (0)