Skip to content

Commit

Permalink
fix disc flag when complie python (pytorch#39)
Browse files Browse the repository at this point in the history
* fix bazel flag when complie python

* fix lint.
  • Loading branch information
baoleai authored and yitongh committed Aug 8, 2024
1 parent 26f451f commit 0e162e1
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,19 @@ def bazel_build(self, ext):

# package BladeDISC distribution files
# please note, TorchBlade also create some symbolic links to 'torch_blade' dir
disc_ral_so_name = 'libral_base_context.so'
bazel_bin_path = 'build/temp.linux-x86_64-cpython-310/bazel-bin/external/disc_compiler'
shutil.copyfile(
os.path.join(bazel_bin_path, disc_ral_so_name),
'/'.join([ext_dest_dir, disc_ral_so_name]))

disc_customop_so_name = 'libdisc_custom_ops.so'
bazel_bin_path = 'build/temp.linux-x86_64-cpython-38/bazel-bin/external/disc_compiler'
shutil.copyfile(
os.path.join(bazel_bin_path, disc_customop_so_name),
'/'.join([ext_dest_dir, disc_customop_so_name]))

if build_util.check_env_flag('ENABLE_DISC', 'true'):
disc_ral_so_name = 'libral_base_context.so'
bazel_bin_path = 'build/temp.linux-x86_64-cpython-310/bazel-bin/external/disc_compiler'
shutil.copyfile(
os.path.join(bazel_bin_path, disc_ral_so_name),
'/'.join([ext_dest_dir, disc_ral_so_name]))

disc_customop_so_name = 'libdisc_custom_ops.so'
bazel_bin_path = 'build/temp.linux-x86_64-cpython-310/bazel-bin/external/disc_compiler'
shutil.copyfile(
os.path.join(bazel_bin_path, disc_customop_so_name),
'/'.join([ext_dest_dir, disc_customop_so_name]))


class Develop(develop.develop):
Expand Down

0 comments on commit 0e162e1

Please sign in to comment.