• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

READMEH A D01-Apr-20209.5 KiB260186

README.SGIH A D01-Apr-20206.7 KiB203153

README.f77H A D01-Apr-20201.8 KiB7554

README.sufH A D01-Apr-20204.7 KiB12596

amplsolv.lbcH A D01-Apr-20201 KiB9190

amplsolv.syH A D01-Apr-20201.3 KiB9190

arith.h0H A D01-Apr-20202.3 KiB6349

arith.h1H A D01-Apr-20201.8 KiB5752

arith.ibmH A D01-Apr-20201.4 KiB3226

arithchk.cH A D01-Apr-20206.4 KiB286235

asl.hH A D01-Apr-202040.7 KiB1,216964

asl_pfg.hH A D01-Apr-20201.2 KiB305

asl_pfgh.hH A D01-Apr-20201.3 KiB316

asldate.cH A D01-Apr-202029 21

atof.cH A D01-Apr-20201.7 KiB5522

auxinfo.cH A D01-Apr-20201.5 KiB4313

avltree.cH A D01-Apr-202011.1 KiB666594

avltree.hH A D01-Apr-20204.6 KiB9633

b_search.cH A D01-Apr-20203.1 KiB13076

basename.cH A D01-Apr-20201.5 KiB5226

bscanf.cH A D01-Apr-20206.1 KiB321280

changesH A D01-Apr-2020129.2 KiB3,1882,680

com2eval.cH A D01-Apr-202015.7 KiB926832

comeval.cH A D01-Apr-20202.6 KiB10777

comptry.batH A D01-Apr-2020209 1413

con1ival.cH A D01-Apr-20206 KiB277241

con2ival.cH A D01-Apr-20206 KiB277241

con2val.cH A D01-Apr-20204.8 KiB208183

conadj.cH A D01-Apr-20202 KiB6430

configureH A D01-Apr-20201.7 KiB5725

configurehereH A D01-Apr-20201.7 KiB5228

conpval.cH A D01-Apr-202019.8 KiB1,032971

conscale.cH A D01-Apr-20203.4 KiB190177

conval.cH A D01-Apr-20204.5 KiB197174

degree.cH A D01-Apr-20204.2 KiB211156

derprop.cH A D01-Apr-20201.3 KiB4014

details.c0H A D01-Apr-2020182 64

dtoa.cH A D01-Apr-2020154.7 KiB6,2045,540

dtoa1.cH A D01-Apr-20203.3 KiB151110

dtoa_locks.cH A D01-Apr-2020379 3125

duthes.cH A D01-Apr-20203.6 KiB143111

dvalue.hdH A D01-Apr-20201.1 KiB8079

dynlink.cH A D01-Apr-20201.3 KiB399

errchk.hH A D01-Apr-20201.7 KiB4417

f_read.cH A D01-Apr-20201.2 KiB282

fg_read.cH A D01-Apr-202035.9 KiB1,8131,694

fg_write.cH A D01-Apr-202017 KiB862798

fgh_read.cH A D01-Apr-202033.6 KiB1,7261,608

float.h0H A D01-Apr-20201.8 KiB6354

fpecatch.cH A D01-Apr-20201.5 KiB5322

fpinit.cH A D01-Apr-20205.5 KiB258204

fpinitmt.cH A D01-Apr-20204.8 KiB248201

fpsetprec.sH A D01-Apr-2020535 2825

fpsetprec64.sH A D01-Apr-2020488 2724

fullhes.cH A D01-Apr-20203.9 KiB166127

func_add.cH A D01-Apr-202011.2 KiB551463

funcadd.cH A D01-Apr-20203.4 KiB14292

funcadd.hH A D01-Apr-202015.9 KiB489334

funcadd0.cH A D01-Apr-20201.3 KiB377

funcadd1.cH A D03-May-202210.6 KiB506434

funcaddk.cH A D01-Apr-20203.3 KiB13787

funcaddr.cH A D01-Apr-20201.2 KiB272

g_fmt.cH A D01-Apr-20203.1 KiB14199

genrowno.cH A D01-Apr-20201.8 KiB5220

getenv.cH A D01-Apr-20201.4 KiB4614

getstub.cH A D01-Apr-202012.9 KiB635572

getstub.hH A D01-Apr-20206.9 KiB207134

htcl.cH A D01-Apr-20202.2 KiB9566

indic_cons.cH A D01-Apr-202013.6 KiB694636

jac0dim.cH A D01-Apr-20206.7 KiB300251

jac2dim.cH A D01-Apr-20201.7 KiB4617

jac2dim.hH A D01-Apr-20201.9 KiB4524

jacdim.cH A D01-Apr-20201.8 KiB5122

jacinc.cH A D01-Apr-20202.2 KiB7948

