Skip to main content
`Ctrl`+`K`

# numpy.distutils.ccompiler_opt.CCompilerOpt.try_dispatch

method

distutils.ccompiler_opt.CCompilerOpt.try_dispatch(sources, src_dir=None, ccompiler=None, **kwargs)

  Compile one or more dispatch-able sources and generates object files, also generates abstract C config headers and macros that used later for the final runtime dispatching process.

  The mechanism behind it is to takes each source file that specified in ‘sources’ and branching it into several files depend on special configuration statements that must be declared in the top of each source which contains targeted CPU features, then it compiles every branched source with the proper compiler flags.

  Parameters:
    sources list

      Must be a list of dispatch-able sources file paths, and configuration statements must be declared inside each file.

    src_dir str

      Path of parent directory for the generated headers and wrapped sources. If None(default) the files will generated in-place.

    ccompiler CCompiler

      Distutils CCompiler instance to be used for compilation. If None (default), the provided instance during the initialization will be used instead.

    **kwargs any

      Arguments to pass on to the CCompiler.compile()

  Returns:
    list generated object files
  Raises:
    CompileError

      Raises by CCompiler.compile() on compiling failure.

    DistutilsError

      Some errors during checking the sanity of configuration statements.

  See also

  `parse_targets`

    Parsing the configuration statements of dispatch-able sources.