-----------------------------------------------------------------
               README FOR CODE_ASTER INSTALLATION
            FULL DISTRIBUTION WITH ALL PRE-REQUISITES
$Id: README_aster.txt,v 1.13 2005/01/20 09:37:40 mcourtoi Exp $
-----------------------------------------------------------------

SUMMARY :
   . LICENCE
   . DISTRIBUTION
   . REQUIRED PRODUCTS
   . PREFERENCES
   . FULL INSTALLATION
   . INSTALLATION WITH PRODUCTS SELECTION
   . EXAMPLES
   . IF AN ERROR OCCURS...
   . LOG OUTPUT
   . TEST YOUR INSTALLATION

For further informations visit http://www.code-aster.org.
Please report installation problems using `Installation` forum
at http://www.code-aster.org/forum.

Read carefully this README or at least help message given by :
   python setup.py --help


-----------------------------------------------------------------
. LICENCE :
   Code_Aster is distributed under the terms of the GNU General
   Public Licence. The text is available at :
      http://www.code-aster.org/telechargement_doc/GPL.txt


-----------------------------------------------------------------
. DISTRIBUTION :
   The package "aster-xxx.tar" contains :
      - this README !
      - setup.py (and others .py) : setup scripts
      - setup.cfg : configuration file to adjust according to
        your configuration.
      - SRC/ : archives of Code_Aster and its prerequisites :
         - Code_Aster 7.4.0,
         - med 2.2.2 (Data Exchange Model),
         - hdf5 1.4.4 (platform independent file format),
         - astk 1.2.1 (to run Code_Aster),
         - Numeric 23.0 (Python module for numerical computation),
         - metis-edf 4.0 (reordering tools),
         - homard 7.1 (refine/unrefine meshes),           [Linux]
         - gmsh 1.56.2 (mesh generator),                  [Linux]
         - gibi 2003 (mesh generator),                    [Linux]
         - tcl 8.4.5 and tk 8.4.5 (X11 toolkit),
         - eficas 1.7.0 (Code_Aster commands file editor),
         - Pmw 1.2 (Python Mega Widgets toolkit),
         - crpcrs 7.4.0 (control of programmation tools,
                        not installed by default, see setup.cfg).

   IMPORTANT NOTE :
      homard and gmsh are provided here as precompiled for Linux.
      When installing this product on another platform type they
      must be disabling (see INSTALLATION WITH PRODUCTS SELECTION
      section).
      Binaries for some other platforms may be available from
      http://www.code-aster.org.

-----------------------------------------------------------------
. REQUIRED PRODUCTS :
   - Python 2.3 is required to use Code_Aster, you must have
   write access into PYTHONHOME/lib/python2.3/site-packages to
   install python modules (see also 'FULL INSTALLATION' section).
   
   NOTE : To use eficas Python must have been installed with
   Tkinter support. In this case skip installation of tcl/tk.


-----------------------------------------------------------------
. PREFERENCES :
   The setup will automatically search for basic components in
   standard directories (in this order) :
      /usr/local/bin, /usr/bin, /bin, /usr/X11R6/bin,
      /usr/bin/X11 (Tru64 specific),
      /usr/openwin/bin (Solaris specific).
   (analog paths are used to search for libraries and includes)
   
   You can set BINDIR (or LIBDIR, INCLUDEDIR) to force the script
   to search in your own directories first. Edit 'setup.cfg' and
   for example :
      BINDIR=['/home/aster/public', '/opt']

   NOTE : Following basic tools are automatically searched during
          the setup :
      shell interpreter (one choosen between bash, ksh or zsh),
      xterm,
      text editor (one choosen between nedit, xemacs, emacs,
      xedit or vi).

   NOTE for developpers :
      You can install this Code_Aster version to make development
      and follow weekly updates.
      Just edit 'setup.cfg' file and add a line as :
         ASTER_VERSION='NEW8'
      
      AFTER the installation process, edit the file
      .../NEW8/bibpyt/Accas/properties.py and change '7.4.0' into
      '8.0.0' (because the 8.0 release start from the 7.4 one).


-----------------------------------------------------------------
. FULL INSTALLATION :
   Using this mode you wish install all products included in the
   package (see `EXAMPLES` section if you need root access for
   installing python modules).

1. Complete 'setup.cfg' file to adjust it regarding your
   configuration. Following parameters MUST be defined :
   - ASTER_ROOT : toplevel directory of Code_Aster installation,
   - CC, F77 and LD : compilers and linker to build Code_Aster,
   - DOMAIN_NAME : your local network domain.

   (comments in 'setup.cfg' give more details)

   NOTE : you can also use --aster_root=ASTER_ROOT option
          of setup.py to define ASTER_ROOT directory.

2. pre-installation check : Run (with the right Python
interpreter) :
      python setup.py test

3. Run setup script (with the right Python interpreter) :

      python setup.py install [--aster_root=...]

For source distribution, built of Code_Aster takes about 30 min
(two versions are built : with and without debugging informations).

NOTE : `python setup.py --help` prints informations about
   available options and products selection.


-----------------------------------------------------------------
. INSTALLATION WITH PRODUCTS SELECTION
   You have two possibilities to select which products you will
   install : giving the list of products to install (see 1.)
   or specify the products you don't want to install (see 2.).
   
