#------------------------------------------------------------------------------
# SIONlib Makefile Definitions (Makefile.defs.bgp-be)
#------------------------------------------------------------------------------

CFGKEY = bgp
CONFIG = IBM BlueGene/P

PREFIX = $(TOPDIR)/../../install/sionlib_bgp

#------------------------------------------------------------------------------
# Platform Settings
#------------------------------------------------------------------------------
PREC   = 32
PFLAG  =
AFLAG  =

PLAT     = bgp
MACHINE  = -DMACHINE=\"IBM\ BG/P\"
PLAT_LDIR   = -DPFORM_LDIR=\".\"
PLATCC   = mpicc -O -I/bgsys/drivers/ppcfloor/arch/include
PLAT_CONF= $(MACHINE) $(PLAT_LDIR)

BGP_SYS = /bgsys/drivers/ppcfloor/
BG_INCLUDE=-I$(BGP_SYS)/comm/include -I$(BGP_SYS)/arch/include 
BGPPERSINC=$(BG_INCLUDE) -L$(BGP_SYS)/lib

LARGEFILE=-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__USE_LARGEFILE64 -D__USE_FILE_OFFSET64
SION_DEBUG       = 

#------------------------------------------------------------------------------
# SIONlib General Settings
#------------------------------------------------------------------------------
OPTFLAGS =
CC       = /bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc-bgp-linux-gcc
CFLAGS   = $(OPTFLAGS) $(LARGEFILE) $(BGPPERSINC)
CXX      = /bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc-bgp-linux-g++
CXXFLAGS = $(OPTFLAGS) -O3 -qarch=450d -qtune=450 $(LARGEFILE)
F77      = /bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc-bgp-linux-gfortran
F90      = /bgsys/drivers/ppcfloor/gnu-linux/bin/powerpc-bgp-linux-gfortran -qfree=f90 -qsuffix=f=f90 -qsuppress=cmpmsg
FFLAGS   = $(OPTFLAGS) $(BGPPERSINC)
FPP      = -qsuffix=cpp=F90
FDOPT    = -WF,-D
LDFLAGS  = $(OPTFLAGS) $(BGPPERSINC)
UTILLIB  = 

#------------------------------------------------------------------------------
# SIONlib Settings
#------------------------------------------------------------------------------

SION_PLATFORM    = -D_SION_BGP
ARCH             = BGP

# Library Naming Scheme: see Makefile.defs.linux-gomp
SION_LIBNAME_COM = sioncomgcc_$(PREC)
SION_LIBNAME_SER = sionsergcc_$(PREC)
SION_LIBNAME_GEN = siongengcc_$(PREC)
SION_LIBNAME_OMP     = sionompgcc_$(PREC)
SION_LIBNAME_MPI     = sionmpigcc_$(PREC)
SION_LIBNAME_OMPI    = sionompigcc_$(PREC)

PARUTILENABLE    = 1

FORTRANENABLE    = 1
FORTRANNAMES     = -D_FORTRANNOUNDERSCORE
SION_LIBNAME_F77_SER = sionsergcc_f77_$(PREC)
SION_LIBNAME_F77_MPI = sionmpigcc_f77_$(PREC)
SION_LIBNAME_F90_SER = sionsergcc_f90_$(PREC)
SION_LIBNAME_F90_MPI = sionmpigcc_f90_$(PREC)
SION_MODPATH = modgcc_$(PREC)

CXXENABLE            = 0
SION_LIBNAME_CXX_SER = sionser_cxx_$(PREC)
SION_LIBNAME_CXX_MPI = sionmpi_cxx_$(PREC)

PYTHONENABLE    = 0


#------------------------------------------------------------------------------
# MPI Settings
#------------------------------------------------------------------------------

MPIENABLE = 1
MPICC     = mpicc
MPICXX    = mpicxx
MPIF90    = mpif90
MPILIB    =
PMPILIB   = ${MPILIB}
FMPILIB   = 
FMPIOBJ   = 
MPITEST   = mpi_test mpi_test2
MPIFTEST  = mpi_ftest
MPIFLAG = -DSION_MPI
MPITESTRUN = mpirun -np 4 -exp_env SION_ERROR_MSG_RANK -exp_env SION_DEBUG -exp_env SION_DEBUG_MASK -exp_env SION_DEBUG_RANK1 -exp_env SION_DEBUG_RANK2 -exp_env SION_DEBUG_SILENT  -exp_env OMP_NUM_THREADS
MPI_CONFIG_TARGETS  = 

#------------------------------------------------------------------------------
# OpenMP Settings
#------------------------------------------------------------------------------

OMPENABLE  = 0
OMPCC      = $(CC)
OMPCXX     = $(CXX)
OMPF90     = $(F90)
OMPFLAG    = 
# There is no OpenMP support for the compiler

#------------------------------------------------------------------------------
# Hybrid MPI/OpenMP Settings
#------------------------------------------------------------------------------

HYBENABLE  = 0
HYBCC      = $(MPICC)
HYBCXX     = $(MPICXX)
HYBF90     = $(MPIF90)
HYBFLAG    = 
# There is no OpenMP support for the compiler

#------------------------------------------------------------------------------
# Compression Support
#------------------------------------------------------------------------------

SZLIB          = szlib
SZLIB_OPTFLAGS = -O3
SZLIB_CFLAGS   = -I$(TOPDIR)/utils/szlib -DELG_COMPRESSED
SZLIB_LIBPATH  = -L$(TOPDIR)/utils/szlib
SZLIB_LIB      = -lsc.z

#------------------------------------------------------------------------------
# SIONlib HINTS library
#------------------------------------------------------------------------------
GPFS_HINTS_LIB  = -L/usr/lpp/mmfs/lib -lgpfs
GPFS_HINTS_INC  = -I/usr/lpp/mmfs/include
LINUX_HINTS_LIB = -L/usr/lib
LINUX_HINTS_INC = -I/usr/include

HINTSDEF=
HINTSINC=
HINTSLIB=

#------------------------------------------------------------------------------
# SIONlib Cache Settings
#------------------------------------------------------------------------------

CACHEFLAGS=
CACHELIB=
#CACHEFLAGS=-D_SION_CACHE
#CACHELIB=-lrt
