def METHOD_NAME(self) -> None:
    r"""
    This method can be used to build the generated code and install the resulting extension module into NEST.
    Raises
    ------
    GeneratedCodeBuildException
        If any kind of failure occurs during cmake configuration, build, or install.
    InvalidPathException
        If a failure occurs while trying to access the target path or the NEST installation path.
    """
    error_location = self._options["error_location"]
    cmake_cmd = ["cmake"]
    target_path = FrontendConfiguration.get_target_path()
    install_path = FrontendConfiguration.get_install_path()
    if install_path is not None:
        add_libraries_to_sli(install_path)
    nest_path = self.get_option("nest_path")
    if not os.path.isdir(target_path):
        raise InvalidPathException('Target path (' + target_path + ') is not a directory!')
    if nest_path is None or (not os.path.isdir(nest_path)):
        raise InvalidPathException('NEST path (' + str(nest_path) + ') is not a directory!')
    install_prefix = ""
    if install_path:
        if not os.path.isabs(install_path):
            install_path = os.path.abspath(install_path)
        install_prefix = f"-DCMAKE_INSTALL_PREFIX={install_path}"
    # compile multithreaded -- how many threads?
    try:
        n_cpu = len(os.sched_getaffinity(0))  # only available on Linux
    except AttributeError:
        n_cpu = os.cpu_count()
    nest_config_path = f"-Dwith-nest={os.path.join(nest_path, 'bin', 'nest-config')}"
    cmake_cmd = ['cmake', nest_config_path, install_prefix, '.']
    make_all_cmd = ['make', f'-j{n_cpu}', 'all']
    make_install_cmd = ['make', 'install']
    # remove CMakeCache.txt if exists
    cmake_cache = os.path.join(target_path, "CMakeCache.txt")
    if os.path.exists(cmake_cache):
        os.remove(cmake_cache)
    # check if we run on win
    if sys.platform.startswith('win'):
        shell = True
    else:
        shell = False
    stages_exception = {"cmake": f"Error occurred during cmake! More detailed error messages can be found in {error_location}.", "build": f"Error occurred during 'make all'! More detailed error messages can be found in {error_location}.",
                        "install":  f"Error occurred during 'make install'! More detailed error messages can be found in {error_location}."}
    current_stage = ""
    stdout = self._options["stdout"]
    stderr = self._options["stderr"]
    if self._options["redirect"]:
        try:
            stdout = open(stdout, "w")
        except IOError as e:
            raise GeneratedCodeBuildException(f"Failed to open file for stdout: {e}")
        try:
            stderr = open(stderr, "w")
        except IOError as e:
            stdout.close()
            raise GeneratedCodeBuildException(f"Failed to open file for stderr: {e}")
    try:
        current_stage = "cmake"
        subprocess.check_call(cmake_cmd, stderr=stderr, stdout=stdout, shell=shell,
                              cwd=str(os.path.join(target_path)))
        current_stage = "build"
        subprocess.check_call(make_all_cmd, stderr=stderr, stdout=stdout, shell=shell,
                              cwd=str(os.path.join(target_path)))
        current_stage = "install"
        subprocess.check_call(make_install_cmd, stderr=stderr, stdout=stdout, shell=shell,
                              cwd=str(os.path.join(target_path)))
    except subprocess.CalledProcessError as e:
        raise GeneratedCodeBuildException(stages_exception[current_stage])
    finally:
        if self._options["redirect"]:
            stderr.close()
            stdout.close()