# Copyright (C) 2003, 2009 International Business Machines and others.
# All Rights Reserved.
# This file is distributed under the Common Public License.

# $Id: Makefile.in 1428 2009-04-18 00:41:05Z andreasw $

##########################################################################
#    You can modify this example makefile to fit for your own program.   #
#    Usually, you only need to change the five CHANGEME entries below.   #
##########################################################################

# CHANGEME: This should be the name of your executable
EXE = hs071_f

# CHANGEME: Here is the name of all object files corresponding to the source
#           code that you wrote in order to define the problem statement
OBJS = hs071_f.o

# CHANGEME: Additional libraries
ADDLIBS =

# CHANGEME: Additional flags for compilation (e.g., include flags)
ADDINCFLAGS =

##########################################################################
#  Usually, you don't have to change anything below.  Note that if you   #
#  change certain compiler options, you might have to recompile Ipopt.   #
##########################################################################

# Fortran Compiler options
F77 = mpif77

# Fotran Compiler options
FFLAGS = -pipe -Wall -O2 -march=i586 -mtune=i686 -I/usr/include/parmetis -I/usr/lib/openmpi/include 

# additional Fortran Compiler options for linking
F77LINKFLAGS =  -Wl,--rpath -Wl,/usr/lib

# Directory with include file
IPOPTINCDIR = /usr/include/coin

# Directory with libipopt.a
IPOPTLIBDIR = /usr/lib
exec_prefix = /usr
prefix = /usr

# Libraries necessary to link with IPOPT
LIBS = -L$(IPOPTLIBDIR) -lipopt -lcmumps -ldmumps -lsmumps -lzmumps -lmumps_common -lpord  -lparmetis -lmetis -llapack -llapack_atlas -lf77blas -lblas -llapack -llapack_atlas -lf77blas -lblas -lm -lcmumps -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lesmumps -lscotcherr -lscotch -lparmetis -lmetis -lscalapack_LINUX-0 -L/usr/src/RPM/BUILD/ipopt-3.7.0 -lblacs -llapack -llapack_atlas -lf77blas -lblas -L/usr/lib/openmpi/lib -lmpi_cxx -lmpi_f77 -lmpi -Wl,-R/usr/lib/openmpi/lib -ldl -lstdc++ -lm

# Necessary Include dirs (we use the CYGPATH_W variables to allow
# compilation with Windows compilers)
INCL =  -I`$(CYGPATH_W) $(IPOPTINCDIR)` $(ADDINCFLAGS)

# The following is necessary under cygwin, if native compilers are used
CYGPATH_W = echo

all: $(EXE)

.SUFFIXES: .f .o .obj

$(EXE): $(OBJS)
	bla=;\
	for file in $(OBJS); do bla="$$bla `$(CYGPATH_W) $$file`"; done; \
	$(F77) $(F77LINKFLAGS) $(FFLAGS) -o $@ $$bla $(ADDLIBS) $(LIBS)

clean:
	rm -f $(EXE) $(OBJS) IPOPT.OUT

.f.o:
	$(F77) $(FFLAGS) $(INCL) -c -o $@ $<


.f.obj:
	$(F77) $(FFLAGS) $(INCL) -c -o $@ `$(CYGPATH_W) '$<'`
