# 
# This file is part of the SIESTA package.
#
# Copyright (c) Fundacion General Universidad Autonoma de Madrid:
# E.Artacho, J.Gale, A.Garcia, J.Junquera, P.Ordejon, D.Sanchez-Portal
# and J.M.Soler, 1996- .
# 
# Use of this software constitutes agreement with the full conditions
# given in the SIESTA license, as signed by all legitimate users.
#
.SUFFIXES:
.SUFFIXES: .f .F .o .a .f90 .F90

SIESTA_ARCH=x86_fedora-unknown-linux-gnu--Intel

FPP=
FPP_OUTPUT= 
FC=mpif90
RANLIB=ranlib

SYS=nag

SP_KIND=4
DP_KIND=8
KINDS=$(SP_KIND) $(DP_KIND)

#FFLAGS=-O2 -mtune=core2 -xP -mp1 -prefetch
#FFLAGS= -g -mp -O2 #-Vaxlib -static -i-static # -vec-report0
FFLAGS= -g -O2
FPPFLAGS= -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DWXML_INIT_FIX 
LDFLAGS= -Vaxlib -i-static -static

ARFLAGS_EXTRA=

FCFLAGS_fixed_f=
FCFLAGS_free_f90=
FPPFLAGS_fixed_F=
FPPFLAGS_free_F90=

BLAS_LIBS= -L $(HOME)/intel/mkl/9.1.023/lib/32/ -libmkl_ia32
#-L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl_em64t
LAPACK_LIBS= -L $(HOME)/intel/mkl/9.1.023/lib/32/ -lmkl_lapack
#-L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl_lapack
BLACS_LIBS=
SCALAPACK_LIBS=

COMP_LIBS= 


#
# This (as well as the -DMPI definition) is essential for MPI support
MPI_INTERFACE=libmpi_f90.a
MPI_INCLUDE=.

# Preprocessor definitions or flags.
# Here we use FPPFLAGS (as 'configure' calls them), but historically
# it was very common to use DEFS. Try to use only FPPFLAGS from now on,
# converting any old arch.make files you might have lying around, and
# remember that you have to change the final building rules at the end
# to use only FPPFLAGS. DEFS is deprecated.

#LIBS=$(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(NETCDF_LIBS)
LIBS= -L/home/akbar/Packages/scalapack-1.8.0 -lscalapack -L/home/akbar/Packages/BLACS/LIB -lblacsF77init -lblacs -lblacsCinit

#-L/usr/local/software/install/scalapack-1.7.5 -lscalapack 
#-L/usr/local/software/install/BLACS/LIB -lblacsF77init -lblacs -lblacsCinit -lmkl_lapack -lmkl_em64t -l#guide -lpthread_nonshared -lmkl_core 

#SIESTA needs an F90 interface to MPI
#This will give you SIESTA's own implementation
#If your compiler vendor offers an alternative, you may change
#to it here.
MPI_INTERFACE= libmpi_f90.a
MPI_INCLUDE= /usr/local/include
MPI_LIBS= -L/usr/local/lib -lfmpich -lmpich -lmpif90
DEFS_MPI= -DMPI

#Dependency rules are created by autoconf according to whether
#discrete preprocessing is necessary or not.
.F.o:
	$(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F)  $< 
.F90.o:
	$(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_free_F90) $< 
.f.o:
	$(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_fixed_f)  $<
.f90.o:
	$(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90)  $<

