Skip to content

Commit

Permalink
refactor out new plugin
Browse files Browse the repository at this point in the history
commit_hash:9e7d09577713ceb4c1bfabf9b70a494f8d0c3532
  • Loading branch information
pg committed Feb 19, 2025
1 parent a826e83 commit 11ef36d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
13 changes: 1 addition & 12 deletions build/scripts/link_dyn_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,6 @@ def fix_cmd_for_dynamic_cuda(cmd):
return flags


def fix_blas_resolving(cmd):
# Intel mkl comes as a precompiled static library and thus can not be recompiled with sanitizer runtime instrumentation.
# That's why we prefer to use cblas instead of Intel mkl as a drop-in replacement under sanitizers.
# But if the library has dependencies on mkl and cblas simultaneously, it will get a linking error.
# Hence we assume that it's probably compiling without sanitizers and we can easily remove cblas to prevent multiple definitions of the same symbol at link time.
for arg in cmd:
if arg.startswith('contrib/libs') and arg.endswith('mkl-lp64.a'):
return [arg for arg in cmd if not arg.endswith('libcontrib-libs-cblas.a')]
return cmd


def parse_args(args):
parser = optparse.OptionParser()
parser.disable_interspersed_args()
Expand Down Expand Up @@ -242,7 +231,7 @@ def parse_args(args):
assert opts.arch
assert opts.target

cmd = fix_blas_resolving(args)
cmd = args
cmd = fix_cmd(opts.arch, cmd)

if opts.dynamic_cuda:
Expand Down
13 changes: 1 addition & 12 deletions build/scripts/link_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,6 @@ def gen_default_suppressions(inputs, output, source_root):
dst.write('}\n')


def fix_blas_resolving(cmd):
# Intel mkl comes as a precompiled static library and thus can not be recompiled with sanitizer runtime instrumentation.
# That's why we prefer to use cblas instead of Intel mkl as a drop-in replacement under sanitizers.
# But if the library has dependencies on mkl and cblas simultaneously, it will get a linking error.
# Hence we assume that it's probably compiling without sanitizers and we can easily remove cblas to prevent multiple definitions of the same symbol at link time.
for arg in cmd:
if arg.startswith('contrib/libs') and arg.endswith('mkl-lp64.a'):
return [arg for arg in cmd if not arg.endswith('libcontrib-libs-cblas.a')]
return cmd


def parse_args(args):
parser = optparse.OptionParser()
parser.disable_interspersed_args()
Expand Down Expand Up @@ -351,7 +340,7 @@ def parse_args(args):
opts, args = parse_args(args)
args = pcf.skip_markers(args)

cmd = fix_blas_resolving(args)
cmd = args
cmd = remove_excessive_flags(cmd)
cmd = fix_sanitize_flag(cmd, opts)

Expand Down

0 comments on commit 11ef36d

Please sign in to comment.