**************************************************************************
**    This is the OS/2 port of Octave 1.91 (pre 2.0)                    **
**    Octave 1.91 is a test release.                                    **
**************************************************************************
**    There might be bugs in Octave 1.91!                               **
**    Please report them so that they are fixed in the new version.     **
**************************************************************************


Octave -- a high-level language for numerical computations.



Overview
--------

Octave is a high-level language, primarily intended for numerical
computations.  It provides a convenient command line interface for
solving linear and nonlinear problems numerically.

Octave is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.

Octave is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the file COPYING for more
details.



Used Compiler and Libraries
---------------------------

Octave for OS/2 is compiled using EMX-GCC 0.9C (with EMXFIX01) and
libg++ 2.7.2.

The fortran routines are translated to C using f2c.



Binary Distribution
-------------------

Why a binary distribution?

1. There are only minor changes made in the source files of octave. The main
   job was patching iostream, info and readline.

2. octave is big (40 MB with the source, object files and libraries) and it
   takes time to compile the program. (ca. 50 minutes on my
   133 MHz Pentium-Overdrive system = ca. 8 hours on a 486DX-33).



Files
-----

The files BUGS, CHANGELO, CHANGELO.1, COPYING, NEWS, PROJECTS, README,
ROADMAP, SENDING.PAT and THANKS are part of the octave 1.91 source code.

In the zip files fat.zip and hpfs.zip are the scripts coming with octave 1.91.
The scripts in fat.zip are renamed and patched for the 8.3-fat name rule.
Also in the archive FAT.ZIP you find a makefile and sed-script, which allows
you to convert other script file, so that they will work with the script
files in FAT.ZIP

The files COPYING.EMX, emx.dll, emxlibcs.dll and termcap.dat are part of the
emx 0.9c package  (with EMXFIX01 applied, see COPYING.EMX).

octave.exe and octave.ICO are the executable and the icon of the main program.
The file octave.exe must no longer be build by the install program!

octtopnm.exe, pnmtops.exe, xvos2.exe and ppmtogif.exe are needed for viewing
and saving of images.

info.exe is the standalone info browser coming with EMX. It was recompiled
so that info.exe and octave.exe uses the same DLL (gnuinfo.dll).

README.OS2 is the file you are reading.

In the directory 'lisp' you find the elisp files (and the compiled elisp files)
you need to run Octave in an Emacs subshell and the files for editing script
files or temporary files of octave using the Emacs editor.

In the directory 'doc' you can find the documentation in dvi, postscript and
info files.

In the directory 'dll' you can find the Dynamic Link Libraries of octave and
emx, and the file termcap.dat is in the directory etc.



Other Files of Interest
-----------------------

octa111b.zip:  The binary distribution of Octave-1.1.1. If you have any
               problem, use this version.
octa111p.zip:  This archive contains the update to the newest build.
octa111s.zip:  The patched source code for octave (including info, kpathsea,
               iostream, readline and pnm).

less252-2.zip: The less pager ported by Kai Uwe Rommel.
gp315os2b.zip: GNUPLOT 3.6 (beta 315)
gnufutil.zip : The GNU file utilities.


Installation
------------

Do the following to install octave:

- If you are using an older version of the emx runtime libraries, you must
  use the files emx.dll and emxlibcs.dll coming with octave! If you have a
  newer version of the DLLs, delete the two files emx*.dll from the
  subdirectory dll.
  Add the following lines to your config.sys:
    SET TERM=ansi
    SET TERMCAP=d:/apps/octave-1.91/etc/termcap.dat
  Change the drive and path in TERMCAP, so that TERMCAP contains drive, path
  and filename of your termcap.dat.

- Edit config.sys:
  Add the following line or something similar:
    SET HOME=d:/.
  This tells octave where to search the your init file.
  Add the path of octave 1.91 to the PATH statement:
    PATH=...;i:\apps\octave-1.91;
  Add the path of the DLLs of octave 1.91 to the LIBPATH statement:
    LIBPATH=...;i:\apps\octave-1.91\dll;

- If you have installed octave not in the directory i:\apps\octave-1.91, then
  you must set OCTAVE_HOME to your directory. For example if you installed
  octave in c:\octave, add
    SET OCTAVE_HOME=c:/octave
  to your config.sys.

- On a FAT drive you cannot use the file .octaverc. Use the environment
  variable OCTAVE_INITFILE:
    SET OCTAVE_INITFILE=octave.ini
  and octave uses octave.ini in the home directory. If the environment is not
  set, octave uses .octaverc

- Reboot.

- Change to the directory of octave and run install (REXX must be installed!):

   1.  Type install install. The installation script will decompress the
       scripts for your file system.

   2.  To save disk space you can use 'install clean'. All the files you
       don't need for running octave are deleted. You cannot use install again
       without these files! 

- If you like: Create a program object for octave. Octave should be started
  in a window.



Running Octave
--------------

When you start octave (without -f, --norc or --ignore-init-file), octave will
execute the following files:

