#
#  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#  SLEPc - Scalable Library for Eigenvalue Problem Computations
#  Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain
#
#  This file is part of SLEPc.
#  SLEPc is distributed under a 2-clause BSD license (see LICENSE).
#  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#

include ${PETSC_DIR}/lib/petsc/conf/variables

# Variables specific to SLEPc that can be employed in user makefiles
SLEPC_LIB_DIR       = ${SLEPC_DIR}/${PETSC_ARCH}/lib
SLEPCCONF_H         = ${SLEPC_DIR}/${PETSC_ARCH}/include/slepcconf.h

SLEPC_INCLUDE       = -I${SLEPC_DIR}/include -I${SLEPC_DIR}/${PETSC_ARCH}/include
SLEPC_CEXT_INCLUDES = ${BLOPEX_INCLUDE} ${ELPA_INCLUDE} ${EVSL_INCLUDE} ${HPDDM_INCLUDE} ${PRIMME_INCLUDE} ${POLAR_INCLUDE} ${KSVD_INCLUDE}
SLEPC_CC_INCLUDES   = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES} ${PETSC_CC_INCLUDES}
SLEPC_FC_INCLUDES   = ${SLEPC_INCLUDE} ${PETSC_FC_INCLUDES}

SLEPC_CCPPFLAGS     = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES}
SLEPC_CXXCPPFLAGS   = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES}
SLEPC_FCPPFLAGS     = ${SLEPC_INCLUDE}
SLEPC_CUDACPPFLAGS  = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES}
SLEPC_C_SH_LIB_PATH = ${CC_LINKER_SLFLAG}${SLEPC_LIB_DIR}
SLEPC_F_SH_LIB_PATH = ${FC_LINKER_SLFLAG}${SLEPC_LIB_DIR}

# Redefine variables in PETSc makefiles
INSTALL_LIB_DIR = ${SLEPC_LIB_DIR}
CCPPFLAGS       = ${SLEPC_CCPPFLAGS} ${PETSC_CCPPFLAGS}
CXXCPPFLAGS     = ${SLEPC_CXXCPPFLAGS} ${PETSC_CXXCPPFLAGS}
FCPPFLAGS       = ${SLEPC_FCPPFLAGS} ${PETSC_FCPPFLAGS}
CUDACPPFLAGS    = ${SLEPC_CUDACPPFLAGS} ${PETSC_CUDACPPFLAGS}

# Variables for the different SLEPc modules
SLEPC_SYS_LIB_BASIC = -lslepcsys
SLEPC_MFN_LIB_BASIC = -lslepcmfn ${SLEPC_SYS_LIB_BASIC}
SLEPC_LME_LIB_BASIC = -lslepclme ${SLEPC_SYS_LIB_BASIC}
SLEPC_EPS_LIB_BASIC = -lslepceps ${SLEPC_SYS_LIB_BASIC}
SLEPC_SVD_LIB_BASIC = -lslepcsvd ${SLEPC_EPS_LIB_BASIC}
SLEPC_PEP_LIB_BASIC = -lslepcpep ${SLEPC_EPS_LIB_BASIC}
SLEPC_NEP_LIB_BASIC = -lslepcnep ${SLEPC_PEP_LIB_BASIC}
SLEPC_LIB_BASIC     = -lslepcnep -lslepcpep -lslepcsvd -lslepceps -lslepcmfn -lslepclme -lslepcsys

SLEPC_SYS_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_SYS_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_SNES_LIB}
SLEPC_MFN_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_MFN_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_SNES_LIB}
SLEPC_LME_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_LME_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_SNES_LIB}
SLEPC_EPS_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_EPS_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_SNES_LIB}
SLEPC_SVD_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_SVD_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_SNES_LIB}
SLEPC_PEP_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_PEP_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_SNES_LIB}
SLEPC_NEP_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_NEP_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_SNES_LIB}
SLEPC_LIB       = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_SNES_LIB}

SLEPC_EXTERNAL_LIB = ${ARPACK_LIB} ${BLOPEX_LIB} ${ELPA_LIB} ${EVSL_LIB} ${HPDDM_LIB} ${PRIMME_LIB} ${SLICOT_LIB} ${TRLAN_LIB} ${POLAR_LIB} ${KSVD_LIB}

# Redefine variable used to build shared libraries
SHLIBS = libslepcsys libslepcmfn libslepclme libslepceps libslepcsvd libslepcpep libslepcnep

# Include definitions customized by configuration
include ${SLEPC_DIR}/${PETSC_ARCH}/lib/slepc/conf/slepcvariables

