def METHOD_NAME(self):
    """Custom configure procedure for ELSI."""
    if self.cfg['runtest']:
        self.cfg.update('configopts', "-DENABLE_TESTS=ON")
        self.cfg.update('configopts', "-DENABLE_C_TESTS=ON")
        self.cfg['runtest'] = 'test'
    setup_cmake_env(self.toolchain)
    external_libs = []
    inc_paths = os.environ['CMAKE_INCLUDE_PATH'].split(':')
    lib_paths = os.environ['CMAKE_LIBRARY_PATH'].split(':')
    elpa_root = get_software_root('ELPA')
    if elpa_root:
        self.log.info("Using external ELPA.")
        self.cfg.update('configopts', "-DUSE_EXTERNAL_ELPA=ON")
        elpa_lib = 'elpa_openmp' if self.toolchain.options.get('openmp', None) else 'elpa'
        inc_paths.append(os.path.join(elpa_root, 'include', '%s-%s' % (elpa_lib, get_software_version('ELPA')),
                                      'modules'))
        external_libs.extend([elpa_lib])
    else:
        self.log.info("No external ELPA specified as dependency, building internal ELPA.")
    pexsi = get_software_root('PEXSI')
    if pexsi:
        if self.cfg['build_internal_pexsi']:
            raise EasyBuildError("Both build_internal_pexsi and external PEXSI dependency found, "
                                 "only one can be set.")
        self.log.info("Using external PEXSI.")
        self.cfg.update('configopts', "-DUSE_EXTERNAL_PEXSI=ON")
        external_libs.append('pexsi')
    elif self.cfg['build_internal_pexsi'] is not False:
        self.log.info("No external PEXSI specified as dependency and internal PEXSI not explicitly disabled, "
                      "building internal PEXSI.")
        self.cfg['build_internal_pexsi'] = True
    else:
        self.log.info("No external PEXSI specified as dependency and internal PEXSI was explicitly disabled, "
                      "building ELSI without PEXSI.")
    if pexsi or self.cfg['build_internal_pexsi']:
        self.cfg.update('configopts', "-DENABLE_PEXSI=ON")
    slepc = get_software_root('SLEPc')
    if slepc:
        if self.cfg['build_internal_pexsi']:
            # ELSI's internal PEXSI also builds internal PT-SCOTCH and SuperLU_DIST
            raise EasyBuildError("Cannot use internal PEXSI with external SLEPc, due to conflicting dependencies.")
        self.enable_sips = True
        self.log.info("Enabling SLEPc-SIPs solver.")
        self.cfg.update('configopts', "-DENABLE_SIPS=ON")
        external_libs.extend(['slepc', 'petsc', 'HYPRE', 'umfpack', 'klu', 'cholmod', 'btf', 'ccolamd', 'colamd',
                              'camd', 'amd', 'suitesparseconfig', 'metis', 'ptesmumps',
                              'ptscotchparmetis', 'ptscotch', 'ptscotcherr', 'esmumps', 'scotch', 'scotcherr',
                              'stdc++', 'dl'])
        if get_software_root('imkl') or get_software_root('FFTW'):
            external_libs.extend(re.findall(r'lib(.*?)\.a', os.environ['FFTW_STATIC_LIBS%s' % self.env_suff]))
        else:
            raise EasyBuildError("Could not find FFTW library or interface.")
    ntpoly = get_software_root('NTPoly')
    if ntpoly:
        self.internal_ntpoly = False
        self.log.info("Using external NTPoly.")
        self.cfg.update('configopts', "-DUSE_EXTERNAL_NTPOLY=ON")
        external_libs.append('NTPoly')
    else:
        self.log.info("No external NTPoly specified as dependency, building internal NTPoly.")
    bsepack = get_software_root('bsepack')
    if bsepack:
        self.log.info("Using external BSEPACK.")
        self.cfg.update('configopts', "-DENABLE_BSEPACK=ON -DUSE_EXTERNAL_BSEPACK=ON")
        external_libs.extend(['bsepack', 'sseig'])
    if get_software_root('imkl') or get_software_root('ScaLAPACK'):
        external_libs.extend(re.findall(r'lib(.*?)\.a', os.environ['SCALAPACK%s_STATIC_LIBS' % self.env_suff]))
    else:
        raise EasyBuildError("Could not find ScaLAPACK library or interface.")
    external_libs.extend(re.findall(r'-l(.*?)\b', os.environ['LIBS']))
    self.cfg.update('configopts', "-DLIBS='%s'" % ';'.join(external_libs))
    self.cfg.update('configopts', "-DLIB_PATHS='%s'" % ';'.join(lib_paths))
    self.cfg.update('configopts', "-DINC_PATHS='%s'" % ';'.join(inc_paths))
    super(EB_ELSI, self).METHOD_NAME()