def METHOD_NAME(self, spec, prefix):
    build_opts = {
        "gcc": {"serial": "1", "serial_NO_GRIB2": "2", "dmpar": "3", "dmpar_NO_GRIB2": "4"},
        "intel": {
            "serial": "17",
            "serial_NO_GRIB2": "18",
            "dmpar": "19",
            "dmpar_NO_GRIB2": "20",
        },
        "pgi": {"serial": "5", "serial_NO_GRIB2": "6", "dmpar": "7", "dmpar_NO_GRIB2": "8"},
    }
    try:
        compiler_opts = build_opts[self.spec.compiler.name]
    except KeyError:
        raise InstallError("Compiler not recognized nor supported.")
    # Spack already makes sure that the variant value is part of the set.
    build_type = compiler_opts[spec.variants["build_type"].value]
    with tempfile.TemporaryFile(mode="w") as fp:
        fp.write(build_type + "\n")
        fp.seek(0)
        Executable("./configure")(input=fp)