                        MS-DOS Port of lp_solve
			     using DJGPP
                           Michal A. Jarski
                           October 30, 1995

You can solve large linear programs on your MS-DOS machine thanks to
the DJGPP compiler. It's a fully 32-bit GCC/G++ port to MS-DOS done
by DJ Delorie (Thank you DJ!). Whole extended memory is available
to user programs. Together with disk space makes up to 256 MB
of virtual memory, which is allocated as needed to contain large
program matrices.
DJGPP is public domain in the sense of GNU General Public Licence!

Installation
============

Program lp_solve.exe is included in this distribution so you don't
need the DJGPP development system to run it.

Put lp_solve.exe and go32.exe on your path.
You can also run lp_solve in a Windows 3.x, NT, 95 DOS box.


Other files in the distribution
===============================

go32.exe is the DOS extender needed to run lp_solve. It must be put
in the search path (preferably in the same dir as the lp_solve).
It can use DPMI and VCPI methods to run.

lp2mps and mps2lp are utility programs which convert between lp_solve
style files and industry standard MPS style files.

lpkit.a is a library of routines comprising the solver, mps <-> lp
conversion routines, and procedural interface to the solver. See
demo.c for examples of how to set up an lp and call the solver from
your own programs. I decided NOT to include this library in the
distribution because it's rather large and you will need it only
if you have DJGPP installed. In such a circumstances you can build it
easily. Instead you can run the demo program to see how
the Procedural Interface works for lp_solve.

In addition, you'll find the original source and support files as I
received them in the Unix distribution. I've converted end-of-line of
the text files to DOS carriage return/line feed.


System requirements
===================

- 386 processor or better.
- Floating point coprocessor NOT necessary but improves performance. 
- Extended memory.  The more extended memory you have, the larger lp
  you can solve.
- If not enough extended memory -- at least enough disk space
  to form virtual memory (much slower solution).

Testing
=======

The example test lp files ex1.lp, ..., ex7.lp are the same as
distributed with the Unix sources and are placed in LP_EXAMP subdirectory.
These test programs pass.  If you run them, remember: ex7.lp 
needs the -s flag for scaling: 
lp_solve -s < ex7.lp > solution.out.


How I Did It
============

Tools used:

DJGPP version 1.12maint4:
* gunzip
* djtarx (tar files expander)
* utod (Unix->DOS text file converter)
* gcc
* ar
* make
* flex (lex-like engine)
* bison (functionaly similar to yacc)
DJGPP enables easy porting of Unix programs to PCs running MS-DOS.
For informations check http://www.delorie.com


 1. Unzip Unix distribution with gunzip.

    gunzip lp_solve.gz

 2. Extract sources from tar archive with djtarx.

    djtarx lp_solve

 3. Convert sources and docs from Unix end-of-line to DOS end-of-line.

    utod *.*

 4. Edit several occurrances of message in read.c.

from.......................................................
 "(store) Warning, variable %s has een effective coefficient of 0 on line...
to.........................................................
 "(store) Warning, variable %s has an effective coefficient of 0 on line...
...........................................................

 5. Change some settings in makefile:
	* choose the compiler CC to gcc
	* choose the CFLAGS for gcc and add -DREAL='long double'
	  (I like high precision even if it slows down computations 8-) )
	* change lex to flex -l (flex in lex compatibility mode)
	* change yacc to bison -y (bison in yacc compatibility mode)
	* add the ren commands in lex/yacc targets to get the file
	  names expected by other targets and sources (lp.c and lex.c)
	* add sweep target cleaning directory from OBJs
	* add exe target for creating executables from COFF files
	  (generated by gcc); these execs still need go32.exe 
	  (the extender) to be present in the search path
	* add standalone target for creating execs, but in standalone
	  mode; go32.exe is included into the execs; the result
	  are the 'normal' execs which don't need separate go32.exe
	  extender
 6. Invoke make
 7. Invoke make exe
 8. Test the lp_solve program on the examples in lp_examp subdirectory.
    I got correct results. The only problem is that DJGPP implements
    the %M.Ng format of printf()/fprintf() as: field of max M places
    with floating format of max N fraction digits. The original GCC
    implementation (in Unix) is that N means the number of NON-ZERO
    fraction digits. The result:
	* in original GCC:
	printf("%10.5g", 0.052486) ==> 0.052486 
	(6 fraction digits!)
	* in DJGPP:
	printf("%10.5g", 0.052486) ==> 0.05249 
	(5 fraction digits! rounding up!)
    If you don't like this, the changes can be made to file lpkit.c
    in function print_solution(). 
    So: the results are OK but they are displayed differently
	than in the original version.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This text was written basing on the original dosport.txt by John P. Powers.
John made the first port to DOS using the Borland C 4.0 compiler.
You can download his port (file lp20dos.zip) and compare performance
with this one.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++