1. You can give the name of the products to install :
   Example to install only Code_Aster :
         python setup.py install aster

   IMPORTANT :
   -----------
   `python setup.py --help` gives the list of products name and
   you MUST respect the order given by help to verify
   dependencies.


2. You can disable a product installation by adding lines to
   `setup.cfg` (or another file using --cfg=FILE option) :
      Example to not install Numeric Python module:
         _install_Numeric = False


-----------------------------------------------------------------
. EXAMPLES

1. First example :
------------------
   In this example Python (with Tkinter support to use eficas)
   and Tcl/Tk are already installed and you have sufficient
   permissions to write in Python subdirectory.

   Step 1 : disabling tcl/tk installation :
      - edit `setup.cfg` file and add following lines :

_install_tcl = False
_install_tk = False

   Step 2 : setting tcl/tk prefix
      If tcl/tk are installed in a standard directory (as /usr or
      /usr/local) you can jump to step 3.

HOME_TCL_TK='prefix'  <<< replace prefix to reflect your
                          installation. Ex. /opt/aster/public

   Step 3 : installation of all other products :
      prompt> python setup.py install


2. Second example :
------------------
   In this example Python and Tcl/Tk are already installed and
   owned by root and you want to install Code_Aster components
   using an ordinary user account (for example 'aster').

   Step 1 : installation of Python Modules as root :
      prompt> su root (+ password !)
      prompt> python setup.py install Pmw Numeric
      prompt> rm setup.cache (because 'aster' won't have
                              enough permission)

   Step 2 : disabling tcl, tk, Pmw and Numeric installation :
      - edit `setup.cfg` file and add following lines :

_install_Pmw = False
_install_Numeric = False
_install_tcl = False
_install_tk = False
HOME_TCL_TK='prefix'  <<< replace prefix to reflect your
                          installation. Example : /usr/local

   Step 3 : installation of all other products (as aster) :
      prompt> python setup.py install


3. Third example :
-------------------
   In this example suppose you want to install the new version of
   Code_Aster and that all prerequisites are already installed.
   Note that for Code_Aster 7.4 at least med, eficas and homard
   must be updated to have consistent versions.

   Step 1 : be sure to not have any trace of a previous
   installation
      prompt> rm setup.cache

   Step 2 : test if and which variables must be set in
   setup.cfg file :
      prompt> python setup.py test aster

   Summary output :
.....
 Installation of   : aster (version unavailable)
 Destination       : unknown
 Elapsed time      : 0.01 s

 *** Exception as_setup.SetupError raised : inconsistent
 dependencies or missing variables
     Problem with : HOME_MED, HOME_HDF
                                                         [FAILED]
.....

   Step 3 : The output says that two variables haven't been
   defined. First, search for hdf5 and med location and add
   following lines to `setup.cfg` file :

HOME_HDF='/home/med/hdf5-1.4.4' <<< of course fill with yours
HOME_MED='/home/med/med2.2.2'   <<<          "

   Step 4 : installation of Code_Aster :
      prompt> python setup.py install aster


-----------------------------------------------------------------
. IF AN ERROR OCCURS...

Two kinds of errors can occur : installation or built problem.

1. Error during installation of a product (for example : the
compilation of med failed).
There isn't yet way to customize configuration or built of a
product through `setup.cfg` option.
So you have to configure, build and install the product by hand
(source archive is in SRC directory), and set variables which
are normally set by product setup by adding lines into
`setup.cfg` file.
It isn't always simple to know what variables must be set...
so ask the forum on www.code-aster.org !
When the product is installed add a '_install_XXX=False' line
to `setup.cfg` (see `EXAMPLES` section).


2. If an error occurs during the built of Code_Aster both
configuration and installation should have been well done.

So you have probably to adjust `config.txt` file (under the
version directory) to correct the error and to rerun the built
using as_run.

Rerun the built :
   /opt/aster/ASTK/ASTK_SERV/bin/as_run --make

(replace /opt/aster by ASTER_ROOT, the main directory you chose)


-----------------------------------------------------------------
. LOG OUTPUT

If an error occurs it's better to attach all the traceback if
you ask any questions to Code_Aster forum.
To save all output informations to 'setup.log' :

   prompt> script setup.log
   prompt> ...all commands output will be logged up to Ctrl+D...
   prompt> <Control+D> to end logging

The following command cleans a little the log file :
   prompt> col -bx < setup.log > setup.log2 ; mv setup.log2 setup.log


-----------------------------------------------------------------
. TEST YOUR INSTALLATION

Following steps suppose installation (python setup.py install...)
ended with a correct diagnostic :

--- DIAGNOSTIC JOB : OK


1. Run a simple test case

   - Change to your ASTER_ROOT directory and enter in
     ASTER_VERSION directory.
      prompt> cd /opt/aster/STA7.4

   - Start the small example :
      prompt> /opt/aster/ASTK/ASTK_SERV/bin/as_run forma01a.export

2. Run a list of test cases

   - Change to your ASTER_ROOT directory and enter in
     ASTER_VERSION directory.
      prompt> cd /opt/aster/STA7.4

   - Start the small example :
      prompt> /opt/aster/ASTK/ASTK_SERV/bin/as_run astout.export

   NOTE : By default astout.export runs about 30 testcases
          (liste_etude list), but you can select the
          liste_internet list to run all 1300 provided tests.

