       First upgrade of Mark-4 VLBI Analysis System CALC/SOLVE
       #######################################################  


Before installation
~~~~~~~~~~~~~~~~~~~


1) Launch csh (C shell) if you use another shell. All compilation procedure 
   runs under C shell. Check:

   a) environment variable PATH. It should contain paths for system 
      procedures, X11 binaries, C compiler and Fortran compiler.

   b) whether your system has executables zip and unzip. They should be 
      installed in your system and be callable from C shell script.

   c) Do you have compilers? Script solve_install assumes that Fortran compiler
      is called both as f77 and fort77, C compiler is called as cc and c89.

   d) Check whether C-shell programs can run at your system.

2) Choose a label for your analysis center. It should consist of 3-12 capital 
   letters. This label is used as a unique identifier of your site specific 
   preferences.

3) Choose a 3-letter abbreviation for your analysis center. It will be used 
   as an identifier of analysis center in output in spool-file and SINEX 
   output. Maybe you need ask your boss which name he/her prefers. 

4) Choose a name for the directory tree. 


Installation.
~~~~~~~~~~~~~

0) Start C shell or tcsh.

1) Copy a distribution kit to some local directory. Check disk space:
   it should have enough room to allocate the kit twice. Check disk space at 
   the disk where you are going to install CALC/SOLVE: it requires about 
   200Mb.

2) Untar it by command tar -xvf <distribution_kit>

3) Set environment variable SAVE_DIR, unless you set it before. It should
   point the directory with SOLVE save files.
   Make a tree by command make_tree
   That program will ask you to set values of some environment variables.
   Do it! 

   Then add their definition to your shell customization file ( ~.tcshrc if
   you use tcsh shell as I do). Apply this definition (by the command 
   source ~/.tcshrc if you use tcsh shell ).

   Check once more whether they actually were set up properly.

4) Edit file "centers" in root directory. Add there a label of your analysis
   center. This label will be used to identify installation preferences of
   your center.

5) Make a directory tree  by command "make_tree"

6) Unzip the sources code by the command "solve_install <center_label> init"

7) Create local files. These files keeps site-specific preferences.
   Local files are located in the director $MK4_ROOT/local/

   You have to make at least one mandatory file <CENTER_LABEL>.lcl
   and 2 additional files: 
         <CENTER_LABEL>.hea
         <CENTER_LABEL>.dbs 

   here <CENTER_NAME> is the label of your center 

   7a) Copy file from $SAVE_DIR/template_local.lcl to 
       $MK4_ROOT/local/<CENTER_LABEL>.lcl
       Edit it. Don't forget to remove lines beginning from !! characters.

   7b) If you are going to generate listing of your solution in SINEX format
       then copy file from $SAVE_DIR/template_hea.lcl to 
       $MK4_ROOT/local/<CENTER_LABEL>.hea
       Edit it. Don't forget to remove lines beginning from !! characters.

   7c) If you are going to submit databases to the IVS Data Center
       then copy file from $SAVE_DIR/template_dbs.lcl to 
       $MK4_ROOT/local/<CENTER_LABEL>.dbs
       Edit it. Don't forget to remove lines beginning from !! characters.
       
   Check attentively your $MK4_ROOT/local/<CENTER_LABEL>.lcl file.
   You save a lot of time if you succeed in finding an error in this file
   just now.

 8) Rename CORFIL.template to CORFIL in SAVE_DIR directory. You might may wish 
    to edit it.

 9) Compile CALC/SOLVE;

    $MK4_ROOT/support/make_all_mk4 <center_name>

    It takes 0.5-2 hours.

10) Look at the files 
      make_libs_errs, 
      make_progs_errs, 
      make_solve_errs, 
      make_testware_errs,
      make_utils_errs

    in $MK4_ROOT/temp directory. Draw special care at the lines starting with
    **, lines with words "Don't" and lines with "Make:". If there is no any 
    fatal error messages -- congratulation -- CALC/SOLVE is installed!

    If you will find a warning like "pxdb internal error" ignore it. 
    It doesn't bring harm. 


Post-installation.
~~~~~~~~~~~~~~~~~~

1) Send file $MK4_ROOT/centers to a CALC/SOLVE maintainer. This files will 
   become the part of official code. It means that the next release of 
   CALC/SOLVE will support your site. 

   If you have some problems during installation send a verbose report with
   all make_xxxx_errs files attached. 

2) Make local copy of solve_env.template from $SAVE_DIR directory and
   customize it. It is wise to include it in your shell customization file.
   CALC/SOLVE expect to see a lot of environment variables installed. In general
   CACL/SOLVE is able to work without any environment variables but you may 
   wish to tune the package in according your own preferences. Some environment 
   variable change the first appearance of menu windows, other affects SOLVE 
   more seriously. Below is the list of important environment variables used 
   by SOLVE:

   SOLVE_DIR, ARC_STR, HELP_DIR, SAVE_DIR, WORK_DIR, SPOOL_DIR, CGM_DIR,
   PGPLOT_DIR, SOLVE_EDITOR, SOLVE_PS_VIEWER, DIAGI_PRIVOM (see below)

