--- External SPECROAD: Installing E-SPECROAD

Other External SPECROAD Pages: What is E-SPECROAD? | User's Guide | Version History

Available Downloads:SizeLast Updated
hectoshell_MacOSX_20080807.tgz36 KThu., Aug. 7, 2008
hectoshell_Linux_20080807.tgz36 KThu., Aug. 7, 2008
idhenear.600gpm_4800.dat523 BytesTue., Aug. 5, 2008
Hectospec_HeNeAr_600gpm_4800.pdf485 KTue., Aug. 5, 2008
Hectospec_HeNeAr_Spectrum.pdf2430 KTue., Aug. 5, 2008

These instructions, while geared toward astronomers using to the MacOS X environment, are fairly portable to other *nix type environments. I have added notes for Linux users and I have personally gotten working installations of E-SPECROAD on Fedora Core 9 Linux (both 32 and 64-bit versions) using ESO Scisoft Linux 7.1 after some work (*). I've tried to make these notes as easy to follow as I can, however I do assume a certain level of comfort with the command line environment as well as familiarity with disk permissions and how/when to use the sudo command in conjunction with what you see below.

Pre-Installation Instructions

I will start off by telling you everything you need to do before you can even expect External SPECROAD (E-SPECROAD) to work. This breaks down to making sure before you even attempt installing the software related to E-SPECROAD you have to have

  1. A functional X-windows *nix-based operating system.
  2. Functional versions of the tcsh and ksh shells installed. I highly recommend using tcsh as your default environment as that is what I have assumed. However, if you are talented enough to set up the proper environmental variables in your prefered shell, you should be OK.
  3. A functional installation of IRAF 2.12 or later (including X11IRAF).
  4. For Mac users, the g77 compiler must be installed and in your command path. Linux users can skip this as long as they have a complete gcc and glibc environment (all developer packages too). IRAF on linux uses f2c,which is included in the default IRAF distribution. If you using 64-bit linux, see notes below in the section on compiling IRAF packages.

Once you get your computer to meet these requirements, installing all the software for running External SPECROAD is fairly straightforward. If your computer meets these requirements, you can probably skip the pre-installation instructions for the most part.

  1. My assumptions about your Computer.
    1. Using a Macintosh? You must be running MacOS 10.4.x or higher. You must have also installed the optional X11 support on the Mac if you are running MacOS 10.4. If you are running MacOS 10.5, I would strongly suggest you consider installing XQuartz over the X11 installed by the OS, but it is not critical. I've only extensively tested these E-SPECROAD scripts under MacOS 10.5, but there is nothing I can think of that prevents them from running on a Mac running MacOS 10.4.x.
    2. Using a Linux/BSD/SunOS Computer? The E-SPECROAD scripts should run on any operating system with a Linux/BSD/SunOS interface as long as that computer mets the requirements outlined above. In fact,as noted above, these scripts have been made to run under both 32 and 64-bit versions of Fedora Core 9 Linux using ESO Scisoft Linux 7.1.

  2. Switch your default shell to tcsh. IRAF really want to run in tcsh instead of bash, the default shell on most modern *nix distributions. On most systems, you can change your default shell by typing:

    chsh –s /bin/tcsh

    on the command line. You may want to check with your system administrator if tcsh isn't installed. I have confirmed this works on a MacOS X Leopard (10.5) machine. For earlier MacOS X versions, you may have to run NetInfo manager to change your default shell to /bin/tcsh .

  3. If you haven't already done so, install IRAF including X11IRAF (preferably version 2.14, but it should run on 2.12) on your computer and get your user account set up to use it.
    1. For the Intel-based Mac, the easiest way to get IRAF running is to either use Macros Huerta's IRAF package based installer or to use Scisoft OSX (Mirror). I personally prefer using Scisoft OSX because it doesn't require futzing around with my account settings.
    2. If you have a PPC-based Mac, you can install IRAF 2.14, but I believe you will have to follow the instructions on IRAF.net for installing IRAF manually. Older versions of IRAF are available in the last PPC compatible version of Scisoft OSX (Mirror) and in Macro's Huerta's package based installers.
    3. For Linux computers, there are a variety of installation options available for IRAF. I personally find ESO Scisoft Linux 7.1 to be the easiest way to install IRAF, at least on Fedora Core Linux machines. It installs IRAF 2.12, along with a lot of other software that might be useful to you as an astronomer, in a few minutes (without requiring you to create an iraf user account). If you use another distribution of Linux or really want to install just IRAF 2.14, investigate IRAF.net for information on manually installing IRAF.

    Testing your IRAF installation: Make sure you have set up IRAF so that you can run 'ecl' and so IRAF's environmental variables are loaded in your command line environment. If everything works
    1. You should be able to go to your IRAF directory and type "ecl" to launch IRAF.
    2. You should be able to type "cd $hlib" and go to one of the IRAF configuration directories.
    3. You should be able to type "xgterm" and have an xgterm terminal window launch. If it doesn't launch it could either be an indication of an IRAF installation problem or an X-windows configuration problem. If you are using MacOS 10.4.x, check an make sure you have the DISPLAY environmental variable set (e.g. - the .tcshrc file contains "setenv DISPLAY :0.0") and that the X11.app (located in the /Applications/Utilities) application is running. If you are running MacOS 10.5.x, make sure the DISPLAY variable is NOT set.

  4. Download and install g77 for the Mac from the High Performance Computing for Mac OS X website. You will need it to properly compile some IRAF packages. To make sure it is in your $PATH and to get it to behave like f77, add the following lines to the end of your .tcshrc file:

    setenv PATH ${PATH}:/usr/local/bin
    setenv XC_F77 g77
    setenv XC_FFLAGS "-fugly-logint"


    WARNING for Linux Users: The above "XC" environmental variables should only be set on the Mac and NOT under Linux. Linux will use the f2c compiler within IRAF.

  5. Download and install properly working versions ksh for the Mac. I'll admit I am not absolutely certain this step is necessary under MacOS 10.5, but under MacOS 10.4 I observed that the ksh that was provided with the Mac has a serious bug in the handling of file lists that prevents SPECROAD from working. You need a properly working ksh on the Mac if you want to run SPECROAD on the Mac. The easiest way to do this is to install MacPorts, and then, after properly configuring your .tcshrc to add support for MacPorts, type:

    sudo port install ksh93

    and after some work, you should have properly functioning ksh installed. Installing MacPorts also allows you to install many other applications with their origins in the linux community fairly easily.

