# Copyright (C) 2005, 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_cpp

# 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_main.o \
	hs071_nlp.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.   #
##########################################################################

# C++ Compiler command
CXX = mpicxx

# C++ Compiler options
CXXFLAGS = -pipe -Wall -O2 -march=i586 -mtune=i686 -I/usr/include/parmetis -I/usr/lib/openmpi/include  

# additional C++ Compiler options for linking
CXXLINKFLAGS =  -Wl,--rpath -Wl,/usr/lib

# Directory with header files
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  -L/usr/src/RPM/BUILD/ipopt-3.7.0 -L/usr/lib/openmpi/lib -L/usr/lib/gcc/i586-alt-linux/4.4.1 -L/usr/lib/gcc/i586-alt-linux/4.4.1/../../.. -lcmumps -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lesmumps -lscotcherr -lscotch -lparmetis -lmetis -lscalapack_LINUX-0 -lblacs -llapack -llapack_atlas -lf77blas -lblas -lmpi_cxx -lmpi_f77 -lmpi -R/usr/lib/openmpi/lib -Rpath=/usr/lib/openmpi/lib -lopen-rte -lopen-pal -ldl -lnsl -lutil -lgfortranbegin -lgfortran -lm -lpthread

# 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: .cpp .c .o .obj

$(EXE): $(OBJS)
	bla=;\
	for file in $(OBJS); do bla="$$bla `$(CYGPATH_W) $$file`"; done; \
	$(CXX) $(CXXLINKFLAGS) $(CXXFLAGS) -o $@ $$bla $(ADDLIBS) $(LIBS)

clean:
	rm -rf $(EXE) $(OBJS) ipopt.out

.cpp.o:
	$(CXX) $(CXXFLAGS) $(INCL) -c -o $@ $<


.cpp.obj:
	$(CXX) $(CXXFLAGS) $(INCL) -c -o $@ `$(CYGPATH_W) '$<'`
