home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / software / unix / saoimage / sao1_07.tar / readme_iraf.txt < prev    next >
Text File  |  1991-10-28  |  19KB  |  450 lines

  1. README.SAOIMAGE -- instructions for building SAOimage and installing it for
  2.                communication with IRAF
  3.  
  4.  
  5. INTRODUCTION
  6. ------------
  7.  
  8. SAOimage was developed and is maintained by Mike VanHilst at the Smithsonian
  9. Astrophysical Observatory.  This README file and the makefile have been
  10. added or modified at NOAO to facilitate building and installing SAOimage
  11. for compatibility with IRAF.
  12.  
  13. The [possibly compressed] tar archive of SAOimage source code constructed
  14. at NOAO from the CfA archive plus a couple of other files contains everything
  15. needed to build and install SAOimage, including communications with IRAF v2.8
  16. or later.  It will not work with versions of IRAF prior to 2.8.
  17.  
  18. Bugs that seem to be purely SAOimage bugs should be reported to the author,
  19. Mike VanHilst at email address "mvh@cfa.harvard.edu".  Bugs that appear to be
  20. IRAF-related should be reported to IRAF site support, iraf@noao.edu (Internet),
  21. or 5355::iraf (SPAN).  If in doubt as to where to report, try IRAF site
  22. support first.
  23.  
  24. Documentation is in the doc subdirectory.  The full User Guide is a LaTeX
  25. document called manual.tex, and there is a Unix manual page as well.  A
  26. VMS help file is provided in the vms subdirectory.
  27.  
  28.  
  29. INSTALLATION
  30. ------------
  31.  
  32. There are two likely locations for the SAOimage directory tree:
  33.  
  34.     Either:
  35.     [a] If you received SAOimage as part of your IRAF distribution,
  36.     it will probably be in iraf$host/x11/saoimage, where "host"
  37.     is "unix", "vms", etc.  
  38.  
  39.     Or:
  40.     [b] If you are installing SAOimage as add-on software distributed from
  41.     NOAO, it is best NOT to place it under the IRAF directory tree,
  42.     because it might not survive a future IRAF update.  Instead, it
  43.     should be placed with other locally-added software, e.g. on a
  44.     Unix system in "/usr/local/src/saoimage", or in a place for X11
  45.     added software, e.g. "/usr/X11/src/saoimage".
  46.  
  47. If case [b] applies, you will need to build the SAOimage executable and
  48. install the necessary program files according to the instructions below.
  49. There are separate build and installation instructions for Unix hosts and
  50. VMS hosts; proceed to the appropriate section at this point.
  51.  
  52. If you received SAOimage with your IRAF distribution, it is probably
  53. already compiled and linked, with the executable located with the other
  54. bootstrap (not portable IRAF) executables, e.g. on a Unix system in the
  55. logical directory $hbin, and on VMS systems in IRAFHLIB.  If this is the
  56. case, you do not need to build or install SAOimage unless you need to
  57. relink it, for example after an X11 upgrade.
  58.  
  59. You may need to do part of the installation described in the parts
  60. numbered [4] below, in the event that you have never before set up an
  61. image display program (imtool or SAOimage) for use with IRAF.  It is
  62. easy to check this on Unix systems: there will be files /dev/imt1i and
  63. /dev/imt1o if an installation has been performed previously.  On VMS,
  64. you just need to be sure that users have a way of running SAOSETUP.COM.
  65. Note that there are two sections numbered [4]: one in the Unix
  66. instructions, one in the VMS instructions.
  67.  
  68.  
  69. Installation of SAOimage as add-on software on Unix
  70. ---------------------------------------------------
  71.  
  72. [1] Login as iraf.  It is important that the iraf account be used, and that
  73.     the iraf system has already been installed on this machine, to set up
  74.     the account environment properly.
  75.  
  76.     % cd /usr/local/src        # (or wherever you put these things)
  77.  
  78.     Check to see if there is an "saoimage" subdirectory, create one
  79.     if necessary, and change the working directory to it:
  80.  
  81.     % mkdir saoimage
  82.     % cd saoimage
  83.  
  84. [2] Unpack the archive.  In what follows, "<path>" is wherever your
  85.     saoimage.tar[.Z] archive is located, either on disk or on magtape.
  86.     If the archive file is listed as ending in ".Z", it is compressed
  87.     and needs to be uncompressed before unpacking.
  88.  
  89.     If the archive is "saoimage.tar.Z", use:
  90.  
  91.     % zcat <path>saoimage.tar.Z | tar -xpf -
  92.  
  93.     Otherwise (saoimage.tar) just use tar:
  94.  
  95.     % tar -xpf <path>saoimage.tar
  96.  
  97. [3] Build the software (compile and link).  The SAOimage makefile is set up
  98.     so that to build the executable for most systems all you have to do is
  99.     execute it with the appropriate architecture on the command line.  The
  100.     Unix architectures currently supported are:
  101.  
  102.     aix              # IBM RS/6000 running AIX
  103.     alliant         # Alliant FX series
  104.     apollo           # Any Apollo, software floating point
  105.     apollo_68882     # Apollo for MC68882 fp
  106.     apollo_fpa       # Apollo for FPA1
  107.     apollo_prism     # Apollo for PRISM architecture (a88k)
  108.     hp               # HP-UX
  109.     mips             # MIPStation running RISCOS
  110.     sgi              # SGI Personal Iris running Irix
  111.     sun              # Default Sun architecture: SPARC
  112.     sun_sparc        # Sun SPARC
  113.     sun_ffpa         # Sun-3 floating point accelerator
  114.     sun_f68881       # Sun-3 motorola f68881 floating point
  115.     sun_fswitch      # All Suns, switchable floating point
  116.     ultrix           # DECstation and VAXstation
  117.  
  118.     To build SAOimage, execute make for the appropriate architecture, e.g.:
  119.  
  120.     (in the saoimage directory)
  121.     % make ultrix >& spool &
  122.  
  123.     When the job finishes, inspect the spool file for errors, and if none were
  124.     found, proceed to the next section.  Otherwise do some troubleshooting:
  125.     e.g. if it appears to be a compile-time problem, inspect the values of
  126.     the various *FLAGS macros in makefile; if it is link-time, look for the
  127.     location of the X11 libraries.  They may differ from system to system,
  128.     and if yours are not accessible with "-lX11", check with your system
  129.     manager.
  130.  
  131.     If your system is not listed above, first examine makefile to see if it
  132.     has been added to the file but not to these instructions.  If your 
  133.     architecture is still not present, it can probably be made to work by
  134.     editing the values of MFLAGS and ADFLAGS in the one of the machine-
  135.     dependent makefiles (makefile.<machine>).  You will want to select
  136.     a <machine> with a Unix architecture like yours: makefile.hp would
  137.     be a good place to start for System V Unixes, makefile.dec for the
  138.     more Berkeley-like derivatives.  You will need to run make and specify
  139.     the makefile name on the command line:
  140.     
  141.     % make -f makefile.<whatever>
  142.  
  143.     You could also simply specify MFLAGS and DFLAGS on the "make" command
  144.     line, rather than editing the file; for instance,
  145.  
  146.     % make -f makefile.<whatever> MFLAGS="-DSYSV -DLSB"
  147.  
  148.     See the comments in the makefiles concerning the conditional compilation
  149.     flag values for MFLAGS and ADFLAGS.
  150.  
  151. [4] If the compile and link were successful, install the SAOimage executable
  152.     and manual page, along with the files needed for communication with IRAF.
  153.     This installation step must be taken as superuser!  On a Unix system,
  154.     this is fairly straightforward, except that you must specify the correct
  155.     makefile for your machine type:
  156.  
  157.     % su
  158.     % make -f makefile.<machine> install
  159.  
  160.     There are several machine-dependent makefiles; <machine> can be one of
  161.     alnt, apo, dec, hp, ibm, mips, sgi, or sun.
  162.  
  163.     NOTE for Apollo sites:
  164.     Although Domain/BSD does not support named pipes at all, a Domain/OS
  165.     system configured with *both* BSD and System V may be used to install
  166.     the two named pipes (fifo's).  If the SysV software is not installed,
  167.     this step will fail.
  168.  
  169.     Note that by default the executable will be placed in /usr/local/bin,
  170.     the manual page will go in /usr/man/manl, and the IRAF imtoolrc file
  171.     will be copied to /usr/local/lib.  *These directories must exist prior
  172.     to invoking the installation procedure*.  You can override these location
  173.     choices either by editing the makefile for your specific machine
  174.     (makefile.<machine>), of by defining the proper macros on the
  175.     command line; these are:
  176.  
  177.     SAOBINDIR               # Destination directory for SAOimage program
  178.     SAOMANDIR               # Destination directory for on-line manpage
  179.     IMTRCDIR        # Destination directory for imtoolrc
  180.  
  181.     The path to the imtoolrc file is used in the code at one point, so
  182.     if the IMTRCDIR is changed, it will be necessary to recompile the
  183.     irafenv.c module:
  184.  
  185.     % rm -f irafenv.o
  186.     % make <architecture>
  187.  
  188.     Obviously, irafenv.c must be recompiled (and SAOimage relinked) prior
  189.     to installing the program.  If the installation is still unsuccessful,
  190.     call IRAF site support.
  191.  
  192.     Unix sites may wish to run "catman" on /usr/man/manl/saoimage.l.
  193.  
  194. [5] After a successful installation, you can strip out the various files
  195.     that were created during the build procedure (object files, libraries,
  196.     and so forth).
  197.  
  198.     % make clean
  199.  
  200.     You may wish to test the installation first.  See the sections below
  201.     that deal with SETTING UP SAOIMAGE and TESTING SAOIMAGE.
  202.  
  203.     Note that the `make clean' command will delete any *executable* versions
  204.     of SAOimage in the directory; it is assumed that the real executable
  205.     will have been copied into SAOBINDIR during the installation phase
  206.     (and that you didn't manually set SAOBINDIR to the SAOimage source
  207.     directory itself).
  208.  
  209.  
  210. Installation of SAOimage as add-on software on VMS
  211. --------------------------------------------------
  212.  
  213. In addition to the instructions in this section, there are comments and
  214. explanations in the SAOSETUP.COM and [.VMS]README.VMS files that might be
  215. helpful and/or interesting.
  216.  
  217. [1] Login as IRAF.  It is important that the IRAF account be used, and that
  218.     the IRAF system has already been installed on this machine, to set up
  219.     the account environment properly.
  220.  
  221.     $ set def sys$sysdisk:[local.src]    ! or wherever these things go
  222.  
  223.     Check to see if there is an "saoimage" subdirectory, create one
  224.     if necessary, and change the working directory to it:
  225.  
  226.     $ create/directory [.saoimage]
  227.     $ set def [.saoimage]
  228.  
  229. [2] Unpack the archive.  In what follows, "<path>" is wherever your
  230.     saoimage.tar[.Z] archive is located, either on disk or on magtape.
  231.     If the archive file is listed as ending in ".Z", it is compressed
  232.     and needs to be uncompressed before unpacking; in this case, you
  233.     will also need the VMS compress/uncompress program available in the
  234.     util subdirectory of the FTP archive (get the README file, too).
  235.  
  236.     $ uncompress :== $disk:[dir]compress_vms uncompress
  237.  
  238.     The preceding statement sets up the DCL symbol that defines the
  239.     program as a foreign command.  The VMS uncompress program needs
  240.     to know how many data bytes are in the compressed file; this is
  241.     the number of bytes transferred via FTP.  Also, the program expects
  242.     the filename extension end in "_z", so when you transfer the SAOimage
  243.     archive, you should specify an output filename to the get command.
  244.  
  245.     $ uncompress -s <nbyt> saoimage.tar_z
  246.  
  247.     The file will be uncompressed in place, and saoimage.tar will be left.
  248.  
  249.     You can unpack the tarfile with the IRAF rtar utility.  This can be
  250.     run from DCL as long as the IRAFUSER.COM file has been run, usually
  251.     by typing the `iraf' command (symbol); you do not have to be in the
  252.     IRAF CL to use rtar.
  253.  
  254.     $ rtar -xltvf <path>saoimage.tar
  255.  
  256. [3] Build the software (compile and link).  There is a set of MAKE.COM
  257.     files that accomplishes this; you only need to start the one in the
  258.     [.saoimage] directory.
  259.  
  260.     $ @make/output=spool.log
  261.  
  262.     When the job finishes, inspect the spool file for errors, and if none
  263.     were found, proceed to step [4].  Otherwise do some troubleshooting:
  264.     if it appears to be a compile-time problem, inspect the values of
  265.     the various flags set in the "/define=(...)" qualifier in MAKE.COM;
  266.     if a link-time problem occurred, check the location of the X11 libraries.
  267.  
  268. [4] If the compile and link were successful, install the SAOimage executable
  269.     and the startup .COM file, along with the configuration file needed for
  270.     communication with IRAF.  If you intend to install the files in a system
  271.     location, you will need to be logged in as SYSTEM.
  272.  
  273.     $ @[.vms]install <destination path>
  274.  
  275.     All of the "run-time" files (there are 4) are installed in the same
  276.     place on VMS systems.
  277.  
  278.     You may wish to install the help information in a standard help
  279.     library on your system:
  280.  
  281.     $ lib/help/log sys$help:localtools <destination path>saoimage.hlp
  282.  
  283.     You may wish to set up a symbol that users can use to run the startup
  284.     command procedure; global symbols such as this are often defined in
  285.     SYS$MANAGER:SYLOGIN.COM
  286.  
  287.     $ saosetup :== @<destination path>saosetup
  288.  
  289. [5] After a successful installation, you can strip out the various file
  290.     that were created during the build procedure (object files, libraries,
  291.     and so forth).
  292.  
  293.     $ @make clean
  294.  
  295.     You may wish to test the installation first.  See the sections below
  296.     that deal with SETTING UP SAOIMAGE and TESTING SAOIMAGE.
  297.  
  298.  
  299. SETTING UP SAOIMAGE
  300. -------------------
  301.  
  302. Use of SAOimage requires that the program be known to your login session,
  303. and that SAOimage be permitted to open a window on your X display.  The
  304. means for achieving these things are different for Unix and VMS.
  305.  
  306.  
  307. Setting up your Unix environment to use SAOimage
  308. ------------------------------------------------
  309.  
  310. The SAOimage executable must be on each user's search path, which is why
  311. it is important that SAOimage be installed in a commonly accessible directory
  312. such as /usr/local/bin.  You can be sure that the program is accessible
  313. by using the `which' program:
  314.  
  315.     % which saoimage
  316.  
  317. The full path to the program should be echoed.  If it is not, check to be
  318. sure that the SAOimage executable is on one of the directories reported.
  319. If you hvae just completed the installation, you may need to rehash.
  320.  
  321. You can direct SAOimage to use a particular X display with the -d switch
  322. on the command line, or by using the DISPLAY environment variable.  All
  323. X applications query for the DISPLAY variable, so it is conventional for
  324. this to be defined when the X Wind System is used.
  325.  
  326.     % setenv DISPLAY mynode:0
  327.  
  328. If you are running SAOimage on the local node, you can use the string
  329. "localhost" instead of your workstation name.  If the display is a different
  330. node, i.e. if you are running SAOimage on a remote host, you must allow
  331. network access to the local X display screen.  This is most easily done
  332. with the xhost program.
  333.  
  334.     % xhost nodename
  335.  
  336. xhost must be run on the machine with the X display.
  337.  
  338. SAOimage's hardcopy facility makes a PostScript file and ships it to a
  339. printer according to instructions in the user's R_DISPOSE environment
  340. variable.  Typically, this is set to something like:
  341.  
  342.     % setenv R_DISPOSE 'lpr -Plw5 -r -s %s'        # OR
  343.     % setenv R_DISPOSE 'lpr -P$PRINTER -r -s %s'
  344.  
  345. SAOimage is usually run in the background.  Many parameters that can be
  346. changed with command line switches can be adjusted while SAOimage is running,
  347. so it is not necessary to fire it up with lots of arguments.  See the user
  348. manual (manual.tex) for details.
  349.  
  350.     % saoimage &
  351.  
  352. You may need to position the window and click the mouse.  If you get a
  353. message something like 'cannot handle pseudocolor map', try:
  354.  
  355.     % set USE_MIT_VISUALS=1
  356.  
  357.  
  358. Setting up your VMS environment to use SAOimage
  359. -----------------------------------------------
  360.  
  361. The SAOimage program must be run as a foreign command from DCL, and the
  362. DECwindows display must be properly set.  The SAOSETUP.COM procedure is
  363. provided to ensure that both of these things are taken care of.  There
  364. are numerous comments in that file which explain what needs to be set up;
  365. please refer to them.
  366.  
  367. SAOimage is usually run in the background.  Many parameters that can be
  368. changed with command line switches can be adjusted while SAOimage is running,
  369. so it is not necessary to fire it up with lots of arguments.  See the user
  370. manual (manual.tex) for details.
  371.  
  372.     $ spawn/nowait/in=nl: saoimage
  373.  
  374. You may need to position the window and click the mouse.
  375.  
  376.  
  377. TESTING SAOIMAGE
  378. ----------------
  379.  
  380. This section describes a couple of tests that should be run from the IRAF
  381. CL to verify that communication between SAOimage and the CL is working.
  382. You should run the CL from an IRAF-compatible graphics/text window like
  383. xterm, which will also probably be running in the background as a separate
  384. X application.
  385.  
  386.     % xterm -ls &
  387.  
  388. Once a Unix shell has come up in the xterm window, start the IRAF CL by
  389. typing `cl'.  After the usual login messages, type
  390.  
  391.     cl> stty xtermjh
  392.     cl> images
  393.     im> tv
  394.     tv> reset stdimage = imtool
  395.     tv> reset stdimcur = stdimage
  396.     tv> display dev$pix 1
  397.  
  398. The canonical IRAF test image of the Whirlpool galaxy should be displayed
  399. in the SAOimage window.
  400.  
  401.     tv> =imcur
  402.  
  403. A new cursor will appear in the image window.  If you are using a window
  404. manager that requires you to click the mouse in the window to assign the
  405. input focus, you will first have to move the mouse pointer into the upper
  406. border of the SAOimage window and click the left button.  Don't click *in*
  407. the SAOimage window; do it on the border.
  408.  
  409. Move the mouse/image cursor somewhere over the image, and press the key "a".
  410. You should see in the xterm window something like this, depending of course
  411. on where the mouse was:
  412.  
  413.         256.000 256.000 101 a
  414.  
  415. If the image displays correctly, and cursor readback is working,
  416. the installation was successful.
  417.  
  418.  
  419. PRINTING THE DOCUMENTATION
  420. --------------------------
  421.  
  422. The SAOimage manual is provided in LaTeX source form.  It is roughly 30
  423. pages long when processed and printed.
  424.  
  425. LaTeX produces "device independent" output in a .dvi file that must be
  426. postprocessed through a translator for your specific print device.  The
  427. DVI file can be produced with the SAOimage makefile:
  428.  
  429.     % make manual
  430.  
  431. The file doc/manual.dvi is the result of this command.  Access to a TeX
  432. installation must be available on the same system on which SAOimage is
  433. being installed obviously.  If the manual must be copied to a different
  434. host, only the manual.tex file is required, although the .aux and .toc
  435. files could be copied as well; this would reduce the number of LaTeX
  436. iterations.  (these files are auxiliary files produced during the first
  437. "pass" of LaTeX over the document and contain auxiliary and table of
  438. contents information.)
  439.  
  440. Conversion of the .dvi file requires an appropriate DVI->whatever
  441. translator for the target laser printer.  Many laser printers today
  442. use the PostScript language, and a typical name for a DVI->PostScript
  443. translator is "dvips".  One would produce device-specific output (and
  444. sometimes even dispose of it on the printer) with a single command:
  445.  
  446.     % dvips manual
  447.  
  448. It would be best to confirm what needs to be done by checking the
  449. local documentation about LaTeX and your printers.
  450.