# -----------------------------------------------------------------
# $Revision: 1.2 $
# $Date: 2009/02/17 02:58:47 $
# -----------------------------------------------------------------
# Programmer: Radu Serban @ LLNL
# -----------------------------------------------------------------
# Copyright (c) 2007, The Regents of the University of California.
# Produced at the Lawrence Livermore National Laboratory.
# All rights reserved.
# For details, see the LICENSE file.
# -----------------------------------------------------------------
# Makefile for IDA parallel examples
#
# This file is generated from a template using various variables
# set at configuration time. It can be used as a template for
# other user Makefiles.
#
# Note: if the solver was successfully configured with Blas/Lapack
# support, the Blas/Lapack libraries are specified through the 
# variable LIBRARIES_BL. Otherwise, this variable should contain
# an empty string. We include LIBRARIES_BL in the link line for
# all examples, even the parallel ones which obviously cannot 
# use the Lapack linear solver modules simply to address the case 
# in which the SUNDIALS libraries are shared objects. In that case, 
# the solver library references Lapack  symbols which must be 
# always resolved by linking against the Blas/Lapack libraries. 
# If only static SUNDIALS libraries have been built, it is not 
# required to link the Blas/Lapack libraries for the parallel 
# examples...
# -----------------------------------------------------------------

SHELL = /bin/sh

prefix       = /usr/local/ACTS/gnu-4.6.2/openmpi-1.5.4/sundials-2.4.0
exec_prefix  = /usr/local/ACTS/gnu-4.6.2/openmpi-1.5.4/sundials-2.4.0
includedir   = ${prefix}/include
libdir       = ${exec_prefix}/lib

CPP         = /usr/local/packages/openmpi-1.5.4/bin/mpicc -E
CPPFLAGS    = 
CC          = /usr/local/packages/openmpi-1.5.4/bin/mpicc
CFLAGS      = -g -O2
LDFLAGS     = 
LIBS        = -lm 
MPICC       = /usr/local/packages/openmpi-1.5.4/bin/mpicc
MPI_INC_DIR = /usr/local/packages/openmpi-1.5.4/include
MPI_LIB_DIR = /usr/local/packages/openmpi-1.5.4/lib
MPI_LIBS    = 
MPI_FLAGS   = 

INCLUDES = -I${includedir} -I${MPI_INC_DIR}
LIBRARIES = -lsundials_ida -lsundials_nvecparallel ${LIBS}
LIBRARIES_BL = -llapack -lblas -lm   -L/usr/lib/gcc/x86_64-redhat-linux/4.6.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../.. -lgfortran -lm -lquadmath

EXAMPLES = idaFoodWeb_kry_bbd_p idaFoodWeb_kry_p idaHeat2D_kry_bbd_p idaHeat2D_kry_p

OBJECTS = ${EXAMPLES:=.o}

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

.SUFFIXES : .o .c

.c.o :
	${MPICC} ${CPPFLAGS} ${CFLAGS} ${MPI_FLAGS} ${INCLUDES} -c $<

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

all: ${OBJECTS}
	@for i in ${EXAMPLES} ; do \
	  echo "${MPICC} -o $${i} $${i}.o ${MPI_FLAGS} ${CFLAGS} ${LDFLAGS} -L${libdir} ${LIBRARIES} -L${MPI_LIB_DIR} ${MPI_LIBS} ${LIBRARIES_BL}" ; \
	  ${MPICC} -o $${i} $${i}.o ${MPI_FLAGS} ${CFLAGS} ${LDFLAGS} -L${libdir} ${LIBRARIES} -L${MPI_LIB_DIR} ${MPI_LIBS} ${LIBRARIES_BL}; \
	done

clean:
	rm -f ${OBJECTS}
	rm -f ${EXAMPLES}

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