Installing the Hectospec Software

The Smithsonian Astrophysical Observtory does provide most of the software necessary to reduce Hectospec data and you need to download and install it.

  1. You might want to take a moment here and make sure you have disk permissions set properly to allow you to write to /usr/local as that is where we will be installing almost everything we need. If /usr/local doesn't exist, create it with permissions to allow you to write to it.

  2. Create a /usr/local/iraf directory to install additional IRAF packages in. Actually, doesn't matter where you place this directory, I just assume this further down in these instructions. It's pretty easy to pick out where to change things in the next two steps to get another directory to work, just replace mentions of " /usr/local/iraf" with your preferred choice.

  3. Download the IRAF packages you are going to need from the Hectospec data reduction software page. The IRAF packages you need to install include
    1. Hectospec (Version 3.5.6 or later): http://tdc-www.harvard.edu/instruments/hectospec/hectospec-3.5.6.tar.gz
    2. MSCRED (Version 4.3 or later): http://tdc-www.harvard.edu/instruments/hectospec/mscdb-4.3.tar.gz
    3. RVSAO (version 2.6.5 or later): http://tdc-www.harvard.edu/iraf/rvsao/rvsao-2.6.5.tar.gz
    4. WCSTools (Version 3.7.0 or later): http://tdc-www.harvard.edu/software/wcstools/wcstools-3.7.5.iraf.tar.gz
    5. SVDFit (Version 1.9.2 or later): http://tdc-www.harvard.edu/iraf/svdfit/svdfit-1.9.2.tar.gz

    You should unpack each of these downloads in the /usr/local/iraf directory.

  4. Edit the list of external packages IRAF knows about to be aware of these new packages. Start by opening IRAF's extern.pkg file:
       cd $hlib
       cp extern.pkg extern.pkg.###### (where ###### is the date)
    
    Now open the extern.pkg file in a text editor and make the following changes:
    1. If you are using the Scisoft OSX IRAF installation, edit the rvsao lines to point to your newly downloaded rvsao package.
         reset   rvsao           = /usr/local/iraf/rvsao-2.6.5/
         task    rvsao.pkg       = rvsao$rvsao.cl
          
      and edit the
          #reset	mscdb		= /iraf/extern/mscdb/    
      to read
          reset	mscdb		= /usr/local/iraf/mscdb-4.3/    
      If you are not using Scisoft OSX, just edit the file to include these lines.

    2. Add the remaining package lines (or edit them if they exist already)
         reset   svdfit          = /usr/local/iraf/svdfit-1.9.2/
         task    svdfit.pkg      = svdfit$svdfit.cl
      
         reset   wcstools        = /usr/local/iraf/wcstools-3.7.5/
         task    wcstools.pkg    = wcstools$wcstools.cl
      
         reset   hectospec       = /usr/local/iraf/hectospec-3.5.6/
         task    hectospec.pkg   = hectospec$hectospec.cl
           
      To make the help files available, edit the 'helpdb' path at the end of the extern.pkg file:
         reset	helpdb		= "lib$helpdb.mip\
      			  ,noao$lib/helpdb.mip\
      			  ,nlocal$lib/helpdb.mip\
      			  ,mscred$lib/helpdb.mip\
      			  ,ctio$lib/helpdb.mip\
      			  ,stsdas$lib/helpdb.mip\
      			  ,vol$lib/helpdb.mip\
      			  ,tables$lib/helpdb.mip\
      			  ,color$lib/helpdb.mip\
      			  ,nmisc$lib/helpdb.mip\
      			  ,fitsutil$lib/helpdb.mip\
      			  ,gemini$lib/helpdb.mip\
      			  ,guiapps$lib/helpdb.mip\
      			  ,taxe16$lib/helpdb.mip\
      			  ,wcstools$lib/helpdb.mip\
      			  ,rvsao$lib/helpdb.mip\
      			  ,svdfit$lib/helpdb.mip\
      			  ,hectospec$lib/helpdb.mip\
      			  "
      That last quoteby itself on the last line is important. Also, make sure there are no spaces after the "\" on each of those lines or you will get an error when you launch IRAF that looks something like the following:
      ERROR: Newline while processing string
           called as: `cl ()'
           called as: `cl ()'
           called as: `cl ()'
         Error while reading login.cl file - may need to rebuild with mkiraf
         Fatal startup error.  CL dies.
  5. Compile all the IRAF Packages you just downloaded. You will need to launch IRAF (via 'cl' or 'ecl') and then compile all the IRAF packages you just downloaded.

    WARNING for 64-bit Linux users: If you are running 64-bit Linux, you will need to make sure to use the 32-bit compilers within IRAF. Assuming you have set up IRAF properly, you will need to set it to use 32-bit via the following. First go to the $hlib directory:

    cd $hlib (should kick you to something lilke /scisoft/share/iraf/iraf/unix/hlib or something like that)

    examine the mkpkg.inc file, it has a bunch of settings for the compiler and linker, the key is to modify the ones run under your brand of linux (Fedora Core is "redhat" here), edit to add "-m32" to the XFLAGS and LFLAGS so they look something like this:

    $set XFLAGS = "-c -w -m32" # default XC compile flags
    $set XVFLAGS = "-c -w" # VOPS XC compile flags
    $set LFLAGS = "-Nz -m32" # default XC link flags


    1. RVSAO (version 2.6.5 or later):To compile RVSAO, just do the following within IRAF:

      cd rvsao
      mkpkg macintel
      (replace macintel with macosx if PPC mac, redhat with Fedora Core Linux)
      mkpkg update

      If you get no nasty error messages, everything has compiled and you are set.

    2. WCSTools (Version 3.7.0 or later): To compile WCSTools, just do the following within IRAF:

      cd wcstools
      mkpkg macintel
      (replace macintel with macosx if PPC mac, redhat with Fedora Core Linux)

      64-bit Linux user warning: Before continuing to the next step, edit the CFLAG line in Src/Makefile to add the "-m32" flag to the end of CFLAG so that the compiled binaries are 32-bit.

      mkpkg update

      If you use WCSTools 3.7.0 through 3.7.3, this command will likely choke at the very end when all the packages are compiled with an error message starting

      Lnkbins: Command not found

      Linkbins is a script in the Src/ subdirectory, so just type (in IRAF):

      !./Src/Linkbins

      and it should create all the symbolic links it needs in the bin/ subdirectory.

    3. SVDFit (Version 1.9.2 or later): To compile SVDFit, just do the following within IRAF:

      cd svdfit
      mkpkg macintel
      (replace macintel with macosx if PPC mac, redhat with Fedora Core Linux)
      mkpkg update

      If you get no nasty error messages, everything has compiled and you are set.

    4. Hectospec (Version 3.5.6 or later): To compile Hectospec, just do the following within IRAF:

      cd hectospec
      mkpkg macintel
      (replace macintel with macosx if PPC mac, redhat with Fedora Core Linux)
      mkpkg update

      If you get no nasty error messages, everything has compiled, then you have to do one more thing. Hectospec needs to wants its own link to the apextract executable, so you need to place a symbolic link to it in the binary directory of the hectospec package. OUTSIDE of IRAF, do the following from the command line:

      cd /usr/local/iraf/hectospec-3.5.6/bin

      [on MacIntel with Scisoft OSX installed]
      ln -s /scisoft/all/packages/iraf/irafbin/noao.bin.macintel/x_apextract.e .

      [on PPC Mac with Scisoft OSX installed]
      ln -s /scisoft/iraf-2.12.2/irafbin/noao.bin.macosx/x_apextract.e .

      [on Linux box with ESO Scisoft Linux 7.1 installed]
      ln -s /scisoft/share/iraf/irafbin/noao.bin.redhat/x_apextract.e .

      [on other versions of IRAF]
      Find the irafbin/ directory, then place a symbolic link to the the noao.bin/*/x_apextract.e executable in the hectospec/bin directory.

At this point, assuming everything has worked, you have all the IRAF utilities you will need to run SPECROAD external installed. Now all you need to do is install some command line programs.

  1. Download some command line utilities used by Hectospec.
    1. kfunc:These are some time-manipulation scripts used by SPECROAD. Just download kfunc.tar.gz and in the same directory type:

      tar -C /usr/local -xzvf kfunc.tar.gz


      This will unpack the contents into /usr/local/kfunc. I am assuming you have permission to write to /usr/local, if you don't, fix this before proceeding.

    2. mktime: Download mktime.tar.gz (CFA mirror) and compile it. This contains some other time-manipulation scripts used by SPECROAD. To compile mktime, go to that directory you downloaded the tarball into and in the command line type:

      tar -xzvf mktime.tar.gz
      cd mktime-2.3
      ./configure
      make
      make tests


      And if no errors are reported,

      make install

      Once you have done this, the "mktime" executable is placed in /usr/local/bin and the manpage is placed in /usr/local/man/man1/.

    3. starbase: Download starbase 3.3.9 or later (I used 3.3.9 in this example) and unpack it to /usr/local by going to the directory where you downloaded the tarball and typing:

      tar -C /usr/local -xzvf starbase3.3.9.tar.Z

      Before you try to compile the code, you need to be aware of a couple of things. Starbase is a custom database package the SPECROAD scripts use (it manipulates databases stored as ASCII). Starbase requires you to have previously installed the C version of the SLAlib positional astronomy library from TPoint Software. This library is proprietary, but available for free for non-commercial use by contacting Pat Wallace (ptw@tpsoft.demon.co.uk). Once you have SLAlib installed, go to the directory you have unpacked the command line (assuming you use tcsh) do the following:

      Tell starbase where the SLAlib libraries and headers are located. I have them in /usr/local, so:

      setenv SLALIB /usr/local/lib/
      setenv SLAINC /usr/local/include/


      (you can also do this in your .tcshrc file, which is what I do).

      Making sure your environment is properly set, you can now compile starbase.

      cd /usr/local/starbase3.3.9
      ./configure --prefix=/usr/local/starbase3.3.9
      make
      make install


      Linux Note: If the install fails on a Linux box, make sure you have bison installed.

      Now, there is an issue (at least in starbase3.3.9) where the slalink shared library portion of starbase doesn't get built properly, so you need to do the following:

      cd /usr/local/starbase3.3.9/slalink
      make slalink.so
      cp slalink.so ../lib


      That will create the shared libary that is called by the starbase program "tawk" in the E-SPECROAD scripts. Once you are done with this, create a symbolic link from /usr/local/starbase to /usr/local/starbase3.3.9 via the command line

      ln -s /usr/local/starbase3.3.9 /usr/local/starbase

      The E-SPECROAD scripts look in /usr/local/starbase for some of the starbase binaries.

      A Quick Note of Thanks to John Roll at SAO who fixed up the starbase code to compile under MacOS 10.5 on Intel Macs.

  2. Tweak your command line environmental settings to be aware of all this code you installed. I modified my .tcshrc file to include the following:

    # Setup all local Apps I use
    setenv PATH ${PATH}:/usr/local/bin

    # Setup IRAF environment (Mac specific)
    setenv XC_F77 g77
    setenv XC_FFLAGS "-fugly-logint"

    # Setup IRAF environment
    setenv UPARM ~/iraf/uparm/

    # Setup SLALib
    setenv SLALIB /usr/local/lib/
    setenv SLAINC /usr/local/include/

    # Setup SAO's environmental variables commands
    setenv PATH /usr/local/starbase/bin/:${PATH}
    setenv PATH ${PATH}:/usr/local/hectoshell/
    setenv TABLELIB /usr/local/starbase/lib/


    I like to place the starbase bin/ directory at the start of the PATH because 'column' is a common executable name and I really want starbase's version of column to be used.

    I should also note I have my IRAF settings in a subdirectory of my home directory called 'iraf'. SPECROAD will need to know about where the IRAF parameters are stored, so the UPARM line points to the uparm subdirectory of my personal IRAF directory. Also, /usr/local/hectoshell is where I keep the SPECROAD code, so I have added that to the path above.

    WARNING for Linux Users: The above "XC_*" environmental variables should only be set on the Mac and NOT under Linux. Linux will use the f2c compiler within IRAF. Linux users should still set up UPARM to point to their local IRAF parameter directory.

Installing E-SPECROAD Itself

OK, you have done most of the hard work if you have gotten this far, at this point, getting E-SPECROAD working on your machine should be fairly staightforward.

  1. Install the E-SPECROAD scripts directory (called hectoshell). Start by downloading the following tarball (if more than one is listed, pick the one that makes the most sense):


    Unpack this directory into /usr/local/hectoshell by going to the directory where you downloaded the tarball and typing (if , for example, you downloaded hectoshell_MacOSX_20080807.tgz):

    tar -C /usr/local -xzvf hectoshell_MacOSX_20080807.tgz

    Hint: As you may have guessed from the filenames, one version of the hectoshell code is aimed at MacOS X and the other Linux (specifically, Fedora Core Linux with /bin/ksh installed and ESO Scisoft Linux 7.1 version of IRAF installed).

  2. Change the E-SPECROAD scripts to make them work for you. First things first, E-SPECROAD is NOT 100% portable in that just unpacking it is not enough. However, the modifications you may need to perform to get E-SPECROAD running should be fairly minor.
    1. Make sure that all references to 'ksh' point to your version of ksh. Since I am using the MacPorts installed version of ksh, all the ksh scripts in the Macintosh version of the hectoshell start with the line

      #!/opt/local/bin/ksh


      (The Linux version has this set to #!/bin/ksh). A good text editor with multi-file search and replace capability (TextWrangler is an example of a free program on the Mac with this capability) should allow you to edit this realtively quickly.
    2. Make sure all the scripts that call IRAF point to the proper ecl executable. Since I am using /scisoft on an Intel-based Macintosh, The Mac version of these scripts start with the line

      #!/scisoft/all/packages/iraf/irafbin/bin.macintel/ecl.e -f

      The linux versions assume ESO Scisoft Linux 7.1 is installed and start with

      #!/scisoft/share/iraf/irafbin/bin.redhat/ecl.e -f

      Again, a good search and replace of this with a link to the version of ecl you are using should be sufficient.

  3. You should now have a functioning version of E-SPECROAD running on your computer. Please send a short email to if you get a successful installation (or not).


(*) Installing ESO Scisoft Linux 7.1 on Fedora Core 9: To get ESO Scisoft Linux 7.1 installed under Fedora Core 9 I had to "force" the install of the rpms. Once that was done, it just became a challenge of finding all the right libraries (the hard one was the obsolete libtermcap) to allow the SCisoft installation of IRAF to run under Fedora Core 9. That done, IRAF just fine).



Funding: The creation of E-SPECROAD was supported by National Science Foundation Grant AST-0729989 ("RUI: Collaborative Research to Map the Asymmetric Thick Disk").


Copyright © 1995 - 2008 Juan Cabanela
Minnesota State University Moorhead | 1104 7th Ave South, Hagen 307B | Moorhead, MN 56563 USA | 1.218.477.2453
a member of the minnesota state colleges and universities system (mnscu)
mission | an equal opportunity educator and employer | accessibility questions? | contact Juan Cabanela | Last Updated
08/22/08