diff --git a/python/setup_tools/utils/tsingmicro.py b/python/setup_tools/utils/tsingmicro.py index 6107ea83b..d93b7abe4 100644 --- a/python/setup_tools/utils/tsingmicro.py +++ b/python/setup_tools/utils/tsingmicro.py @@ -1,10 +1,23 @@ import os +import shutil def get_backend_cmake_args(*args, **kargs): build_ext = kargs['build_ext'] - src_ext_path = build_ext.get_ext_fullpath("triton") + src_ext_path = build_ext.get_ext_fullpath("tsingmicro-opt") src_ext_path = os.path.abspath(os.path.dirname(src_ext_path)) return [ - "-DCMAKE_INSTALL_PREFIX=" + src_ext_path, + "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=" + src_ext_path, ] + + +def install_extension(*args, **kargs): + build_ext = kargs['build_ext'] + src_ext_path = build_ext.get_ext_fullpath("tsingmicro-opt") + src_ext_path = os.path.join(os.path.abspath(os.path.dirname(src_ext_path)), "tsingmicro-opt") + python_root_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) + dst_ext_path = os.path.join(python_root_dir, "triton/backends/tsingmicro/bin/tsingmicro-opt") + bin_dir = os.path.dirname(dst_ext_path) + if not os.path.exists(bin_dir): + os.mkdir(bin_dir) + shutil.copy(src_ext_path, dst_ext_path)