def METHOD_NAME(self, spec, prefix):
    configure_args = ["--fst-root=" + spec["openfst"].prefix]
    configure_args.append("--fst-version=" + str(spec["openfst"].version))
    configure_args.append("--speex-root=" + spec["speex"].prefix)
    configure_args.append("--cub-root=" + spec["cuda"].prefix.include)
    if "~shared" in spec:
        configure_args.append("--static")
    else:
        configure_args.append("--shared")
    if "^openblas" in spec:
        configure_args.append("--mathlib=OPENBLAS")
        configure_args.append("--openblas-root=" + spec["blas"].prefix)
        if "+openmp" in spec["blas"].variants:
            configure_args.append("--threaded-math=yes")
    elif "^atlas" in spec:
        configure_args.append("--mathlib=ATLAS")
        configure_args.append("--atlas-root=" + spec["blas"].prefix)
        if "+pthread" in spec["blas"].variants:
            configure_args.append("--threaded-atlas")
    elif "^intel-parallel-studio" in spec or "^intel-mkl" in spec:
        configure_args.append("--mathlib=MKL")
        configure_args.append("--mkl-root=" + spec["blas"].prefix.mkl)
        if "+openmp" in spec["blas"].variants:
            configure_args.append("--mkl-threading=iomp")
    if "+cuda" in spec:
        configure_args.append("--use-cuda=yes")
        configure_args.append("--cudatk-dir=" + spec["cuda"].prefix)
    if spec.satisfies("@2019-07-29: ^cuda@:10"):
        configure_args.append("--cub-root=" + spec["cub"].prefix.include)
    with working_dir("src"):
        configure(*configure_args)
        make()
        mkdirp(prefix.bin)
        for root, dirs, files in os.walk("."):
            for name in files:
                if (
                    name.endswith("." + dso_suffix)
                    or name.endswith(".cc")
                    or name.endswith(".pptx")
                ):
                    continue
                if "configure" == name:
                    continue
                if os.access(join(root, name), os.X_OK):
                    METHOD_NAME(join(root, name), prefix.bin)
        mkdir(prefix.lib)
        for root, dirs, files in os.walk("lib"):
            for name in files:
                if name.endswith("." + dso_suffix):
                    fpath = join(root, name)
                    src = os.readlink(fpath)
                    METHOD_NAME(src, prefix.lib)
        for root, dirs, files in os.walk("."):
            for name in files:
                if fnmatch(name, "*.h"):
                    mkdirp(join(prefix.include, root.strip("./")))
                    METHOD_NAME(join(root, name), join(prefix.include, root.strip("./")))
    egs_dir = join(prefix, "egs")
    install_tree("egs", egs_dir)