code: def custom_build_cmake_clib(
      iface,
      cxx=None,
      onedal_major_binary_version=1,
      no_dist=True,
      use_parameters_lib=True,
  ):
      import pybind11
  
      try:
          import dpctl
  
          dpctl_available = dpctl.__version__ >= "0.14"
          dpctl_include = dpctl.get_include()
      except ImportError:
          import importlib.util
  
          try:
              dpctl_include = os.path.join(
                  importlib.util.find_spec(
                      "dpctl"
                  ).submodule_search_locations[0],
                  "include",
              )
              dpctl_available = dpctl_include is not None
          except AttributeError:
              dpctl_available = False
  
      log.info(f"Is DPCTL available: {str(dpctl_available)}")
  
      root_dir = os.path.normpath(jp(os.path.dirname(__file__), ".."))
      log.info(f"Project directory is: {root_dir}")
  
      builder_directory = jp(root_dir, "scripts")
      abs_build_temp_path = jp(root_dir, "build", f"backend_{iface}")
      install_directory = jp(root_dir, "onedal")
      log.info(f"Builder directory: {builder_directory}")
      log.info(f"Install directory: {install_directory}")
  
      cmake_generator = "-GNinja" if IS_WIN else ""
      python_include = get_python_inc()
      win_python_path_lib = os.path.abspath(
          jp(get_config_var("LIBDEST"), "..", "libs")
      )
      python_library_dir = (
          win_python_path_lib if IS_WIN else get_config_var("LIBDIR")
      )
      numpy_include = np.get_include()
  
      if iface == "dpc":
          if IS_WIN:
              cxx = "icx"
          else:
              cxx = "icpx"
      elif cxx is None:
          raise RuntimeError("CXX compiler shall be specified")
  
      build_distribute = (
          iface == "dpc" and dpctl_available and not no_dist and IS_LIN
      )
  
      log.info(
          f"Build DPCPP SPMD functionality: {str(build_distribute)}"
      )
  
      if build_distribute:
          mpi_root = os.environ["MPIROOT"]
          MPI_INCDIRS = jp(mpi_root, "include")
          MPI_LIBDIRS = jp(mpi_root, "lib")
          MPI_LIBNAME = getattr(os.environ, "MPI_LIBNAME", None)
          if MPI_LIBNAME:
              MPI_LIBS = MPI_LIBNAME
          elif IS_WIN:
              if os.path.isfile(jp(mpi_root, "lib", "mpi.lib")):
                  MPI_LIBS = "mpi"
              if os.path.isfile(jp(mpi_root, "lib", "impi.lib")):
                  MPI_LIBS = "impi"
              assert MPI_LIBS, "Couldn't find MPI library"
          else:
              MPI_LIBS = "mpi"
  
      use_parameters_arg = "yes" if use_parameters_lib else "no"
      log.info(f"Build using parameters library: {use_parameters_arg}")
  
      cmake_args = [
          "cmake",
          cmake_generator,
          "-S" + builder_directory,
          "-B" + abs_build_temp_path,
          "-DCMAKE_CXX_COMPILER=" + cxx,
          "-DCMAKE_INSTALL_PREFIX=" + install_directory,
          "-DCMAKE_PREFIX_PATH=" + install_directory,
          "-DIFACE=" + iface,
          "-DONEDAL_MAJOR_BINARY=" + str(onedal_major_binary_version),
          "-DPYTHON_INCLUDE_DIR=" + python_include,
          "-DNUMPY_INCLUDE_DIRS=" + numpy_include,
          "-DPYTHON_LIBRARY_DIR=" + python_library_dir,
          "-DoneDAL_INCLUDE_DIRS="
          + jp(os.environ["DALROOT"], "include"),
          "-DoneDAL_LIBRARY_DIR="
          + jp(os.environ["DALROOT"], "lib", "intel64"),
          "-Dpybind11_DIR=" + pybind11.get_cmake_dir(),
          "-DoneDAL_USE_PARAMETERS_LIB=" + use_parameters_arg,
      ]
  
      if dpctl_available:
          cmake_args += [
              "-DDPCTL_INCLUDE_DIR=" + dpctl_include,
              "-DONEDAL_DPCTL_INTEGRATION:BOOL=ON",
          ]
  
      if build_distribute:
          cmake_args += [
              "-DMPI_INCLUDE_DIRS=" + MPI_INCDIRS,
              "-DMPI_LIBRARY_DIR=" + MPI_LIBDIRS,
              "-DMPI_LIBS=" + MPI_LIBS,
              "-DONEDAL_DIST_SPMD:BOOL=ON",
          ]
  
      cpu_count = multiprocessing.cpu_count()
      # limit parallel cmake jobs if memory size is insufficient
      # TODO: add on all platforms
      if IS_LIN:
          with open("/proc/meminfo", "r") as meminfo_file_obj:
              memfree = (
                  meminfo_file_obj.read().split("\n")[1].split(" ")
              )
              while "" in memfree:
                  memfree.remove("")
              memfree = int(memfree[1])  # total memory in kB
          cpu_count = min(cpu_count, floor(max(1, memfree / 2**20)))
  
      make_args = [
          "cmake",
          "--build",
          abs_build_temp_path,
          "-j " + str(cpu_count),
      ]
  
      make_install_args = [
          "cmake",
          "--install",
          abs_build_temp_path,
      ]
  
      subprocess.check_call(cmake_args)
      subprocess.check_call(make_args)
      subprocess.check_call(make_install_args)
  
file_path: scikit-learn-intelex/scripts/build_backend.py
imports: import multiprocessing
  import os
  import subprocess
  import sys
  from distutils import log
  from distutils.sysconfig import get_config_var, get_python_inc
  from math import floor
  from os.path import join
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: custom_build_cmake_clib(iface, cxx, onedal_major_binary_version, no_dist, use_parameters_lib) without return types