                Installing  Dumatel-1.02 system
                -------------------------------
                


See first  announce.txt, license.txt.

Dumatel-1.02   (dm-1.02)
distributes as an archive of Haskell source programs and 
documentation. 
It was tested under the Haskell implementation  GHC-6.2.2,

and we hope, can be easily ported to GHC higher compatibles.
We also think it can be ported (with some effort) to other Haskell 
systems.

Memory requirement (for ghc-6.2.2)
----------------------------------
`Making' Dumatel under the -O key needs less than  32 Mb,
the Dumatel code compiled with -O is    less than   4 Mb,
running the demonstration/tests needs   less than   3 Mb.



********************************************************************
1. Download files

The Dumatel  (dm)  distribution directory contains
    announce.txt
    license.txt
    install.txt        - the file you are reading now
    dumatel-1.02.zip   - the very Dumatel program and manual book

Download these files.

--------------------------------------------------------------------
2. Unfold

Change to the directory where you wish too keep all the  Dumatel
files - let us call it <D>.
For example, on my machine, <D> is  /home/mechvel/dm/1.02
Move  dumatel-1.02.zip  to  <D>/  and command 
                                      cd <D>; 
                                      unzip dumatel-1.02.zip

After this, you will have the following directories and files:
        
<D>/announce.txt
    license.txt
    install.txt    
    dm/book.ps                  -- manual in postscript format
      .../source/Makefile ...   -- directory tree 
             .../dm.conf        --   with source 
             ...                --   program

--------------------------------------------------------------------
3. Set three paths in Makefile 

  cd <D>/dm/source;  edit in  Makefile  the lines   ghcBinDir =
                                                    s         = ...
                                                    e         = ...

CAUTION:  do not add blanks to the end of the latter two lines
          (otherwise, the commands like  rm -rf $(..)... 
           may try to intrude into wrong directories).

Here  $(ghcBibDir)  is the directory where the  ghc  executable
                    resides, for example,  .../ghc/.../inst/bin,
      $(s) = <D>/dm/source,
      $(e)   is the directory where Dumatel libraries and interface 
             will install to.

The paths to the  ghc, ghc-pkg  executables are computed
automatically via  $(ghcBinDir).
If you need to apply another  ghc-pkg,  you may set in the command 
line  `make ... ghcpkg=...'

Introducing  $(ghcBinDir)  has sense because there may occur several
GHC installations on one machine.

Further we use the names $(s), $(e).

And we recommend to start with making Dumatel under -Onot and testing
as below.


--------------------------------------------------------------------
4. Make non-optimized Dumatel:   cd $(s)
                                 make dm >& log
This command 
* creates the installation directory $(e),
* compiles all dm modules without optimization,
* puts the resulting .hi .o files and two libraries to the 
  directory  $(e)/,  
* creates a package  dm  referring to  $(e)  and to the two
  libraries created there, and having the user package 
  configuration file  ./dm.conf,
* prints the report to the file  ./log  

After it finishes, you can undo all this by commanding `make clear'.

./log  may contain numerous messages, and they are all good - 
except  "compilation had errors".

After it succeeds, you may run    make clearO

to remove  $(e)/*.o  files  -- except  HSdm.o .
These .o files still can be extracted:  by  ar -x libDm.a

All the Dumatel facilities and many of GHC items are visible now 
from the module  DExport.

--------------------------------------------------------------------
5. Making and running test-demonstration

We recommend first to set the variables for the package configuration
option:
        setenv dmc    ".../dm/source/dm.conf"
        setenv pcdm   "-package-conf ${dmc}"
        setenv pcpdm  "${pcdm} -package dm"

in order make possible brief commands like, say,
                                  ghc-pkg -f $dmc;   ghci $pcpdm ...
Then, command
              cd $(s)/demotest
              ghc $pcpdm --make Main

It should produce the executable file  ./a.out

Note, that the  dm  package  invokes many options for the  ghc 
command (see Makefile).
Running the demonstration and test:   ./a.out 

It performs computations, prints messages, and copies these messages 
to the file  ./log
Test 1:  this program should not break.
Test 2:
  Find in the produced file  log  the two long sequences of  
  True True True ...
  This would mean that the completion test is all right.
Test 3:  
  read the text in this file. This is also a demonstration, it 
  contains explanations, and you can see whether other printed 
  results look correct. 

--------------------------------------------------------------------
6. `Making' optimized system.
    
If  5.  shows "no errors", you may build optimized Dumatel
(to increase performance 2-3 times):

             cd $(s)
             make clear
             make extraHCOpts=-O  dm >& log  

This will take more time than for -Onot.
Then, act as in the previous Sections 5, 6.

--------------------------------------------------------------------
7. Further work 

Choose some directory aside from Dumatel, create your project there 
and compile (or/and interpret under ghci) your programs calling 
ghc, ghci  with the  $pcpdm  option.

Before proceeding further, read the current remarks in the file

                 .../dumatel/notes/1.02.txt

residing on the site near the Dumatel distribution directory.
Also consult it concerning any unlucky cases.
Also there exists the manual   
                             <D>/dumatel-1.02/book.ps


-------------------------------------------------------------
Remarks are welcome:    Serge Mechveliani  <mechvel@botik.ru>
-------------------------------------------------------------





