#===============================================================================
#
# BQCD -- Berlin Quantum ChromoDynamics programme
#
# Author: Hinnerk Stueben <stueben@zib.de>
#
# Copyright (C) 2005, Hinnerk Stueben, Zuse-Institut Berlin
#
#-------------------------------------------------------------------------------
#
# Makefile-altix.var - settings on SGI-Altix
#
#-------------------------------------------------------------------------------

timing    = 1
mpi       = 1  
omp       = 1  
shmem     =  
shmempi   =  
debug     = 
libd      = 2
d3_buffer_vol = 32*32*16*16

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

SHELL     = /bin/ksh

FPP       = mpif90  -g -E
FPP2      = icc  -E -C -P
F90       = mpif90     
CC        = mpicc  
AR        = ar
RANLIB    = echo

MODULES_FLAG = -I$(MODULES_DIR)

MYFLAGS   = -DINTEL -DALTIX
FFLAGS_STD= $(MODULES_FLAG)
CFLAGS_STD= -DNamesToLower_
ARFLAGS   = rv

LDFLAGS   = -Vaxlib  
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
    LIBCOMM   = lib_mpi.a
endif

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

ifdef shmem
    LDFLAGS  += -lsma
    LIBCOMM   = lib_shmem.a
endif

ifdef shmempi
    LDFLAGS  += -lsma
    LIBCOMM   = lib_shmempi.a
endif

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

ifeq ($(libd),1)
    LIBD      = libd.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

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