1. scripts\startup\octaverc:
  Octave will use the editor 'emacsclient' and the pager 'less'. The info
  files are located using the environment variable INFOPATH and the
  gnuplot_binary using the environment variable GNUPLOT.

2. The file, which name is given by the environment variable OCTAVE_INITFILE,
  or .octaverc, if there is no OCTAVE_INITFILE. Both are searched in your
  HOME directory.

You can use octave as an external processor in an batch file, if the first
line in the batch file is
  extproc octave -q
or
  EXTPROC octave -q.
This is the same as using octave -q file.cmd.



GNUPLOT
-------

Octave uses GNUPLOT to display plots. I have tested octave with GNUPLOT 3.6
(beta 315). The system-wide startup file octaverc in the directory
scripts/startup reads the environment variable GNUPLOT and appends
"/gnuplot.exe". This should be the path and name of GNUPLOT. So if the
executable (gnuplot.exe) is in the directory d:\apps\gnuplot add the following
line to your config.sys:

  SET GNUPLOT=d:/apps/gnuplot

You must use the beta of GNUPLOT because it supports multiple plots.



PAGER
-----

If you want to use the less pager, you need the file less252-2.zip or newer.
This less port does not use the termcap library, so it is unable to work with
ansi-color-2, ansi-color-3,...

If you want to use ansi-color-3, you must recompile less after deleting
termcap.c and adding the termcap-library in the makefile, or you must edit
the file termcap.dat: Replace every tc=ansi in the termcap.dat by the lines
following ansi.



EMACS
-----

Move the info files (octave and octave.i??, liboct and liboct.i??, faq) from
octave-1.91/doc to the directory, where the other info files (emacs, gcc,..)
are. Edit the file dir and add the following lines:

   * octave:    (octave).      Octave 1.91.
   * liboctave: (liboct).      Info about liboctave 1.91.
   * octave-faq:(faq).         FAQs about Octave 1.91.

Now you can use GNU info or info in emacs to view the octave manual.
Set the environment variable INFOPATH, so that it contains the directory
of your info files. If your info files are in d:\apps\emacs\info:
  SET INFOPATH=d:/apps/emacs/info/
This variable is used by the startup script in scripts\startup\octaverc to
locate the info file.

You can use emacs to edit the script files of octave. To do so add the lines 
  (setq load-path (append '("d:/apps/octave-1.91/lisp") load-path))
  (autoload 'octave-mode "octave-mode" "Enter Octave mode." t)
  (setq auto-mode-alist (cons '("\\.[Mm]$" . octave-mode) auto-mode-alist))
  (defun my-octave-mode-hook ()
    (setq fill-column 76)
    (turn-on-auto-fill))
  (setq octave-mode-hook 'my-octave-mode-hook)
to your .emacs

If you run emacs in server mode, octave can use the emacsclient for editing
temporary files. Add the following lines to .emacs:
  (autoload 'octave-tmp-mode "octave-tmp-mode" "Enter Octave's tmp mode." t)
  (setq auto-mode-alist
    (cons '("[Oo][Cc][Tt]-....\\.[Tt][Mm][Pp]$" . tmp-mode)
	 auto-mode-alist))
The tmp mode is the normal text mode with one exception: If you finished
editing by pressing C-x # the buffer is killed. So octave can delete the file.

If you want to run Octave in a special shell mode under Emacs you must also
add the following line to .emacs:
  (require 'octave)
For example your .emacs file should look like this:

  (setq load-path (append '("d:/apps/octave-1.91/lisp") load-path))
  (require 'octave)
  (autoload 'octave-mode "octave-mode" "Enter Octave mode." t)
  (setq auto-mode-alist (cons '("\\.[Mm]$" . octave-mode) auto-mode-alist))
  (defun my-octave-mode-hook ()
    (setq fill-column 76)
    (turn-on-auto-fill))
  (setq octave-mode-hook 'my-octave-mode-hook)
  (autoload 'octave-tmp-mode "octave-tmp-mode" "Enter Octave's tmp mode." t)
  (setq auto-mode-alist
        (cons '("[Oo][Cc][Tt]-....\\.[Tt][Mm][Pp]$" . octave-tmp-mode)
              auto-mode-alist))


Images
------

Octave for OS/2 uses the Multimedia Viewer coming with Warp. Or you can use
the environment variable OCTAVE_IMAGE_VIEWER to specify the viewer Octave
should use.



Comments, Bugs, Problems, Ideas, ...
------------------------------------

If you have any problem installing or using this port, let me know!

If have any idea to make octave for OS/2 a better program, send me a mail.
Also any comments are welcome.

My email addresses are:

INTERNET:    gebhardt@crunch.ikp.physik.th-darmstadt.de
CompuServe:  100114,1371

**************************************************************************
**        NO MAIL FROM INTERNET TO MY COMPUSERVE ADDRESS!               **
**************************************************************************

Klaus Gebhardt [TEAM OS/2]
Institut fuer Kernphysik
Technische Hochschule Darmstadt