jacinc1.cH A D01-Apr-20202 KiB6234

jacpdim.hH A D01-Apr-20202.3 KiB5635

libnamsave.cH A D01-Apr-2020117 64

mach.cH A D01-Apr-20202.6 KiB10879

mainexit.cH A D01-Apr-20201.7 KiB6832

makefile.lcH A D01-Apr-20205.9 KiB208151

makefile.syH A D01-Apr-20205.5 KiB197148

makefile.uH A D01-Apr-202010.9 KiB453309

makefile.vcH A D01-Apr-20207.3 KiB237148

makefile.watH A D01-Apr-20205.7 KiB202148

mip_pri.cH A D01-Apr-20207.7 KiB329276

misc.cH A D01-Apr-202029 KiB1,5461,405

mkfileH A D01-Apr-2020194 75

mpec_adj.cH A D01-Apr-20208.9 KiB389340

mpec_adj0.cH A D01-Apr-202070 64

mqpcheckv.cH A D01-Apr-202019.3 KiB1,006915

mypow.cH A D01-Apr-20202.4 KiB11182

names.cH A D01-Apr-20204.2 KiB188146

nl_obj.cH A D01-Apr-20202.5 KiB8657

nlp.hH A D01-Apr-20205.3 KiB258202

nlp2.hH A D01-Apr-20207 KiB341276

nqpcheck.cH A D01-Apr-202017.9 KiB946849

nqpcheckZ.cH A D01-Apr-20201.2 KiB286

obj2val.cH A D01-Apr-20204.4 KiB196171

obj_adj.cH A D01-Apr-202015.3 KiB750702

obj_adj.hH A D01-Apr-20202.2 KiB4510

obj_adj0.cH A D01-Apr-202067 74

obj_prec.cH A D01-Apr-20201.4 KiB4617

objconst.cH A D01-Apr-20202.2 KiB7348

objval.cH A D01-Apr-20205.5 KiB262234

objval_.cH A D01-Apr-20203.4 KiB144104

op_type.cH A D01-Apr-20201.2 KiB348

op_type.hdH A D01-Apr-20201.3 KiB8483

op_typeb.hdH A D01-Apr-20201.3 KiB8483

opcode.hdH A D01-Apr-20201.3 KiB7170

opnos.hdH A D01-Apr-202078 65

pfg_read.cH A D01-Apr-202095.7 KiB5,0004,669

pfghread.cH A D01-Apr-20201.1 KiB233

printf.cH A D01-Apr-202023.5 KiB1,3341,230

pshvprod.cH A D01-Apr-202030 KiB1,6161,498

psinfo.hH A D01-Apr-20209.6 KiB333269

punknown.cH A D01-Apr-20201.7 KiB5525

qp_read.cH A D01-Apr-20203.9 KiB175133

qpcheck.cH A D01-Apr-20201.6 KiB4927

qpcheckZ.cH A D01-Apr-20201.6 KiB4925

qsortv.cH A D01-Apr-20204.8 KiB150108

r_op.hdH A D01-Apr-2020890 8483

r_opn.hdH A D01-Apr-2020412 1716

r_opn0.hdH A D01-Apr-2020342 1817

r_qp.hdH A D01-Apr-2020184 1110

readsol.cH A D01-Apr-20208 KiB362322

repwhere.cH A D01-Apr-202010 KiB478396

rnd_prod.sH A D01-Apr-20201.4 KiB5327

rops.cH A D01-Apr-202018.7 KiB1,2391,095

rops2.cH A D01-Apr-202020 KiB1,2841,131

sigcatch.cH A D01-Apr-20202.3 KiB10972

sjac0dim.cH A D01-Apr-20201.5 KiB4215

sos_add.cH A D01-Apr-202022.5 KiB1,051909

sphes.cH A D01-Apr-202026.7 KiB1,3181,227

sprintf.cH A D01-Apr-20203 KiB150109

sscanf.cH A D01-Apr-20203.2 KiB163125

stderr.cH A D01-Apr-20202 KiB7538

stdio1.h0H A D01-Apr-20203 KiB10995

strerror.cH A D01-Apr-20201.3 KiB378

studchk0.cH A D01-Apr-20201.4 KiB369

suf_sos.cH A D01-Apr-202012.1 KiB591542

value.cH A D01-Apr-20205.7 KiB280228

writesol.cH A D01-Apr-202011.9 KiB538492

wrtsol_.cH A D01-Apr-20202.4 KiB9364

ws_desc.cH A D01-Apr-2020214 76

wsu_desc.cH A D01-Apr-2020170 65

x2check.cH A D01-Apr-20202.2 KiB9067

xectim.cH A D01-Apr-20203.6 KiB150102

xp1known.cH A D01-Apr-20203.5 KiB151121

