#===============================================================================
#
# BQCD -- Berlin Quantum ChromoDynamics programme
#
# Author: Hinnerk Stueben <stueben@zib.de>
#
# Copyright (C) 2002-2006, Hinnerk Stueben, Zuse-Institut Berlin
#
#-------------------------------------------------------------------------------
#
# Makefile-ibm.var - settings on IBM
#
#-------------------------------------------------------------------------------

timing    = 1
mpi       = 1
omp       =  
debug     = 
bits64    = 1
libd      = 2
d3_buffer_vol = 24*24*12*12

#-------------------------------------------------------------------------------

SHELL     = /bin/ksh

FPP       = /usr/ccs/lib/cpp -C -P
F90       = xlf90_r -qsuffix=f=f90
CC        = cc_r
AR        = ar
RANLIB    = echo

# suppressed messages:
#
# 1500-036 (I) The NOSTRICT option (default at OPT(3)) has the potential 
#              to alter the semantics of a program
#
# 1516-092 (E) If a statement function expression contains a reference
#              to a function or a function dummy procedure, the
#              reference must not require an explicit interface or be
#              a transformational intrinsic

MODULES_FLAG = -I$(MODULES_DIR)

MYFLAGS   = -DIBM
FFLAGS_STD= $(MODULES_FLAG) -qsuppress=1500-036:1516-092  #:1501-510:1516-092:1514-008
CFLAGS_STD= -DLongLong -DNamesToLower
ARFLAGS   = -r -v

LDFLAGS   = 
SYSLIBS   = 

FAST_MAKE = gmake -j 8

CKSUM_O   = cksum.o
RANDOM_O  = ran.o ranf.o
UUU_O     = uuu_f90.o

LIBD      = 
LIBCOMM   = lib_single_pe.a
LIBCLOVER = libclover.a

#-------------------------------------------------------------------------------

ifdef timing
    MYFLAGS  += -DTIMING
endif

ifdef mpi
    F90       = mpxlf90_r -qsuffix=f=f90
    LIBCOMM   = lib_mpi.a
endif

ifdef omp
    F90      += -qsmp=omp
    MYFLAGS  += -D_OPENMP
endif

ifdef debug
    FFLAGS    = -g -qfullpath $(FFLAGS_STD)
    CFLAGS    = -g -qfullpath $(CFLAGS_STD)
else
    FFLAGS    = -O3 $(FFLAGS_STD)
    CFLAGS    = -O2 $(CFLAGS_STD)
endif    

ifdef bits64
    F90      += -q64
    CFLAGS   += -q64
    ARFLAGS  += -X64
else
    LDFLAGS  += -bmaxdata:2000000000 -bmaxstack:250000000
endif


ifeq ($(libd),1)
    LIBD      = libd1.a
    MYFLAGS  += -DD3_BUFFER_VOL=1
endif

ifeq ($(libd),2)
    LIBD      = libd2.a
    MYFLAGS  += -DD3_BUFFER_VOL=1
endif

ifeq ($(libd),21)
    LIBD      = libd21.a
    MYFLAGS  += -DD3_BUFFER_VOL=1
endif

ifeq ($(libd),3)
    LIBD      = libd3.a
    MYFLAGS  += -DD3_BUFFER_VOL='$(d3_buffer_vol)'
endif

#===============================================================================
