README - $Id$

Yorick is an interactive programming language for scientific computing
that includes scientific visualization functions, and text and binary
I/O functions geared to millions of numbers.

Yorick runs under UNIX (X windows), MS Windows, and MacOS X.

MacOS X 10.3 (Panther) versions earlier than 10.3.4 had serious bugs
in the system libraries; yorick will not run properly.  Apple provides
the 10.3.4 update free of charge to owners of any prior version 10.3,
at http://www.apple.com/downloads/macosx/apple/.
See play/hacks/MacOS103.bug for workarounds if upgrade is impossible.


OVERVIEW
--------

To build a relocatable version of yorick:

  make relocatable

This creates a tarball yorick-V.N-RR.tgz containing the yorick code,
interpreted library, and documentation.  Move it to the directory
where you wish to install yorick, then unpack it with:

  gzip -dc yorick-V.N-RR.tgz | tar xvf -

The yorick executable will be yorick-V.N-RR/bin/yorick.  Read
yorick-V.N-RR/README for more information.

You can also build non-relocatable versions of yorick, which must be
installed in a particular directory you specify when you build the
code.  If you want to check yorick out before making a decision, try

  make
or
  make install

which will assume that this source directory is where you are going to
install the executable yorick.  See the sections INSTALLING YORICK and
BUILDING YORICK below for more detailed information.



ROADMAP
-------

The top-level distribution directory contains this README, scripts for
configuring and building yorick, and a number of subdirectories.  Some
subdirectories contain core parts of yorick; others are extras which
you might reasonably omit.  Here's a quick roadmap:

  play/     (portability layer)
    here are event loop, low level io, graphics primitives
    everything else is supposed to be strictly architecture-independent
      (however, other non-core packages may slightly violate this rule)
  win/      (MS Windows specific files)
    here are the MS Visual C++ project files
    some Windows code is in subdirectories like play/win
  gist/
    play-based 2D scientific visualization library
  yorick/
    yorick language interpreter (C source)
  matrix/
    LAPACK linear algebra functions (C source)
  math/
    non-matrix mathematical functions (C source)
  fft/
    Swartztrauber Fast Fourier Transform (C source)
  i/
    library of interpreted functions
  i0/
    interpreted code required at startup
  i-start/
    interpreted code run at startup, usually containing autoloads
  extend/
    sample trivial compiled extension for yorick
  mpy/
    MPI-based yorick multiprocessing package
  drat/
    compiled extension to do 2D cylindrical radiation transport
  hex/
    compiled extension to do 3D radiation transport
  doc/
    documentation: yorick user manual, quick reference cards
  emacs/
    GNU Emacs lisp code for running yorick and editing yorick source

  distribs/
    files for creating RedHat RPM, FreeBSD, and other distributions
  debian/
    instructions for creating Debian .deb distribution



INSTALLING YORICK
-----------------

Yorick consists of an executable code plus a library of interpreted
functions.  If you do not install the interpreted library where yorick
expects, yorick will not run.  A proper installation should have the
following directory structure:

  $Y_SITE/
    i0/
      ".i" yorick source files, required when yorick starts
    i/
      ".i" yorick source files, interpreted library
    g/
      ".gp" palette and ".gs" style files for graphics library
    doc/
      yorick documentation (optional)

  $Y_HOME/
    Maketmpl  => Makefile template for building custom yorick versions
    include/
      ".h" C header files for building custom yorick versions
      NOTE: this should be in Y_SITE...
    lib/
      binary object libraries for building custom yorick versions
      executables for support codes required during yorick builds
      executable yorick (or any sibling of lib/, such as bin/)
    bin/
      yorick executable (this may be installed elsewhere sometimes)

********** DO NOT set either Y_SITE or Y_HOME to a directory you value.
* DANGER * (In particular, Y_HOME should NEVER be your HOME directory.)
********** make uninstall might destroy Y_SITE and Y_HOME

The contents of Y_SITE are architecture independent; every machine on
a network may share the same Y_SITE directory.

The contents of Y_HOME depend on architecture, that is, on the
hardware and operating system; different machines on the same network
may require different Y_HOME directories.

