code: def build_extensions(self):
      extra_compile_args = []
      extra_link_args = []
  
      # Optimization compiler/linker flags are added appropriately
      compiler = self.compiler.compiler_type
      if compiler == "unix":
          extra_compile_args += ["-O3"]
      elif compiler == "msvc":
          extra_compile_args += ["/Ox", "/fp:fast"]
  
      if compiler == "unix":
          # https://stackoverflow.com/questions/22931147/stdisinf-does-not-work-with-ffast-math-how-to-check-for-infinity
          extra_compile_args += [
              "-ffast-math",
              "-fno-finite-math-only",  # we use infinity
              "-fno-associative-math",
          ]
  
      # Annoy specific flags
      annoy_ext = None
      for extension in extensions:
          if "annoy.annoylib" in extension.name:
              annoy_ext = extension
      assert annoy_ext is not None, "Annoy extension not found!"
  
      if compiler == "unix":
          annoy_ext.extra_compile_args += ["-std=c++14"]
          annoy_ext.extra_compile_args += [
              "-DANNOYLIB_MULTITHREADED_BUILD"
          ]
      elif compiler == "msvc":
          annoy_ext.extra_compile_args += ["/std:c++14"]
  
      # Set minimum deployment version for MacOS
      if compiler == "unix" and platform.system() == "Darwin":
          extra_compile_args += ["-mmacosx-version-min=10.12"]
          extra_link_args += [
              "-stdlib=libc++",
              "-mmacosx-version-min=10.12",
          ]
  
      # We don't want the compiler to optimize for system architecture if
      # we're building packages to be distributed by conda-forge, but if the
      # package is being built locally, this is desired
      if not (
          "AZURE_BUILD" in os.environ or "CONDA_BUILD" in os.environ
      ):
          if platform.machine() == "ppc64le":
              extra_compile_args += ["-mcpu=native"]
          if platform.machine() == "x86_64":
              extra_compile_args += ["-march=native"]
  
      # We will disable openmp flags if the compiler doesn't support it. This
      # is only really an issue with OSX clang
      if has_c_library("omp"):
          print("Found openmp. Compiling with openmp flags...")
          if platform.system() == "Darwin" and compiler == "unix":
              extra_compile_args += ["-Xpreprocessor", "-fopenmp"]
              extra_link_args += ["-lomp"]
          elif compiler == "unix":
              extra_compile_args += ["-fopenmp"]
              extra_link_args += ["-fopenmp"]
          elif compiler == "msvc":
              extra_compile_args += ["/openmp"]
              extra_link_args += ["/openmp"]
      else:
          warnings.warn(
              "You appear to be using a compiler which does not support "
              "openMP, meaning that the library will not be able to run on "
              "multiple cores. Please install/enable openMP to use multiple "
              "cores."
          )
  
      for extension in self.extensions:
          extension.extra_compile_args += extra_compile_args
          extension.extra_link_args += extra_link_args
  
      # Add numpy and system include directories
      for extension in self.extensions:
          extension.include_dirs.extend(get_include_dirs())
          extension.include_dirs.append(get_numpy_include())
  
      # Add numpy and system include directories
      for extension in self.extensions:
          extension.library_dirs.extend(get_library_dirs())
  
      super().build_extensions()
  
imports: import distutils
  import os
  import platform
  import sys
  import tempfile
  import warnings
  from distutils import ccompiler
  from distutils.errors import CompileError, LinkError
  from distutils.sysconfig import customize_compiler
  from os.path import join
  import setuptools
  from Cython.Distutils.build_ext import new_build_ext
  from setuptools import setup, Extension
label_desc: Use image node_id 1 for calling the CythonBuildExt obj's underlying member method code with example usage: obj.build_extensions() without return types