# 
# 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_64-linux-Intel

FPP=/opt/openmpi-1.5.3/intel/bin/mpif90
FPP_OUTPUT= 
FC=/opt/openmpi-1.5.3/intel/bin/mpif90

AR=xiar
RANLIB=ranlib

SYS=nag

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

FFLAGS=-O3 -ipo -xHost -ip -prec-div -prec-sqrt -opt-prefetch -fp-model fast=1 -opt-matmul -static-intel -I/opt/netcdf-4.1.2/intel/include -I/opt/intel/composerxe-2011.4.191/mkl/include -I/opt/intel/composerxe-2011.4.191/mkl/include/intel64/lp64 -mkl=sequential
FPPFLAGS=-DTSS  -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DCDF
LDFLAGS=-L/opt/intel/composerxe-2011.4.191/mkl/lib/intel64 -L/opt/netcdf-4.1.2/intel/lib -L/opt/openmpi-1.5.3/intel/lib -mkl=sequential -opt-matmul

ARFLAGS_EXTRA=

FCFLAGS_fixed_f=
FCFLAGS_free_f90=
FPPFLAGS_fixed_F=
FPPFLAGS_free_F90=

ADDLIB=

BLAS_LIBS=-lmkl_blas95_lp64
LAPACK_LIBS=-lmkl_lapack95_lp64
BLACS_LIBS=-lmkl_blacs_openmpi_lp64
SCALAPACK_LIBS=-lmkl_scalapack_lp64

NETCDF_LIBS=-lnetcdf -lnetcdff

LIBS=$(ADDLIB) $(SCALAPACK_LIBS) $(BLACS_LIBS) $(LAPACK_LIBS) $(BLAS_LIBS) $(NETCDF_LIBS)

#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=.

#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)  $<