xp2known.cH A D01-Apr-20206.2 KiB287252

xsum0.outH A D01-Apr-20203.4 KiB145144

README

1This directory contains source for a library of routines that help
2solvers work with AMPL.  In this README file, the library is called
3amplsolver.a (the name it usually has on Unix systems), but on some
4systems it may have another name, such as amplsolv.lib on Microsoft
5systems.  Services provided by amplsolver.a include reading AMPL's
6generic output (.nl) files, and writing solution (.sol) files.  On
7netlib, subdirectories (e.g., cplex, examples, minos) contain
8interface routines for particular solvers; you may wish to modify
9these routines to make your own solver work with AMPL.
10
11To make an executable version of a particular solver, you need
12at least this directory and the solver's subdirectory.  You need
13to invoke "make" once in this directory to create amplsolver.a,
14and then invoke "make" in each solver subdirectory of interest.
15The exact form of the "make" command depends on the system you
16are using.  There is more discussion about "make" and makefiles
17below.
18
19Some installations have several kinds of computers, with various
20hardware and operating systems, and with cross-mounted file systems
21visible from the various computers.  On such systems, the "configure"
22script may be helpful.  It arranges to compile amplsolver.a in
23system-specific subdirectories with names that, unless otherwise
24specified, begin with "sys." and by default are determined by the
25Bourne-shell syntax
26
27	sys.`uname -m`.`uname -s`
28
29Invoking
30
31	./configure
32
33creates a sys.* directory for the current system and adds a
34generic makefile, such that invoking "make" will give the
35same result as
36
37	cd sys.`uname -m`.`uname -s`
38	make
39
40(creating amplsolver.a in the system-specific subdirectory).
41
42Alternatively, if you deal with only one kind of hardware and
43Unix- or Linux-like operating system (including Cygwin or MinGW/MSYS
44under MS Windows), you could invoke
45
46	./configurehere
47
48to arrange for compiling amplsolver.a in this directory.  Either
49way (after "./configure" or "./configurehere") you invoke "make"
50to compile amplsolver.a
51
52
53Updates to the source for amplsolver.a appear first in
54
55	http://ampl.com/netlib/solvers
56
57and the current source is generally available in the gzipped tar file
58
59	http://ampl.com/netlib/solvers.tgz
60
61In the course of a week or so, updates should reach netlib servers,
62such as http://www.netlib.org.
63
64For more about AMPL itself, see the AMPL book (second edition):
65
66	"AMPL: A Modeling Language for Mathematical Programming"
67	by Robert M. Fourer, David M. Gay, and Brian W. Kernighan;
68	Duxbury Press / Brooks/Cole Publishing Company, 2002;
69	ISBN 0-534-38809-4
70
71PDF files for individual chapters are freely available from the
72AMPL web site; see http://ampl.com/resources/the-ampl-book/ .
73
74
75For solvers written in Fortran 77, we assume the f2c calling
76conventions.  Source for f2c (Fortran-to-C converter) is
77available from netlib.
78
79See README.f77 for a summary of adjustments that permit use of the
80native Fortran 77 compilers on some systems.
81
82For machines with IBM mainframe arithmetic (i.e., the arithmetic
83of the IBM 360 and 370 series and their successors and imitators,
84such as Amdahl), use arith.ibm as arith.h and add rnd_prod.s to
85the end of the "a =" assignment in the makefile.  For other systems,
86let the makefile compile and execute arithchk.c to create a
87suitable arith.h.  Do not copy arith.h from one kind of computer
88to another.
89
90See the comments in "makefile" about compiling on particular systems.
91
92
93Various solver-specific subdirectories are available from netlib or
94http://ampl.com/netlib, including the following.  They provide sample
95AMPL interfaces, but do not include source or objects for the solvers
96themselves (which you must get from the relevant solver vendor, noted
97in the README.1st file in each subdirectory).
98
99	Subdirectory	Comments
100
101	bpmpd		Research interior LP code by Cs. Meszaros.
102
103	cplex		Uses CPLEX Corp.'s solver: linear (simplex and
104			interior algorithms), network, quadratic, and MIP
105			problems.
106
107	donlp2		General nonlinear optimizer by Peter Spellucci.
108			Uses an SQP algorithm and dense linear algebra.
109
110	examples	Source for examples in "Hooking Your Solver to AMPL".
111
112	fsqp		Based on CFSQP, a nonlinear solver by Craig Lawrence,
113			Jian L. Zhou, and Andre L. Tits.
114
115	funclink	Examples and system-specific makefiles for making
116			shared libraries (.dll files) of imported (i.e.,
117			user-defined) functions.
118
119	gurobi		Uses Gurobi Optimization's solver: linear (simplex
120			and interior algorithms), network, quadratic, and
121			MIP problems.
122
123	lancelot	Based on LANCELOT (by A. R. Conn, Nick Gould, and
124			Ph. L. Toint): general nonlinear programming code
125			using sparse linear algebra.
126
127	loqo		Interior code by Robert Vanderbei: for linear and
128			convex quadratic (or convex nonlinear) problems.
129
130	lpsolve		Simplex and MIP solver based on lp_solve by
131			Michel Berkelaar (michel@es.ele.tue.nl).
132
133	minos		Uses Murtagh & Saunders's code for nonlinear problems;
134			reduces to simplex on linear problems.
135
136	nlc		Source for "nlc" program, which emits Fortran or C
137			for computing objectives, constraint bodies, and
138			their gradients.
139
140	npopt		New version of npsol (see below), available from
141			Philip Gill to people who have npsol.
142
143	npsol		Based on NPSOL (by Gill, Murray, Saunders, Wright),
144			a sequential quadratic programming code for solving
145			nonlinear programming problems.
146
147	path		Based on the PATH solver of Prof. Michael C. Ferris
148			and his former students Steven P. Dirkse and Todd S.
149			Munson, for solving "square" nonlinear
150			complementarity problems.
151
152	snopt		Sparse nonlinear solver by Philip Gill et al.,
153			available from him to people who have npsol.
154
155	xpress		Based on XPRESS-MP, a solver for linear and
156			quadratic programming problems involving continuous
157			or integer variables by Fair Isaac Corporation.
158
159For information about arranging to use other solvers with AMPL,
160see "Hooking Your Solver to AMPL", Postscript for which is
161
162	http://ampl.com/REFS/hooking.ps.gz
163
164and a corresponding html version is
165
166	http://ampl.com/REFS/HOOKING/
167
168Updates to AMPL are reported in
169
170	http://ampl.com/dl/ampl.updates.html
171
172
173This directory contains two makefile variants with names of the
174form makefile.*; makefile.u is for Unix systems and makefile.vc is
175for Microsoft systems.  Comments in makefile.u describe adaptions
176for particular Unix systems.
177
178The makefile.vc variant creates "amplsolv.lib" and has comments about
179linking solvers.  This variant require you to make details.c by hand
180(since deriving it automatically seems hard to do reliably).  The
181details.c file should reflect the compiler you are using.  For
182example, for Microsoft Visual C++ 6.0, having details.c consist of the
183single line
184	char sysdetails_ASL[] = "MS VC++ 6.0";
185would be appropriate.  This string is used by some solvers as part of
186the output produced for the "version" keyword and the -v command-line
187option.
188
189If you know that your math library never sets errno, adding -DNO_ERRNO
190to the relevant CFLAGS assignment will save a little time and perhaps
191avoid compiler complaints.
192
193When linking nonlinear solvers on some systems, it's necessary to
194add system-dependent keywords to the linking command, e.g., to make
195dlopen() visible.  Some of the makefiles for specific solvers have
196comments about this, and on netlib, subdirectory funclink contains
197sample makefiles that illustrate how to do things on for several'
198popular systems.
199
200In general, it is necessary once in this directory to give the
201appropriate "make" invocation, such as
202
203	make
204
205on Unix platforms,
206
207	nmake -f makefile.vc
208
209under MS Windows, and then to give a suitable "make" invocation in
210each solver subdirectory of interest.  On non-Unix (non-Linux)
211systems, in many of the solver subdirectories it may be necessary to
212modify the Unix makefile into the form required by the system.
213
214With Microsoft Studio 2017, due to a compiler bug you will need to
215compile avltree.c without optimization.  After the "nmake" invocation
216aborts with an error message about an internal error in the compiler,
217invoke
218
219	cl -c -MT avltree.c
220
221and then again invoke
222
223	nmake -f makefile.vc
224
225to continue building the solver-interface library.
226
227A variant of the "solvers" directory is "solvers2", whose source is
228in the gzipped tar file
229
230	http://ampl.com/netlib/solvers2.tgz
231
232which is preferable for use with many nonlinear solvers, because its
233nonlinear evaluations are often faster, and for large problems, its
234internal representation of nonlinear expressions takes less space.
235With suitable call variants involving a thread-specific workspace,
236it also allows parallel nonlinear evaluations.  For most nonlinear
237solvers that just use one thread, "solvers2" is a drop-in replacement
238for the "solvers" directory.  Solvers that use multiple threads should
239first call fg_read() or pfgh_read() and then invoke
240
241	EvalWorkspace *ew = ewalloc();
242
243(or "ew = asl->p.Ewalloc(asl);") once per thread.  Such solvers should
244use the resulting thread-specific ew value in call variants whose
245names end in "_ew" and whose first argument is ew, e.g.,
246"objval(ew,np,x,ne)" rather than "objval(np,x,ne)".  The "_ew"
247variants are declared in solvers2/asl.h.
248
249Some solvers, such as ilogcp for constraint programming, need to see
250expression graphs.  Such solvers must continue to use "solvers"
251rather than "solvers2".
252
253Solver source can check "#ifdef _ASL_EW_" to determine whether header
254files come from "solvers2" (when the "ifdef" test is true) or
255"solvers".  This should only be relevant to solvers that use multiple
256threads.  When using the "solvers" directory (rather than "solvers2"),
257for each new thread, such solvers must allocate a new ASL structure,
258use it in a call on the desired .nl reader, and use the thread-specific
259asl value when doing nonlinear evaluations.
260

