#
#  This file is part of MUMPS 5.0.2, released
#  on Fri Jul 15 09:12:54 UTC 2016
#
# These settings for a PC under Debian/linux with standard packages :
# metis (parmetis), scotch (ptscotch), openmpi, gfortran

# packages installation :
# apt-get install libmetis-dev libparmetis-dev libscotch-dev libptscotch-dev libatlas-base-dev openmpi-bin libopenmpi-dev

# Begin orderings
LSCOTCHDIR = ${ISSM_DIR}/externalpackages/petsc/install/lib
ISCOTCH   = -I${ISSM_DIR}/externalpackages/petsc/install/include # only needed for ptscotch

LSCOTCH   = -L$(LSCOTCHDIR) -lptesmumps -lptscotch -lptscotcherr -lscotch
#LSCOTCH   = -L$(LSCOTCHDIR) -lesmumps -lscotch -lscotcherr

LPORDDIR = $(topdir)/PORD/lib/
IPORD    = -I$(topdir)/PORD/include/
LPORD    = -L$(LPORDDIR) -lpord

LMETISDIR = ${ISSM_DIR}/externalpackages/petsc/install/lib
IMETIS    = -I${ISSM_DIR}/externalpackages/petsc/install/include
#IMETIS    = -I/usr/include/metis

LMETIS    = -L$(LMETISDIR) -lparmetis -lmetis
#LMETIS    = -L$(LMETISDIR) -lmetis

# Corresponding variables reused later
#ORDERINGSF = -Dmetis -Dpord -Dparmetis -Dscotch -Dptscotch
ORDERINGSF = -Dmetis -Dpord -Dscotch
ORDERINGSC  = $(ORDERINGSF)
LORDERINGS = $(LMETIS) $(LPORD) $(LSCOTCH)
IORDERINGSF = $(ISCOTCH)
IORDERINGSC = $(IMETIS) $(IPORD) $(ISCOTCH)
# End orderings
################################################################################

PLAT    =
LIBEXT  = .a
OUTC    = -o
OUTF    = -o
RM = /bin/rm -f
CC = ${ISSM_DIR}/externalpackages/mpich/install/bin/mpicc
FC = ${ISSM_DIR}/externalpackages/mpich/install/bin/mpifort
FL = ${ISSM_DIR}/externalpackages/mpich/install/bin/mpifort
AR = ar vr
RANLIB = ranlib
SCALAP  = -L${ISSM_DIR}/externalpackages/scalapack/install/lib -lscalapack

INCPAR = -I${ISSM_DIR}/externalpackages/mpich/install/include

LIBPAR = $(SCALAP) -L${ISSM_DIR}/externalpackages/mpich/install/lib -lmpi -lmpifort

INCSEQ = -I$(topdir)/libseq
LIBSEQ  =  -L$(topdir)/libseq -lmpiseq

LIBBLAS = -L${ISSM_DIR}/externalpackages/openblas/install/lib -lopenblas
LIBOTHERS = -lpthread

#Preprocessor defs for calling Fortran from C (-DAdd_ or -DAdd__ or -DUPPER)
CDEFS   = -DAdd_

#Begin Optimized options
# uncomment -fopenmp in lines below to benefit from OpenMP
OPTF    = -O  -DALLOW_NON_INIT # -fopenmp
OPTL    = -O # -fopenmp
OPTC    = -O # -fopenmp
#End Optimized options
INCS = $(INCPAR)
LIBS = $(LIBPAR)
LIBSEQNEEDED =
