********************************************************
* Installation of E3D, the Euro3D visualization tool
* Version 1.2 MAC OS X PLATFORM
*
* M. Lemoine-Busserolle & M. Kissler-Patig, 12.07.04
* contact:lemoine@ast.cam.ac.uk 
*
********************************************************

CONTENT:

1.- Requisites

2.- E3D pre-installation
    2.1.- PGPLOT installation
    2.2.- LCL installation

3.- E3D Installation


[1] Requisites
-----------------------------------------
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 wed 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 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 from our webpage:
 http://www.aip.de/~ssa/euro3d/pgplot5.2.tar.gz

 We recomend the following steps:

 (a) Copy the "drivers.list" distributed with E3D (in the "data"
 directory of the E3D directory tree or from the web:
 http://www.aip.de/~ssa/euro3d/drivers.list) in 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" in the pgplot source directory.

 (c) put the file aqdriv.m and the file AQTprotocol.h (located in aquaterm/pgplot) in 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:
    setenv PGPLOT_DIR DIR/pgplot
    setenv PGPLOT_DEV /aqt
    setenv PGPLOT_FONT DIR/pgplot/grfont.dat
    setenv LD_LIBRARY_PATH :${PGPLOT_DIR}

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

 [2.2] - LCL installation
---------------------------
   You can download the LCL library from the Euro3D internal webpage
   or from:
   http://www.aip.de/~ssa/euro3d/E3D_io_LCL-1.0c.tar.gz


   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.0c

   (d) ./configure
	If there are problems try:
	sudo touch /usr/include/values.h
	sudo ranlib -c genlib.a 
   
   (e) Edit and Check makefile (see makefile_lcl) and run : 
	make

   (f) define the environmental variables: 
       IFU_PATH and IFU_DEFAULT_FMT

       E.g., for a tcsh shell

      setenv IFU_PATH "DIR";
      setenv IFU_DEFAULT_FMT "Euro3D"; 
   [Note: The IFU_PATH points to DIR not to DIR/E3D_io_LCL-1.0c]

   (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 internal webpage or from:
   http://www.aip.de/~ssa/euro3d/e3d-1.2.tar.gz

   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.2)

   (d) Run:
       ./configure

   (e) Edit the file:
       add_defs/makedefs.local
       You will find different definitions of V3D_LIBS, for 
       different architectures. Please, decoment the one
       that fits better with your computer, thus:

     V3D_LIBS =  -L${PGPLOT_DIR} -ltkpgplot -lcpgplot -lpgplot -L/sw/include -ltk -ltcl -L$(topdir)/pkg/v3d/obj -lmy_grid  -L/usr/X11R6/lib -lXpm -lX11 -lXext -lg2c 


   (f) Edit and Check the makefile (see makefile_e3d)***, and Run:
       make

   (g) go to the scripts directory (i.e., cd scripts).
  
   (h) Run:
       ./install.pl

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

   (j) Run:   
       tk_e3d.tcl
       This is the E3D GUI. For testing it, you can load the file
       "test.fits" under the "scripts" 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.2 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]


        
        

    






