# -*- Makefile -*- 
# Generic makefile for dealing with various machines

# MACHINE
#USE_HOME=USE_HOME
#USE_LAPTOP=USE_LAPTOP 
#USE_WORK_64=USE_WORK_64
#USE_WORK_64_OLD=USE_WORK_64_OLD
#USE_WORK_32=USE_WORK_32
#USE_WULF=USE_WULF
#USE_WULF_32=USE_WULF_32

# MACHINE DEPENDENT DIRECTORIES 

# The following should be defined in the master makefile
# BASE_DIR - this is the git directory and all repositories should be hung off 
#            this directory.
# OUT_DIR  - directory for the object files and executable

# HOME
ifdef USE_HOME

ifndef CC
  CC = gcc
endif
ifndef FC
  FC = gfortran
endif
ifndef CFLAGS
  CFLAGS = -g -static
endif

IMSL_BASE_DIR = /opt/vni/CTT6.0

GSL_INCLUDE_DIR = /usr/include/gsl
GSL_LIBS_DIR = /usr/lib

LAPACK_LIBS_DIR = $(HOME)/lapack-3.2.1/libs
LAPACK_LIBS = -llapack_linux -lblas_linux

MKL_BASE_DIR = /opt/intel/Compiler/11.1/069/mkl
MKL_LIBS_DIR = $(MKL_BASE_DIR)/lib/em64t
MKL_LIBS = -Wl,--start-group -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp 
#MKL_LIBS = -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group 

#MKL_BASE_DIR = /opt/intel/Compiler/11.1/069/mkl
#MKL_LIBS_DIR = $(MKL_BASE_DIR)/lib/32
#MKL_LIBS = -Wl,--start-group -lmkl_intel -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp 
#MKL_LIBS = -Wl,--start-group -lmkl_intel -lmkl_sequential -lmkl_core -Wl,--end-group 

ATLAS_LIBS_BASE = $(HOME)/atlas-3.8.3/lib-atlas
ATLAS_LIBS = -llapack -lptf77blas -lptcblas -latlas

NPSOL_DIR = $(HOME)/npsol-5.0/lib
endif

# LAPTOP
ifdef USE_LAPTOP

ifndef CC
  CC = gcc
endif
ifndef FC
  FC = gfortran
endif
ifndef CFLAGS
  CFLAGS = -g -static
endif

#IMSL_BASE_DIR = /opt/vni/CTT6.0

GSL_INCLUDE_DIR = /usr/local/include/gsl
GSL_LIBS_DIR = /usr/local/lib

MKL_BASE_DIR = /opt/intel/Compiler/11.1/069/mkl
MKL_LIBS_DIR = $(MKL_BASE_DIR)/lib/32
MKL_LIBS = -Wl,--start-group -lmkl_intel -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp 
#MKL_LIBS = -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group 

#NPSOL_DIR = /home/f1dfw14/data/npsol-5.0
endif

# WORK_64
ifdef USE_WORK_64

ifndef CC
  CC = gcc
endif
ifndef FC
  FC = gfortran
endif
ifndef CFLAGS
  CFLAGS = -g -static
endif

MKL_BASE_DIR = /opt/intel/Compiler/11.1/069/mkl
MKL_LIBS_DIR = $(MKL_BASE_DIR)/lib/em64t
MKL_LIBS = -Wl,--start-group -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp 
#MKL_LIBS = -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group 


LAPACK_LIBS_DIR = $(HOME)/lapack-3.2/lib4.2.4
LAPACK_LIBS = -llapack_linux -lblas_linux
#LAPACK_LIBS = -llapack_debug -lblas_debug

ATLAS_LIBS_BASE = $(HOME)/atlas-3.8.3/lib-atlas
ATLAS_LIBS = -llapack -lptf77blas -lptcblas -latlas

GSL_INCLUDE_DIR = /usr/local/include/gsl
GSL_LIBS_DIR = /usr/local/lib

NPSOL_DIR = /home/f1dfw14/data/npsol-5.0

FORTRAN_LIBS = /usr/lib/gcc/x86_64-linux-gnu/4.2.4/libgfortran.a
endif

# WORK_32
ifdef USE_WORK_32

ifndef CC
  CC = gcc
endif
ifndef FC
  FC = gfortran
endif
ifndef CFLAGS
  CFLAGS = -g -static
endif

MKL_BASE_DIR = /opt/intel/mkl/9.1.021
MKL_LIBS_DIR = $(MKL_BASE_DIR)/lib/32
MKL_LIBS = -lmkl_lapack -lmkl_ia32 -lguide

IMSL_BASE_DIR = /opt/vni/CTT6.0
endif

#WULF
ifdef USE_WULF

ifndef CC
  CC = gcc
endif
ifndef FC
  FC = gfortran
endif
ifndef CFLAGS
  CFLAGS = -g -static
endif

MKL_BASE_DIR = /opt/intel/mkl/9.0
MKL_LIBS_DIR = $(MKL_BASE_DIR)/lib/em64t
MKL_LIBS = -lmkl_lapack -lmkl_em64t -lguide

GSL_INCLUDE_DIR = /usr/local/include/gsl
GSL_LIBS_DIR = /usr/local/lib

IMSL_BASE_DIR = /opt/vni/CTT6.0
endif

#WULF_32
ifdef USE_WULF_32

ifndef CC
  CC = gcc
endif
ifndef FC
  FC = gfortran
endif
ifndef CFLAGS
  CFLAGS = -g -static
endif

MKL_BASE_DIR = /opt/intel/mkl/8.1
MKL_LIBS_DIR = $(MKL_BASE_DIR)/lib/32
MKL_LIBS = -lmkl_lapack -lmkl_ia32

GSL_INCLUDE_DIR = /usr/local/include/gsl
GSL_LIBS_DIR = /usr/local/lib

IMSL_BASE_DIR = /opt/vni/CTT6.0
endif

ifndef TZ_DIR
  TZ_DIR = $(BASE_DIR)/utilities_dw/TZCcode
endif
ifndef DW_BASE_DIR
  DW_BASE_DIR = $(BASE_DIR)
endif