On MS Windows systems Y_HOME and Y_SITE must be the same directory.
This is also a reasonable way to install yorick on single architecture
platforms.  For test versions of yorick, Y_HOME and Y_SITE can be
identical to the top-level distribution directory containing this
README.  When Y_HOME = Y_SITE and the yorick executable is in
Y_HOME/bin, yorick can always find its interpreted library and startup
files relative to the "launch directory" where the executable lives.
(A program can figure out where it's executable is on all systems.)

When you build yorick, the values of Y_HOME and Y_SITE are compiled
in.  As long as the compiled-in values of Y_HOME and Y_SITE are
correct, you can install the executable anywhere; it doesn't have to
go in Y_HOME/bin.  (This does no good on systems such as Windows,
where different users will install the program in different places,
which is why you must make Y_SITE and Y_HOME the same directory and
put the executable in Y_HOME/bin/.)

In any case, you also need to arrange for users to be able to find and
start yorick.  Under MS Windows, you do that by making an alias that
starts $Y_HOME/bin/yorick.  Under UNIX, you either need to make sure
that yorick users have $Y_HOME/bin on their PATH environment variable,
or put a softlink or script that points to $Y_HOME/bin/yorick in some
standard place like /usr/bin or /usr/local/bin that is likely to be on
everyones PATH.

Heterogeneous networks or development sites maintaining several
versions of yorick naturally require more complicated arrangements.
Here are two suggestions:

(1) With prefix = /usr or /usr/local and Y_VERSION = 1.5, 2.0, etc.:

  Y_SITE = $prefix/share/yorick/$Y_VERSION
  Y_HOME = $prefix/lib/yorick/$Y_VERSION

(2) With prefix = any directory cross-mounted to all architectures
(e.g.- /usr/share) and Y_PLATFORM = any designation unique to all
machines which can run the same binaries (e.g.- compaq, sunos, hpux,
linux86, i386-debian-linux):

  Y_SITE = $prefix/yorick/$Y_VERSION
  Y_HOME = $prefix/yorick/$Y_VERSION/$Y_PLATFORM

********** DO NOT set either Y_SITE or Y_HOME to a directory you value.
* DANGER * (In particular, Y_HOME should NEVER be your HOME directory.)
********** make uninstall might destroy Y_SITE and Y_HOME




BUILDING YORICK
---------------

To build yorick on a MS Windows machine, read win/README.

If you want to install yorick in a directory other than the one you
are building in, you must first set Y_SITE and Y_HOME, as described
above.  (Otherwise, just skip to the next paragraph.)  You can either
edit the file ysite.sh (read the comments there for a detailed
description of what to do), or, alternatively, you can type (all UNIX
commands must be typed in the top-level directory of the
distribution):

   make prefix=/my/top/path Y_PLATFORM=hal9000 ysite
     to get
       Y_SITE=/my/top/path/yorick/$Y_VERSION
       Y_HOME=/my/top/path/yorick/$Y_VERSION/hal9000
     (/my/top/path might be /usr/lib)

   make prefix=/my/top/path ysite
     to get
       Y_SITE=/my/top/path/share/yorick/$Y_VERSION
       Y_HOME=/my/top/path/lib/yorick/$Y_VERSION
     (/my/top/path is typically /usr or /usr/local)

   make Y_HOME=/my/homesite ysite
     to get
       Y_SITE=/my/homesite
       Y_HOME=/my/homesite

   make Y_SITE=/my/site Y_HOME=/my/home ysite
     to get
       Y_SITE=/my/site
       Y_HOME=/my/home

********** DO NOT set either Y_SITE or Y_HOME to a directory you value.
* DANGER * (In particular, Y_HOME should NEVER be your HOME directory.)
********** make uninstall might destroy Y_SITE and Y_HOME

If you want to build a gzipped tar file containing a relocatable
yorick binary, you can do

   make relocatable

This will make Y_HOME=Y_SITE=relocate, which causes both to fall back
to the runtime determination described above.  The relocatable target
does make ysite, make config, make, and make install, then packages
everything into a gzipped tar file called yorick-A.B-R.tgz, which is
left in the top level directory.  You can untar this tgz file wherever
you like to install yorick; it unpacks into a yorick-A.B-R directory,
but you are free to change that name to whatever you like.  Read the
top level README (which is install.rel in this directory) for complete
instructions.

More usually, you can take up to four steps to configure, build, test,
and install yorick.  In order, the four separate commands are:

   make config
   make
   make check
   make install

You can also just type "make" to configure and build, or "make
install" to configure, build, and install.  If things go wrong, type
"make clean", then take the steps one at a time.  Yorick requires an
ANSI C compiler and libraries, some POSIX standard functions (plus
either poll or select, which are not covered by any standard, but are
present on all UNIX systems), and the basic X11 library (R4 might
work, but anything R5 or better should certainly work).  However,
these components may be misinstalled or installed in places where the
configuration process cannot find them.  If so, you can either fix
your system or edit the files Make.cfg and play/unix/config.h by hand
to repair any errors or oversights of "make config".

The "make config" step creates the file Make.cfg (in this top-level
directory).  By default, the compiler and loader flags are just
"-O".  If you want fancier options, you can edit Make.cfg before
you build; just modify the COPTIONS and/or LDOPTIONS variable.  For
the convenience of gcc users, a maximal error-checking set of
options is included in Make.cfg.  Just set
COPTIONS=$(GCCOPTS)
to use this set.  (This actually detects a vast number of non-ansi
constructs in the system string.h header file on my system, so you
might need to get rid of the -ansi and -pedantic switches.)

You can set environment variables before the "make config" step in
order to skip or force variaous configuration options:
   NO_XLIB=yes     # build yorick with no graphics
   NO_PLUGINS=yes  # build yorick with no plugin support
   WITH_GLX=yes    # include (unused) opengl support in libyor.a

Other make targets include:

   clean      -- get rid of the mess left over from the build
      do this after successful install
   distclean  -- clean plus all files generated by the config step
      config does distclean before it begins
   uninstall  -- gets rid of all installed files
      be sure to do uninstall before distclean if you want to
      get rid of the yorick you installed (otherwise you will
      need to make ysite again)
   uninstall1 -- gets rid of all files installed in Y_HOME
   install1   -- only installs to Y_HOME, not to Y_SITE




LEARNING YORICK
---------------

The user manual and quick reference cards for yorick are in doc/.  If
you have makeinfo and texi2dvi you can format yorick.tex yourself into
either info format (emacs help browser) or dvi format (xdvi).  See
doc/Makefile for details.  Postscript versions of both documents come
with the distribution, and may be found in doc/.

Yorick also has a brief manpage, doc/yorick.1, which you might wish to
install (just copy it to the appropriate place).

If you start yorick, you can type

#include "demo1.i"
demo1

to run a demonstration program.  Typing

help,demo1

prints a documentation string, which includes the name of the source
file.  Read the source for an explanation of how the demo program
works.  There are also demo2, demo3, demo4, and demo5 programs, which
give you a pretty good picture of yorick's capabilities; run them the
same way as demo1.
