# (-*-makefile-*-)
#
# This makefile is included from 'makefile'.  It defines the
# various machine dependent things such as compiler commands,
# directories, libraries, etc.
#

# ipd: i want to call these basis (kenel) llibraries which should be
#      pluggable for PW/WL, of course first WL need to evolve a bit
#
# FFTW directories
#
#FFTW_DIR = /home/ivan/LIB/FFTW/fftw-2.1.3/fftw
#FFTW_LIB_OPTS =  -lfftw 
#FFTW_INCL_OPTS = -I${FFTW_DIR}
#BASIS_INCL_OPTS = ${FFTW_INCL_OPTS}


#IPD: we should exclude these from the wavelet compilation
# we could also wrap the wl kernels in a separate library
# which should be swithcable w/ the fft

#
# The matrix diagonalization libraries, object, and and compile options
# (LAPACK, ESSL, or the in-house supplied Jacobi diagonalizer).
# 
# MATDIAG_OBJ must be either lapackdiagF77.o, essldiagF77.o, or jacobi.o
# depending on which library you are going to use.
#
# MATDIAG_OPTS tells the system which library you will be using.
# Set it to one of -DDFT_USE_LAPACK, -DDFT_USE_ESSL, or -DDFT_USE_JACOBI
# jacobi.o is self contained diag library, which may be somewhat slower
# If you are going to use LAPACK/ESSL include the interface files 
# matdiagC.o lapackdiagF77.o/essldiagF77.o
# IPD: would be nice to call fortran directly, or at least avoid
#      matdiagC level

#
# MATDIAG_LIB_DIR is the directory where the lapack library lives
#                 (needed if the complier can't find it automatically)
#                 If using jacobi.o, set it to ".".
#
# MATDIAG_OBJ = jacobi.o
# MATDIAG_OPTS = -DDFT_USE_JACOBI
#MATDIAG_LIB_DIR = 
#MATDIAG_LIB = 

MATDIAG_OBJ =  matdiagC.o lapackdiagF77.o
MATDIAG_OPTS = -DDFT_USE_LAPACK
#MATDIAG_LIB_DIR = -L/usr/lib/3dnow -L/usr/lib/3dnow/atlas 
MATDIAG_LIB_OPTS =  -ldxmlp

#
# Parallelization options: machine dependent ones go here, **PLUS**
#
#    put -DDFT_THREAD  to use POSIX threads (SMP)
#    put -DDFT_MPI to use MPI (DMP)
# (you can specify both if needed)
#
# --- MPI AND THREADS ---
# PARALLEL_OPTS =  -DDFT_MPI -DDFT_THREAD 
# PARALLEL_LIBS = -lmpich -lpthread
# PARALLEL_LIBDIR = -L/usr/lib/mpich/lib
# PARALLEL_INCDIR = -I/usr/lib/mpich/include

PARALLEL_OPTS = -DDFT_MPI
PARALLEL_LIBS = -lmpi -lelan

# PARALLEL_OPTS = -DDFT_THREAD 
# PARALLEL_LIBS = -lpthread


# Our libraries:  FFTW, math library, and possible LAPACK/BLAS libraries
#
LIBS = ${FFTW_LIB_OPTS} ${PARALLEL_LIBS} ${MATDIAG_LIB_DIR} $(MATDIAG_LIB_OPTS) -lfor -lm 
#       -lf77lapack -lf77blas -lfftw -lm -lf2c

#
# Optimization options for all compilers
#
OPTIM_OPTS =

#
# Compiler flags for all compilers
#
#COMPILE_OPTS = -O5 -I. -Icommands ${PARALLEL_INCDIR} ${BASIS_INCL_OPTS} \
#	${OPTIM_OPTS} ${PARALLEL_OPTS} ${MATDIAG_OPTS}  -DDFT_PROFILING
COMPILE_OPTS = -g -I. -Icommands ${PARALLEL_INCDIR} ${BASIS_INCL_OPTS} \
	${OPTIM_OPTS} ${PARALLEL_OPTS} ${MATDIAG_OPTS} -Dnewgridtype \
	-DDFT_PROFILING

#
# C++ compiler and options
#
CPLUSPLUS = c++
CPLUSPLUSOPTS = -O3 -fomit-frame-pointer ${COMPILE_OPTS} 
#CPLUSPLUSOPTS = ${COMPILE_OPTS}
#CPLUSPLUSOPTS = -fast -arch ev67


#
# Linker to use
#
# Note:  on some linux platforms, using ${F77} as the linker works
# better (then you exclude any -lf2c libraries).
#
LINKER = ${CPLUSPLUS}
#LINKER = ${F77}

#
# Linking options: static/dynamic flags, etc., if any
#
LINKOPTS = ${CPLUSPLUSOPTS} ${PARALLEL_LIBDIR} 
#LINKOPTS = ${F77OPTS} ${PARALLEL_LIBDIR} 


syntax highlighted by Code2HTML, v. 0.9.1