********************************************************
* Installation of E3D, the Euro3D visualization tool
* Version 1.3.6 MAC OS X PLATFORM
*
* Originally written by
*    M. Lemoine-Busserolle & M. Kissler-Patig, 12.07.04
* Additions: Clauss Goessl, Nov05/Jan06
*
********************************************************

CONTENT:
1.- Requisites
2.- E3D pre-installation
 2.1.- PGPLOT installation
 2.2.- LCL installation
3.- E3D Installation

[1].- Prerequisites
-----------------------------------------
Before installing the Euro3D software, be sure that :
 - the "X Code Tools" is installed. If not you should be able to install it
   from "/Application/Installers/Developper Tools" or use the Panther DVD with
   "Install Applications and Classic Support".
   Watch out, do a customised install including X11SDK and the 10.3SDK (off by
   default), if possible update to the latest Xcode version using the Apple's
   Developer web site.
 - the Apple X11 environment is installed. if not on the Panther DVD, you
   should find it at: www.apple.com/macosx/x11/download/
 - g77 was not included in the "Developer Tools", so you can installed it from
   "FINK": "http://fink.sourceforge.net". Use FINK to install g77.
 - Tcl and Tk libraries are installed. If not you can use FINK to install both,
   or find them in the scisoft directory if the ESO scisoft distribution is
   installed in your computer.
 - Install the Aquaterm package (http://aquaterm.sourceforge.net). 

[2].- E3D pre-installation
--------------------------

 For consistency we recommend that all the libraries needed for running
 E3D would be installed in the same directory tree. Lets name this
 directory DIR=directory.

 [Note: In the case of LCL it is mandatory to do so]

 [2.1].- PGPLOT installation
 ---------------------------
 E3D uses the version 5.2 of PGPLOT. You can download PGPLOT from the webpage:
 http://www.astro.caltech.edu/~tjp/pgplot/
 [pgplot5.2.tar.gz]
 or directly:
 ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz

 We recomend the following steps:

 (a) Copy the "drivers.list" distributed with E3D, in the "scripts" directory
     of the E3D directory tree or from the web
       http://www.aip.de/Euro3D/E3D/drivers.list
     into the directory DIR/pgplot (pgplot destination directory for E3D).

 (b) put the files "g77_cc_AQT.conf" and "iand.c" from the
     ".../aquaterm/pgplot" to a new directory: "pgplot/sys_macosx" into the
     pgplot source directory.

 (c) put the file aqdriv.m and the file AQTprotocol.h (located in
     aquaterm/pgplot) into pgplot/drivers/

 (d) update the file driver.list with the following entry:
       AQDRIV 0 /AQT AquaTerm.app under Mac OS X C

 (e) update makemake file with the following entry to section Device drivers:
       AQDRIV="aqdriv.o"

  (f) Go the directory where you want to install pgplot and Run the command:
       ./PATH_SOURCE/pgplot/makemake /PATH_SOURCE/pgplot macosx g77_gcc_AQT

 (g) Edit the makefile which has been produced and make change has in the
     makefile_pgplot and Run the command:
       make

 (h) Run the command:
       make cpg

 (i) Define the following enviromental variables:
     for tcsh
       setenv PGPLOT_DIR DIR/pgplot
       setenv PGPLOT_DEV /aqt
       setenv PGPLOT_FONT DIR/pgplot/grfont.dat
       setenv LD_LIBRARY_PATH ${PGPLOT_DIR}
     For bash
       export PGPLOT_DIR=DIR/pgplot
       export PGPLOT_DEV=/aqt
       export PGPLOT_FONT=DIR/pgplot/grfont.dat
       export LD_LIBRARY_PATH=${PGPLOT_DIR}

  (f) Run the Tcl/Tk demo:
        ./pgtkdemo.tcl
      This demo should open an interactive GUI.

 [2.2].- LCL installation
 ------------------------
   Download the LCL library from the Euro3D webpage
     http://www.aip.de/Euro3D/E3D/#Status
   Make sure you download the version that corresponds to the version of the
   E3D tool that you are installing.

   The installation steps are:
   (a) Copy the tar file to the directory DIR.

   (b) Decompress and untar the file.

   (c) Go to the created directory, e.g.,
         cd E3D_io_LCL-1.3

   (d) ./configure
	If there are problems try:
	  sudo touch /usr/include/values.h
	  sudo ranlib -c genlib.a
        (This is no longer necessary with recent MacOSX versions)

   (e) Edit and Check makefile (see makefile_lcl) and run:
	 make

   (f) define the environment variable IFU_PATH:
       E.g., for a tcsh shell
         setenv IFU_PATH "DIR";
       For bash
         export IFU_PATH="DIR"
       [Note: The IFU_PATH points to DIR not to DIR/E3D_io_LCL-1.3]
       [Note: If you install E3D-1.3.6 or later, IFU_DEFAULT_FMT is
              no longer necessary.]

   (g) go to the directory:
         cd checklib/exec
       and run the test program:
         ./check_E3D_io
       If all the tests are ok, then you have LCL properly installed.

[3].- E3D installation
----------------------
   Once you have installed PGPLOT and LCL, and tested them, you can
   install E3D.
   You can download E3D from the Euro3D webpage
     http://www.aip.de/Euro3D/E3D/#Status

   The installation of E3D is documented in the document E3D.ps under
   the "doc" directory of E3D.

   The installation steps are summarized here:

   (a) Copy the tar-gzip file to the directory DIR.

   (b) Decompress and untar the file.

   (c) Go to the created directory (e.g., e3d-1.4.8)

   (d) Edit Makefile.am, comment the two lines for AM_MAKEFLAGS with a hash
       sign, and uncomment those lines corresponding to your MacOS X version.

   (e) To update all configuration and makefiles, run:
         aclocal
         autoconf
         automake --add-missing

   (f) Run:
         ./configure

   (g) As recommended by the output, edit the file
         add_defs/makedefs.local
       You will find different definitions of V3D_LIBS, including two for
       MacOS X. Select the one corresponding to your MacOS version and
       uncomment it (remove the hash sign and instead comment the one that is
       active by default)

   (h) Create the build by executing
         make

   (g) Adapt the TCL scripts to make the installation work:
         make install

   (h) Add the "user/bin" directory to your PATH.
       E.g., for a tcsh shell
         setenv PATH ${PATH}:DIR/e3d-1.4.8
       for bash
         export PATH=${PATH}:DIR/e3d-1.4.8

   (i) Run:
         tk_e3d.tcl
       This is the E3D GUI. For testing it, you can load the file
       "test.e3d" under the "data" directory.

 [Note: We recomend that once compiled E3D, you create a symbolic
 link, to a generic directory (e.g., e3d) and add that to the PATH,
 instead the current version directory:
    cd DIR
    ln -s e3d-1.4.8 e3d
    setenv PATH ${PATH}:DIR/e3d	
 The reason for doing so is that E3D is a program under development,
 and therefore new versions would be available with the pass of time.
 Once you have compiled a new version you have to change only the
 symbolic link]

