# /******************************************************************* # Copyright (C) 2017 AMPL Optimization, Inc.; written by David M. Gay. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that the copyright notice and this permission notice and warranty # disclaimer appear in supporting documentation. # # The author and AMPL Optimization, Inc. disclaim all warranties with # regard to this software, including all implied warranties of # merchantability and fitness. In no event shall the author be liable # for any special, indirect or consequential damages or any damages # whatsoever resulting from loss of use, data or profits, whether in an # action of contract, negligence or other tortious action, arising out # of or in connection with the use or performance of this software. # *******************************************************************/ # For compiling solvers/examples with Microsoft Visual C++. # Invoke with "nmake -f makefile.vc" , # or "copy makefile.vc makefile", possibly edit makefile, # and then invoke with "nmake". .SUFFIXES: .c .f .obj CC = cl S = .. # "S = .." assumes this directory is solvers/examples . CFLAGS = -nologo -Ot1 -I$S # If things don't run right, you may need to change -Ot1 to -Zi # so you can poke around with a debugger. .c.obj: $(CC) -c $(CFLAGS) $*.c .f.obj: f2c -A $*.f $(CC) -c $(CFLAGS) $*.c del $*.c Lmt = libcmt.lib /link /NODEFAULTLIB:libc.lib Lf2c = $S\vcf2c.lib Lp = cport.lib $(Lf2c) # $(cport) = PORT subroutine library. For the present examples, # it suffices to build cport.lib from a subset of the port/*.f files in # http://www.netlib.org/port.tar # For your possible convenience, solvers/examples/cport.zip contains some # sample makefiles along with the result of running port.tar through f2c. A = $S\amplsolv.lib Af = $S\funcadd0.obj $A all1 = evalchk.exe lin1.exe lin2.exe lin3.exe linrc.exe dualconv.exe nlcopy.exe qtest.exe et.exe all = mng1.exe fmng1.exe nl21.exe fnl21.exe mng.exe mnh.exe nl2.exe tn.exe v8.exe ve08.exe all: $(all1) $(all) echo all made >all # "make all" requires various routines from netlib's opt and port # directories; "make all1" requires just files distributed with # this directory. all1: $(all1) evalchk = evalchk.c $A evalchk.exe: $(evalchk) $(CC) $(CFLAGS) $(evalchk) del evalchk.exp evalchk.lib lin1 = lin1.c $(Af) lin1.exe: $(lin1) $(CC) $(CFLAGS) $(lin1) $(Lmt) del lin1.exp lin1.lib lin1.obj lin2 = lin2.c $A lin2.exe: $(lin2) $(CC) $(CFLAGS) $(lin2) $(Lmt) del lin2.exp lin2.lib lin2.obj lin3 = lin3.c $A lin3.exe: $(lin3) $(CC) $(CFLAGS) $(lin3) $(Lmt) del lin3.exp lin3.lib lin3.obj linrc = linrc.c $A linrc.exe: $(linrc) $(CC) $(CFLAGS) $(linrc) $(Lmt) del linrc.exp linrc.lib linrc.obj mng1 = mng1.c $(Af) mng1.exe: $(mng1) $(CC) $(CFLAGS) $(mng1) $(Lp) $(Lmt) del mng1.exp mng1.lib mng1.obj nl21 = nl21.c $(Af) nl21.exe: $(nl21) $(CC) $(CFLAGS) $(nl21) $(Lp) $(Lmt) del nl21.exp nl21.lib nl21.obj mng = mng.c rvmsg.obj keywds.obj $A mng.exe: $(mng) $(CC) $(CFLAGS) $(mng) $(Lp) $(Lmt) del mng.exp mng.lib mng.obj mnh = mnh.c rvmsg.obj hkeywds.obj $A mnh.exe: $(mnh) $(CC) $(CFLAGS) $(mnh) $(Lp) $(Lmt) del mnh.exp mnh.lib mnh.obj nl2 = nl2.c rvmsg.obj keywds.obj $A nl2.exe: $(nl2) $(CC) $(CFLAGS) $(nl2) $(Lp) $(Lmt) del nl2.exp nl2.lib nl2.obj fmng1 = fmng1.obj $(Af) fmng1.exe: $(fmng1) $(CC) $(CFLAGS) $(fmng1) $(Lp) $(Lmt) del fmng1.exp fmng1.lib fnl21 = fnl21.obj $(Af) fnl21.exe: $(fnl21) $(CC) $(CFLAGS) $(fnl21) $(Lp) $(Lmt) del fnl21.exp fnl21.lib # tn.f and blas.f are available from netlib.exe: ask for "tn from opt". tn = tnmain.c tn.obj blas.obj $(Af) tn.exe: $(tn) $(CC) $(CFLAGS) -Fetn.exe $(tn) $(Lf2c) $(Lmt) del tn.exp tn.lib tnmain.obj # ve08ad.f is available from netlib.exe: ask for "ve08 from opt". # See comments in README about a possible adjustment to ve08ad.f . v8 = v8.c ve08ad.obj $(Af) v8.exe: $(v8) $(CC) $(CFLAGS) $(v8) $(Lp) $(Lmt) del v8.exp v8.lib v8.obj ve08 = ve08.c ve08ad.obj $(Af) ve08.exe: $(ve08) $(CC) $(CFLAGS) $(ve08) $(Lp) $(Lmt) del ve08.exp ve08.lib ve08.obj dualconv = dualconv.c $A dualconv.exe: $(dualconv) $(CC) $(CFLAGS) $(dualconv) $(Lmt) del dualconv.exp dualconv.lib dualconv.obj nlcopy = nlcopy.c $A nlcopy.exe: $(nlcopy) $(CC) $(CFLAGS) $(nlcopy) $(Lmt) del nlcopy.exp nlcopy.lib nlcopy.obj qtest.exe: qtest.c $(CC) $(CFLAGS) -Feqtest.exe qtest.c $(Af) $(Lmt) del qtest.exp qtest.lib qtest.obj gjh.exe: gjh.c $(CC) $(CFLAGS) gjh.c $A $(Lmt) del gjh.exp gjh.lib gjh.obj et.exe: et.c $A $(CC) $(CFLAGS) et.c $A $(Lmt) del et.exp et.lib et.obj $S\amplsolv.lib: cd $S; make amplsolv.lib clean: del /Q *.exe *.obj all test test1 dietd.duw ### "make test" to compare outputs. ### "make test1" to compare outputs that do not require things ### from other netlib directories. test1: lin1 diet | rmcr >foo diff foo lin1diet.out lin2 diet | rmcr >foo diff foo lin2diet.out lin3 diet | rmcr >foo diff foo lin3diet.out linrc diet | rmcr >foo diff foo linrcdie.out dualconv diet foo rmcr foo.nl >goo diff goo dietd.nl copy foo.duw dietd.duw dualconv -u dietd foo rmcr foo.sol >goo diff goo dietu.sol del foo.nl foo.sol foo.duw qtest ch3 | rmcr >foo diff foo ch3qtest.out et -ft et.in >foo rmcr foo >goo diff goo et.out1 del foo goo echo test1 done >test1 test: all test1 mng ch3 | rmcr >foo diff foo ch3mng.out mnh ch3 | rmcr >foo diff foo ch3mnh.out nl2 ch3 | rmcr >foo diff foo ch3nl2.out nl21 ch3 | rmcr >foo diff foo ch3nl21.out tn ch3 | rmcr >foo diff foo ch3tn.out mng ch3 -AMPL rmcr ch3.sol >foo diff foo ch3mng.sol mnh ch3 -AMPL rmcr ch3.sol >foo diff foo ch3mnh.sol nl2 ch3 -AMPL rmcr ch3.sol >foo diff foo ch3nl2.sol tn ch3 -AMPL rmcr ch3.sol >foo diff foo ch3tn.sol del ch3.sol v8 ch3 | rmcr >foo diff foo v8ch3.out ve08 ch3 | rmcr >foo diff foo ve08ch3.out del foo echo tests done. >test