README.SGI

1SGI machines executing binaries compiled with -n32 or -64 (but not -o32)
2do not do correct IEEE arithmetic: they flush underflows to zero rather
3than underflowing gradually.  For many (non-benchmark) computations,
4there are no underflows, so this detail does not matter, but it can
5lead to different computational results when true IEEE arithmetic would
6involve gradual underflow.
7
8There are several ways to work around this bug.  The least attractive
9is machine-dependent source code modification: in the source file for
10main(), insert
11
12	#include <sys/fpu.h>
13
14and at the start of main(), insert
15
16	union fpc_csr f;
17	f.fc_word = get_fpc_csr();
18	f.fc_struct.flush = 0;
19	set_fpc_csr(f.fc_word);
20
21A more portable approach, not requiring changes to source code or
22makefiles, is to put a suitable "cc" shell script into a directory in
23$PATH (ahead of the directory containing SGI's "cc") to cause binaries
24to be linked as described in the following messages.  For example,
25for -64 C compilation, I might have a "cc" in my bin consisting of
26
27	#!/bin/sh
28	exec /bin/cc -64 -L/usr/dmg/lib/64 -Wl,-init,__zap_fz_bit /usr/dmg/lib/64/zapfzbit.o "$@"
29
30with zapfzbit.o compiled from
31
32	/* Clear FPCSR_FLUSH_ZERO bit on SGI machines -- see mbox./98/bean */
33	/* Load with cc -Wl,-init,__zap_fz_bit */
34
35	#include <sys/fpu.h>
36	#include <sys/syssgi.h>
37
38	 void
39	__zap_fz_bit(void)
40	{
41		union fpc_csr f;
42
43		f.fc_word = get_fpc_csr();
44		f.fc_struct.flush = 0;
45		set_fpc_csr ( f.fc_word );
46		}
47
48For C++, something more complicated is required, as seen in the
49following messages...
50
51From bean@sgi.com Thu Oct 22 16:41:06 1998
52From: bean anderson <bean@sgi.com>
53To: dmg@bell-labs.com, cbm@research.bell-labs.com
54Subject: FPCSR_FLUSH_ZERO
55
56Hi David,
57
58It was a pleasure talking with you today.  I've written
59up what we talked about and I hope it will meet your needs.
60Again, don't hesitate to call me directly if you have
61any problems with it.
62
63I've attached three files:
64
65	ieee.c    -- The source code for setting processor state.
66	bug.c     -- Simple test case.
67	Makefile  -- Build and test
68
69A discussion of how to use this mechanism and what the
70performance costs might be are included in comments
71in the file "ieee.c".  And, if it should be necessary,
72the engineering bug report number is PV 628694.
73
74-bean
75
76[ Bean Anderson, bean@sgi.com, 650-933-4107 ]
77
78begin 644 t.tar.gz
79M'XL(`%&=+S8``^U72V_;1A!6TDO(2WK,<9(T@!Q(-&7+<I!'D4?E5$#<&+;[
80M.`0@:&HH;4/N"KM+RW+JMG^@0']"D;;W'E*@Q]S:0POT7[3H(9?^@<Z2U(.*
81M$Q\:I6C+#[:7WIW'-S,[RZ5>KBP<KNNNKZV!&1O-;'17FMF8`]Q6J[&ZWF@U
82MU^FY07`KL+9X:I5*HK0OB4HW[IT@A_)EZWD<D_%?`KV\Z3_$D$6X.!^4CU:S
83M^>+Z-]8:D_HWFNM4_Y6U9JL"[N(H3?$_K__%\Z!BV@&VK5%IZRKL)3W;<I;-
84M8-.?;,81P!#1$;85!%`7\-9-J'\8U>J,,UWSO(WW[]WS.NUVV[NUW=E]=[.]
85MV[E3T`-[ZO+-LU__TJR<KHC/*I53,U1.G7WRM)H*G/ZT2;_G)@JGCWXPX]GO
86M/_@YDYRLC,<SN=QW^<0;J?SC/W0Z/OGUIW3\]O:7+TC#C[/_3.0?__ZTZ*=R
87M)J=Z,_/WQ=."7NYOROM1QON;[3&OS_,1YOQ#IO_;>,OG\7SR53;_Y\V,U[-J
88MD>>S/%^C<\?YGZX?G#M.WT";2CO!_/0KQ4G]WVPUY_O?72W[_[7@(N-!E'01
89MKBO=9<+IOVW;79'L10@'<`,:6%]UW1J,S+,S>5UGT]=L._89K^X+UEVR']F0
90M(]<_I/7QU"'I'T`=1M<F4P/)N`ZK%XR;2TYCI?>`CZ:/%VIP0&Z7IO(LA"K)
91MWJ!)F/J:M[:32'I4>!X@$SY/MF:L'`%&"E]B(&59X'$XJV[;1_9_J__3`WJA
92M!\`)_;_:6F_-]_^*ZY;]_SJP?!ELN%Q_E2![L-&YU[Z:O?N#!=BG'^MNXDN?
93M:T0P%P_8P[Z_SX2$(=-]D*@&&&C0`KK(A8S]B!UB%W@2[Z%4CC&P`%Z6.0K!
94M\Q1J+U3>'M.>%IX+U:6<M'4G0E\JV-@!6@3&(8R$KQGOP4#0`02!X%J*"&A7
95MZD11'#VF-$IGK/_>_5U*+.SVF8)0R``5^'1NSED1`Y3TO^`*4BW=]RD7=,W+
96MLT%*BIP/$A*5$+->7T,/N5'"5&$L)CB(1!LYRJ26_H"TS%,?X2%*CA$,^R@Q
97M=X*TJK1,`N,:B"'&240FNQ/Z[Z1VC1'DBNTCQ4OOGB&+(L`#(LV0!P@^*-;C
98M+&0!%3C5BX0B,B&02&BJ25)CF[,I'W@#B0$=_S,9WTZXR7.^4,>#``<IO]BX
99MKFY?,>TJ>#1:<@`*:;8HS0B90-\D+!Y;GTOWQ&:VL:S;&/AT7AC")O,U,*56
100MP(4F!:68>3N.\TE$9G=HJI^6CW<5$>I0`607I9$W)@N[>2P'0X28#K*L#(DD
101MG;"0JRQ6$@59R`84LY&Q3__<YU2%-/0:Q4#DTQIUI1]3X($?12-0D1C2NWY(
102MDK0T24FJ/M[,7:RE87],[&!N@ZBL50L1/1>^SAQ3;R,9`@Q#T]9F6Y(U"9N=
103MK1T*1E`?*)'WM65>U#,[X[B/DU3.A$&=L"?(MAX*D+35&4>5[ZQ7?CBT/[JU
104MN67.1:KJOJ!F#!.>M8J?:#%-+/4JA=2C7(/YO@+-8G1@LCDO`7V#62D>I''0
105M]U@\,AHP,W?2UUDNEW^>S5C+3.5SN;$H6-"!N6R/+Z#6=352R^$@,5?0XB3]
106MJAY+KZ:FI-9QYRO0_=-*N$EF.`B\0$D(Z?YIA4X8>$-J(;K2]=(C(EVLTITN
107M6\NVHQ-&B>J3#%UJ+365@RI,+9#.49%"X;PA`AG3ZL[=CK?3WO4VMKRM[?:=
108MSDZ[UB@H'UN1S,2\Y93I<Q%7,W-_O_[_]/VC1(D2)4J4*%&B1(D2)4J4*%&B
109.1(D2B\-?J5T;9``H````
110`
111end
112
113From dmg Thu Oct 22 17:38:16 1998
114From: "David M. Gay" <dmg@research.bell-labs.com>
115To: bean@sgi.com (bean anderson)
116Subject: FPCSR_FLUSH_ZERO
117
118Thanks for your helpful message.  That's a nice way get
119initializations done.
120
121If you could some little functions like __set_fs_bit_to_0 and
122__set_fp_precise into, e.g., libc, then it would be easy to
123add a set of flags to cc to specify various behaviors
124independently.  But for now I'm glad to have a simple work-around
125(a suitable "cc" script in PATH) that permits gradual underflow with
12664-bit addressing.
127
128-- dmg
129
130From bean@sgi.com Thu Oct 22 18:03:03 1998
131Sender: bean@sgi.com
132From: bean anderson <bean@sgi.com>
133To: "David M. Gay" <dmg@research.bell-labs.com>
134Subject: FPCSR_FLUSH_ZERO
135
136David,
137
138I was just reminded that for released compilers, C++ already
139uses the -init functionality for static initializers/constructors,
140so these mechanisms may  interfere with each other.  [ This is
141because the linker can handle at most one -init function. ]
142
143As of 7.3, the linker will accept multiple -init entries
144and it plays well with c++ static initializers.  [The 7.3
145compiler release is in test right now and is scheduled for
146release in March '99]
147
148In the mean time, as long as you are not using static
149constructors in C++, there should be no problem.
150
151-bean
152
153------------
154
155p.s.  Here is an alternate way to deal with this if
156	c++ static constructors become a problem.
157
158Another way to deal with this is to recognize that the .init
159section exists in each a.out and each DSO (dynamic library) so
160as each executable file gets loaded by the dynamic loader,
161it's associated .init section get's run.
162
163In the worst case scenario, you could put the ieee.o
164file into it's own dynamic library.  Here is an
165example (assuming it is a -64 compile):
166
167	% ld -64 -shared -o libieee.so -soname libieee.so \
168		ieee.o -init __FULL_IEEE_ARITHMETIC
169
170	%	CC -64 -o myprog ... -L. -lieee ...
171
172
173There are two ways to "find" this library at run time.
174
175	(1)  Copy it to one of the standard locations in
176	     which the runtime loader (RLD) always looks
177	     for requested dynamic libraries:
178
179		% cp libieee.so /usr/lib64/internal
180	     or
181		% cp libieee.so /opt/lib64
182
183		% myprog
184
185
186	(2)  Set an environment variable to tell the runtime
187	     loader (RLD) where else search:
188
189		% setenv LD_LIBRARY_PATH my-library-directory
190		% myprog
191
192From dmg Fri Oct 23 23:31:58 1998
193To: bean@sgi.com (bean anderson)
194Subject: FPCSR_FLUSH_ZERO
195
196Thanks for the second message you sent yesterday (about C++
197and using dynamic libraries).  I had assumed that one could
198have multiple -init functions and am glad to hear that will
199eventually be possible.
200
201-- dmg
202
203

README.f77

1The following changes (to solvers/makefile and solvers/*/makefile)
2may permit use of the native Fortran 77 compiler on some systems.
3On other systems, you may be able to discover suitable changes by
4studying system documents (including man pages), and by using the nm
5command to look at the names in relevant libraries.  Often the
6compiler flags "-v -v" (two -v's) will cause the compiler to tell
7you what libraries it references; if, say, /usr/lib/libF77.a is
8among them, you could try thing like
9
10	nm /usr/lib/libF77.a | grep -i arg
11
12to get a hint at the system's variant (if any) of xargv.
13
14If you make the changes shown below, also remove -lf2c from
15solvers/*/makefile.  In other words, if you use the native Fortran
16compiler, do not link against libf2c.a.
17
18
19Sun SunOS:
20	CFLAGS = -O -DKR_headers -DMAIN__=MAIN_ -Dxargv=_xargv
21
22
23Sun Solaris:
24	CFLAGS = -O -DMAIN__=main_ -Dxargv=__xargv
25	For solvers defining MAIN__, add fmain.o built
26	from fmain.f consisting of the two lines
27		call main
28		end
29
30
31HP:
32	CFLAGS = -Aa -O
33	FFLAGS = +ppu
34	For solvers defining MAIN__, add fmain.o built
35	from fmain.c consisting of the following:
36
37		char **xargv;
38		extern void MAIN__(void);
39		main(int argc, char **argv)
40		{
41			xargv = argv;
42			MAIN__();
43			return 0;
44			}
45
46
47IBM RS6000:
48	CFLAGS = -O -Dxargv=p_xargv -DMAIN__=main_
49	FFLAGS = -qextname
50	For solvers defining MAIN__, add fmain.o built
51	from fmain.f consisting of the two lines
52		call main
53		end
54
55
56SGI IRIX:
57	CFLAGS = -O -Dxargv=f77argv
58
59
60DEC OSF1 (Unix for Alpha chip):
61	CFLAGS = -O -Dxargv=for__a_argv
62
63Linux (with g77):
64	CFLAGS = -O -Dxargv=f__xargv
65
66Linux (with gfortran):
67	CFLAGS = -O
68	For solvers defining MAIN__, supply fmain.o as for HP above.
69	For solvers (e.g., snopt) that reference etime_(), append
70
71		extern double xectim_();
72		float etime_(float *tarray) { return (float) xectim_(); }
73
74	to fmain.c (source for fmain.o; see HP above).
75

README.suf

1Unfortunately, we have not yet had time to update "Hooking Your Solver
2to AMPL" to explain facilities we added a few years ago for exchanging
3suffixes with AMPL.  Use of these facilities from a user's perspective
4are described in chapter 14 of the second edition of the AMPL book,
5with older descriptions appearing in
6
7	http://www.ampl.com/NEW/statuses.html
8and
9	http://www.ampl.com/NEW/suffixes.html
10
11If your solver deals with a basis, it would be good if your driver
12could accept an incoming basis and return an optimal basis.  The
13process is fairly straightforward.  You declare
14
15	 static SufDecl
16	suftab[] = {
17		{ "sstatus", 0, ASL_Sufkind_var, 1 },
18		{ "sstatus", 0, ASL_Sufkind_con, 1 }
19		};
20
21Before calling the .nl reader, you invoke
22
23	suf_declare(suftab, sizeof(suftab)/sizeof(SufDecl));
24
25to tell the reader to save the incoming .sstatus values.  If you were
26interested in other incoming or outgoing suffix values, you would also
27include lines for them in suftab.  See, for example,
28/netlib/ampl/solvers/cplex/cplex.c or /netlib/ampl/solvers/osl/osl.c .
29
30To access an incoming suffix array (after calling the .nl reader,
31which reads them), say an array of priorities on variables, declare
32
33	SufDesc *dp;
34
35and invoke
36
37	dp = suf_get("priority", ASL_Sufkind_var);
38
39suf_get returns a pointer to a SufDesc (which is declared in asl.h);
40the second argument indicates the kind of entity to which the suffix
41pertains:  variable, constraints, objective, or problem.
42
43If you wanted to see integer values for the suffix, then dp->u.i is
44the array of suffix values; otherwise dp->u.r is the array of (real)
45suffix values.
46
47To return .sstatus values (i.e., a basis), you call suf_iput
48twice, once for constraint.sstatus and once for variable.sstatus.
49It's probably simplest to proceed as in /netlib/ampl/solvers/minos/m55.c:
50having declared
51
52	int *varstat;
53	SufDesc *csd, *vsd;
54
55and having computed NB = M + N, where M >= n_con and N >= n_var are the
56numbers of constraints and variables (possibly adjusted, depending on the
57needs of your solver -- for example, some solvers require adding an
58extra variable and possibly an extra constraint to add a constant term
59to the objective values that they report if they're asked to print
60progress lines during their solution process), you allocate storage
61for the .sstatus values by (something equivalent to)
62
63	varstat = (int*)M1alloc(NB*sizeof(int));
64	vsd = suf_iput("sstatus", ASL_Sufkind_var, varstat);
65	csd = suf_iput("sstatus", ASL_Sufkind_con, varstat + N);
66
67before invoking the .nl reader.  After calling the reader, deal
68appropriately with the incoming .sstatus values, if present:
69
70	if (vsd->kind & ASL_Sufkind_input)
71
72then you have incoming variable.sstatus values in array varstat
73(the third argument to suf_iput); similarly,
74
75	if (csd->kind & ASL_Sufkind_input)
76
77then you have incoming constraint.sstatus values (which, in the
78above example, are in varstat+N, though you might wish to give
79a separate name to this array).  The values are encoded as in
80the first column of AMPL's default $sstatus_table:
81
82	0	none	no status assigned
83	1	bas	basic
84	2	sup	superbasic
85	3	low	nonbasic <= (normally =) lower bound
86	4	upp	nonbasic >= (normally =) upper bound
87	5	equ	nonbasic at equal lower and upper bounds
88	6	btw	nonbasic between bounds
89
90After solving the problem and before calling write_sol (which will
91transmit the suffix arrays mentioned in previous suf_iput and, for
92real, i.e., double, values, suf_rput calls), translate your basis
93information to values in the outgoing status arrays that accord with
94the above table.
95
96For returning real (floating-point) suffix values, call suf_rput
97rather than suf_iput.  Examples (for sensitivity information, i.e.,
98suffixes .up, .current, and .down) appear in the cplex.c and osl.c
99files mentioned above.
100
101Another detail not yet documented in "Hooking Your Solver..." is that
102you should assign a solve_result_num value to indicate success,
103failure, iteration limit, etc. before calling write_sol.  This is
104an integer value in one of the ranges indicated by AMPL's default
105$solve_result_table:
106
107	0	solved
108	100	solved?
109	200	infeasible
110	300	unbounded
111	400	limit
112	500	failure
113
114For successful solves, solve_result_num should thus be an integer
115in [0,99].  If the problem might be solved, but tolerances may have
116been too tight to satisfy all stopping tests, assign an integer in
117[100,199], etc. -- any value >= 500 indicates failure (such as
118insufficient memory).  Then AMPL's symbolic solve_result will be
119assigned one of the values in the second column of the above table,
120and scripts that need more detail can base tests on solve_result_num.
121
122Many of the sample solver interfaces appearing in subdirectories
123of netlib's ampl/solvers directory make use of suffixes and supply
124solve_result_num.
125