Appendix 2:
Installing the Supporting Packages
Some of the packages require IRAF to be present on the system. IRAF
installation is not discussed in this document. IRAF is maintained by the
iraf group at NOAO. For installation instructions or problems, see
http://www.iraf.net.
Note: A full installation of the supporting packages is needed, including
libraries and header files. On some operating systems the header files may
be in a separate package. For example onRedhat they are in the corresponding
"devel" rpm package.
If installation from source is necessary, on most systems the following will
work:
To unpack a source file:
% gunzip
package.tar.gz
% tar -xvf package.tar
ยท To configure and build a package:
% cd
package
% ./configure
--prefix=<installation-directory>
%
make
% make install
This will create directories bin, lib, include under
<installation-directory>. The option "--prefix=" in the above
"./configure" command may be omitted for installations in /usr/local.
If you install any of these packages in a personal directory, you will most
likely need to change two environment variables:
setenv LD_LIBRARY_PATH
<installation-directory>/lib:$LD_LIBRARY_PATH
setenv PATH
<installation-directory>/bin:$PATH
or set them
setenv LD_LIBRARY_PATH
<installation-directory>/lib
setenv PATH
<installation-directory>/bin
Tcl/Tk
It is very likely that Tcl and Tk are already installed on your system. Look
in the system directories for files like libtcl.* and libtk.*. PythonTcl/Tk
v8.3 or later.
If you have to build these packages from source, build them as shared
libraries. On most systems the following set of commands will work for Tcl
and Tk:
% cd
tcl8.3.5/unix
% ./configure --enable-shared
--prefix=<installation-directory>
%
make
% make
install
Readline
Readline is probably already installed on your system. Make sure the header
files are installed as well. A possible location to look for them is
/usr/include/readline. In case you need to install Readline in your personal
directories, the following commands will install it on most systems:
% cd
readline
% ./configure
--prefix=<installation-directory>
%
make
% make install
Python
Source Installation: Python is available from the python web site at
http://www.python.org/
. If Tcl/Tk and Readline libraries are on LD_LIBRARY_PATH or in a system
directory, the next three commands are usually sufficient to install Python
from source:
% cd
python
% ./configure
--prefix=<installation-directory>
%
make
% make install
To test whether your Python installation has all required modules enabled,
try to import the modules as described in Section 1.0.
To build Tkinter, you may need to edit the file Modules/Setup in the Python
source distribution, to let Python know where Tcl/Tk and X11 libraries are.
Below is an example of this section of the Setup file on Solaris. Note, that
some lines are uncommented and the paths on your system may be different.
# The _tkinter
module.
#
# The command for _tkinter is long
and site specific. Please
# uncomment and/or edit those parts
as indicated. If you don't have a
# specific extension (e.g. Tix or
BLT), leave the corresponding
line
# commented out. (Leave the trailing
backslashes in! If you
# experience strange errors, you may
want to join all uncommented
# lines and remove the backslashes --
the backslash interpretation is
# done by the shell's "read" command
and it may not be implemented on
# every
system.
# *** Always uncomment this (leave
the leading underscore in!):
_tkinter _tkinter.c tkappinit.c
-DWITH_APPINIT \
# *** Uncomment and edit to reflect
where your Tcl/Tk libraries are:
-L/usr/local/lib
\
# *** Uncomment and edit to reflect
where your Tcl/Tk headers are:
-I/usr/local/include
\
# *** Uncomment and edit to reflect
where your X11 header files are:
# -I/usr/X11R6/include
\
# *** Or uncomment this for
Solaris:
-I/usr/openwin/include
\
# *** Uncomment and edit for Tix
extension only:
# -DWITH_TIX -ltix8.1.8.2
\
# *** Uncomment and edit for BLT
extension only:
# -DWITH_BLT
-I/usr/local/blt/blt8.0-unoff/include -lBLT8.0
\
# *** Uncomment and edit for PIL
(TkImaging) extension only:
# (See
http://www.pythonware.com/products/pil/ for more
info)
# -DWITH_PIL
-I../Extensions/Imaging/libImaging tkImaging.c
\
# *** Uncomment and edit for TOGL
extension only:
# -DWITH_TOGL togl.c
\
# *** Uncomment and edit to reflect
your Tcl/Tk versions:
-ltk8.3 -ltcl8.3
\
# *** Uncomment and edit to reflect
where your X11 libraries are:
# -L/usr/X11R6/lib
\
# *** Or uncomment this for
Solaris:
-L/usr/openwin/lib
\
# *** Uncomment these for TOGL
extension only:
# -lGL -lGLU -lXext -lXmu
\
# *** Uncomment for AIX
\
# -lld
\
# *** Always uncomment this; X11
libraries to link with:
-lX11
libf2c
Note: The libf2c package at
http://www.stsci.edu/resources/software_hardware/pyraf/support_stsci_python
supports all platforms on which stsci_python is supported. We recommend
installing it.
If a source installation is needed, download the package from our web site.
It is needed only at compile time but it is worth installing it permanently
on the system for future upgrades of stsci_python. The following commands
will build it:
% tar xvf
libf2c.tar
% cd
libf2c
% make -f
<makefile.os>
Substitute makefile.os with the correct makefile for your operating system.
For example for 64 bit linux operating systems use:
% make -f makefile.linux64
After building libf2c the two files that are needed, f2c.h and libf2c.a,
will be located in the source directory. They can be moved to a permanent
location. For example they can be copied to /usr/local/libf2c in which case
this directory should be used for building stsci_python.
Urwid
Urwid
can be installed optionally. It is needed for support of tpar (a text
based epar) in PyRAF. It can be installed by :
% python setup.py
install
Ipython
Ipython
can be installed optionally as well. If available PyRAF can run in
the Ipython interpreter (pyraf --ipython). To install Ipython, execute the
command:
% python setup.py
install