code: def run(self):
      # Report build options. This is run after the build completes so # `CMakeCache.txt` exists and we can get an
      # accurate report on what is used and what is not.
      cmake_cache_vars = defaultdict(
          lambda: False, cmake.get_cmake_cache_variables()
      )
      if cmake_cache_vars["USE_NUMPY"]:
          report("-- Building with NumPy bindings")
      else:
          report("-- NumPy not found")
      if cmake_cache_vars["USE_CUDNN"]:
          report(
              "-- Detected cuDNN at "
              + cmake_cache_vars["CUDNN_LIBRARY"]
              + ", "
              + cmake_cache_vars["CUDNN_INCLUDE_DIR"]
          )
      else:
          report("-- Not using cuDNN")
      if cmake_cache_vars["USE_CUDA"]:
          report(
              "-- Detected CUDA at "
              + cmake_cache_vars["CUDA_TOOLKIT_ROOT_DIR"]
          )
      else:
          report("-- Not using CUDA")
      if cmake_cache_vars["USE_XPU"]:
          report(
              "-- Detected XPU runtime at "
              + cmake_cache_vars["SYCL_LIBRARY_DIR"]
          )
      else:
          report("-- Not using XPU")
      if cmake_cache_vars["USE_MKLDNN"]:
          report("-- Using MKLDNN")
          if cmake_cache_vars["USE_MKLDNN_ACL"]:
              report(
                  "-- Using Compute Library for the Arm architecture with MKLDNN"
              )
          else:
              report(
                  "-- Not using Compute Library for the Arm architecture with MKLDNN"
              )
          if cmake_cache_vars["USE_MKLDNN_CBLAS"]:
              report("-- Using CBLAS in MKLDNN")
          else:
              report("-- Not using CBLAS in MKLDNN")
      else:
          report("-- Not using MKLDNN")
      if (
          cmake_cache_vars["USE_NCCL"]
          and cmake_cache_vars["USE_SYSTEM_NCCL"]
      ):
          report(
              "-- Using system provided NCCL library at {}, {}".format(
                  cmake_cache_vars["NCCL_LIBRARIES"],
                  cmake_cache_vars["NCCL_INCLUDE_DIRS"],
              )
          )
      elif cmake_cache_vars["USE_NCCL"]:
          report("-- Building NCCL library")
      else:
          report("-- Not using NCCL")
      if cmake_cache_vars["USE_DISTRIBUTED"]:
          if IS_WINDOWS:
              report("-- Building without distributed package")
          else:
              report("-- Building with distributed package: ")
              report(
                  "  -- USE_TENSORPIPE={}".format(
                      cmake_cache_vars["USE_TENSORPIPE"]
                  )
              )
              report(
                  "  -- USE_GLOO={}".format(
                      cmake_cache_vars["USE_GLOO"]
                  )
              )
              report(
                  "  -- USE_MPI={}".format(
                      cmake_cache_vars["USE_OPENMPI"]
                  )
              )
      else:
          report("-- Building without distributed package")
      if cmake_cache_vars["STATIC_DISPATCH_BACKEND"]:
          report(
              "-- Using static dispatch with backend {}".format(
                  cmake_cache_vars["STATIC_DISPATCH_BACKEND"]
              )
          )
      if cmake_cache_vars["USE_LIGHTWEIGHT_DISPATCH"]:
          report("-- Using lightweight dispatch")
      if cmake_cache_vars["BUILD_EXECUTORCH"]:
          report("-- Building Executorch")
  
      if cmake_cache_vars["USE_ITT"]:
          report("-- Using ITT")
      else:
          report("-- Not using ITT")
  
      # Do not use clang to compile extensions if `-fstack-clash-protection` is defined
      # in system CFLAGS
      c_flags = str(os.getenv("CFLAGS", ""))
      if (
          IS_LINUX
          and "-fstack-clash-protection" in c_flags
          and "clang" in os.environ.get("CC", "")
      ):
          os.environ["CC"] = str(os.environ["CC"])
  
      # It's an old-style class in Python 2.7...
      setuptools.command.build_ext.build_ext.run(self)
  
      if IS_DARWIN and package_type != "conda":
          self._embed_libiomp()
  
      # Copy the essential export library to compile C++ extensions.
      if IS_WINDOWS:
          build_temp = self.build_temp
  
          ext_filename = self.get_ext_filename("_C")
          lib_filename = ".".join(ext_filename.split(".")[:-1]) + ".lib"
  
          export_lib = os.path.join(
              build_temp, "torch", "csrc", lib_filename
          ).replace("\\", "/")
  
          build_lib = self.build_lib
  
          target_lib = os.path.join(
              build_lib, "torch", "lib", "_C.lib"
          ).replace("\\", "/")
  
          # Create "torch/lib" directory if not exists.
          # (It is not created yet in "develop" mode.)
          target_dir = os.path.dirname(target_lib)
          if not os.path.exists(target_dir):
              os.makedirs(target_dir)
  
          self.copy_file(export_lib, target_lib)
  
imports: import sys
  import platform
  import filecmp
  import glob
  import importlib
  import json
  import os
  import shutil
  import subprocess
  import sysconfig
  import time
  from collections import defaultdict
  import setuptools.command.build_ext
  import setuptools.command.install
  import setuptools.command.sdist
  from setuptools import Extension, find_packages, setup
  from setuptools.dist import Distribution
  from tools.build_pytorch_libs import build_caffe2
  from tools.generate_torch_version import get_torch_version
  from tools.setup_helpers.cmake import CMake
  from tools.setup_helpers.env import build_type, IS_DARWIN, IS_LINUX, IS_WINDOWS
label_desc: Use image node_id 2 for calling the build_ext obj's underlying member method code with example usage: obj.run() without return types