3) Add environment variable DIAGI_PRICOM. It declares a command for printing
   postscript file at your printer. It may vary form system to system.
   The following definition is used in Bonn for printing PostScript files at
   printer LaserJet5m: setenv DIAGI_PRICOM "lp -onb -dlaser2". Consult with
   your system administrator.

4) Remove all old scratch files.
   Then create new scratch files by running solve_reset.
   Each user should make this operation.

5) Update SOLMOD if you didn't it earlier. You should mandatory add there the 
   following lines to the bottom:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!                                                                           !!
!! Please NEVER change the last line, otherwise all SOLVE-processes will     !!
!! stop during 1 minute!                                                     !!
!! It is used as an indicator of the end of SOLMOD file.                     !!
!!                                                                           !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
SOLMOD SOLMOD SOLMOD SOLMOD SOLMOD SOLMOD SOLMOD SOLMOD SOLMOD SOLMOD SOLMOD 

   If you didn't have SOLMOD file in your system you can find template file
   $SAVE_DIR/SOLMOD.template

6) In dependence of how old your version of s-SOLVE was you may need make
   some updates of the save-files. For example, MDLPL requires file jmg96.hf,
   catalogue system requires to have directory for catalogue locs created,
   flyby_mod files should be not older than Oct 1996 etc.

7) Add the following lines lines to your C shell or tcsh customization file.

setenv MK4_ROOT  <path_to_the_root_directory>
source MK4_ROOT/support/solve_var

   otherwise you will not be able to compile and link separate CALC/SOLVE 
   programs. Script solve_var sets values of some environment variables which
   controls compilation and linking in according with preferences of your
   analysis center. (Solve users who only use Solve may not have these 
   environment variable, although a user who is going to compile/link SOLVE
   MUST have these environment variables).

8) Add the following lines to ~/.Xdefault file:

pgxwin.Win.geometry:	1260x800+0+90
pgxwin.server.visible:	True
pgxwin.Win.maxColors:   70
pgxwin.Win.iconize:     True

   Each user who are going to use CALC/SOLVE should add these line to his/her
   private version of ~/.Xdefault to be sure that pgplot will be working  
   properly.

9) In order to look PostScript documentation file you should create an 
   executable file for launching PostScript viewer (for example ghostview).
   Put this file in the directory $MK4_ROOT/bin/ and set its name to the 
   environment variable SOLVE_PS_VIEWER. CALC/SOLVE expects that PostScript 
   files are displayed at the screen by the command 
   $SOLVE_PS_VIEWER <file_name>.

10) You should use some editor for adding history records for updated database
    file. If you prefer other editor than system-wide default (vi) you should 
    write a script for launching your favorite editor (for example emacs), put 
    it in the directory $MK4_ROOT/bin/ and set its name to the 
    environment variable SOLVE_EDITOR. CALC/SOLVE expects that the editor is 
    called by the command $SOLVE_EDITOR <file_name>.

11) Add directory with CALC/SOLVE executables to your PATH environment 
    variable.

12) Launch CALC/SOLVE and enjoy SOLVEing! 

    Be sure that SOLVE programs are called properly. CALC/SOLVE programs are 
    searched in the following order: 
    a) first SOLMOD is examined. 
    b) If SOLVE doesn't find there the program name it looks directory 
       specified in SOLVE_DIR. 
    c) If SOLVE_DIR variable is not specified executables will be taken from 
       the directory specified in ${MK4_ROOT}/progs/solve/include/gsfcb.i in 
       the variable SOLVE_PROG_DIR. 
    NB: SOLVE programs cannot be called from s-SOLVE (pre-97 version of Solve)
        and vice versus.
    NB: scratch files created by f-SOLVE are valid for s-SOLVE: you are able 
        to load new database or superfile in this scratch files. scratch files
        created by s-SOLVE are not valid.

13) Check existence of the file with ephemerides. The filename is defined in 
    ../src/includes/param.i as  JPL_EPH . If you don't have it, get it from
    Goddard Space Flight Center: 
    ftp://gemini.gsfc.nasa.gov/pub/misc/dgg/calc9.1/JPL.DE403 

    You may need another files for Calc 9.1: ut1pm.dat, ut1ls.dat blokq.dat
    and others. Refer to a documentation of Calc 9.1 . You can find it in
    the directory  ../progs/calc91/doc


Leonid Petrov  ( pet@leo.gsfc.nasa.gov )
2000.08.07_09:35:37
