Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Installing Python 2.5.1 (built against tcltk 8.4) for Linux

Download Python

  1. Download Python 2.5.1 from
  1. http://www.python.org/download/

...

  • Create a directory such as rh9_gcc32 (or cd into the directory corresponding to OS and gcc version for which you want to install python, such as rhel4_gcc34 )

...

  1. releases/2.5.1

...

  1. /
  2. Unzip and change to the directory of the unpacked archive, E

...

  1. .g.,

...

    ...

      • tar -

    ...

      • zxvf  Python-2.5.1.tgz

    ...

      • cd Python-2.5.1
    1. *Run, "

    ...

    1. ./configure --prefix=

    ...

    •  Where <Installation Location> is the full path to *<OS_gccVersion>/<python version>/gcc<compiler version>*

    ...

    1. <installation directory>":
        • ./configure --prefix=/afs/slac/g/glast/ground/GLAST_EXT

      ...

        • /redhat4-i686-32bit/python/2.5.1

      ...

        • -gl1/gcc34/ 
      1. Edit the file, "Setup," in the "Modules" directory, "Modules/Setup"
        • Enable zlib (Uncomment the line corresponding to "zlib")
        • To build Python against tcltck 8.4, there are three lines to edit in the file (I would suggest searching for "_tkinter" in the Modules/Setup file, then following the documentation)
          1. Enable tkinter, by Uncommenting the line "_

      Do a Standard Build 

      • Run
        1. make
        2. make install

      Do Custom Build Python against an arbitrary version of tcl/tk

      After running 'configure,' in the same directory, there will be a file created in the Modules directory, named "Setup:" Modules/Setup. 

      1. Edit the file, "Modules/Setup"
        • There will be 4 relevant lines in this file that you have to edit.  They look like this:
        • *# *** Always uncomment this (leave the leading underscore in!)*:
           __
          1. tkinter _tkinter.c tkappinit.c -DWITH_APPINIT
          {_}
          # ***{*}
          1. "
          {*}
          1. Uncomment and edit to reflect where your Tcl/Tk libraries are
          {*}:
                 -L/usr/lib{{color:#000000}}
          # ***
          1. , example
            • "-L/afs/slac.stanford.edu/g/glast/applications/heasoft/PROD/tcltk/i686-pc-linux-gnu-libc2.3.2/lib"
          1. Uncomment and edit to reflect where your Tcl/Tk headers are
          {*}:
                 -I/usr/include {{color:#000000}}
          # ***
          1. Uncomment and edit to reflect your Tcl/Tk versions
          :
                 -ltk8.4 -ltcl8.4 {{color:#000000}}
          # ** IMPORTANT{*}- setup the
          1. are
      2. Run
        • make
        • make install

      * Step 3 must be done before 4.   Running, "./configure," generates the file Modules/Setup 

      While running "make", if you run into any problems finding tcl8.4 or tk8.4 libraries, try setting the environment variable, LD_RUN_PATH

      ...

      to point to the location of the

      ...

      tcltk libraries:
      make clean
      setenv LD_RUN_PATH <Location of tcltk libraries>
      make
      make install
      unsetenv LD_RUN_PATH 

      Installing Python 2.5.1 (built against tcltk 8.4) for Windows

      By default, tcl/tk version 8.4 ships with Python 2.5.1 for Windows so just go through the installation process.

      1. Download the appropriate python2.5.1 msi file for your windows architecture http://www.python.org/download/releases/2.5.1/
      2. Using command.exe, enter the following command
        • if installing on a network drive
          • msiexec /a <python-msi-path>/python-2.5.1.msi ALLUSERS=1 TARGETDIR=<installation director
        • Example, to install python in "V:\Glast_Software\Toaster\GLAST_EXT\Windows-i386-32bit\python\2.5.1-gl1\vcc71" logged in on glast06, enter
      3. <Library Location>*
        • e.g., setenv LD_RUN_PATH/usr/lib
      4. Run make
        • make
      5. ** Unset the LD_RUN_PATH environment varible{*}
        • unsetenv LD_RUN_PATH
      6. Run
        • make install
          •  msiexec /a V:\Glast_Software\Toaster\GLAST_EXT\VC8\python\python-2.5.1.msi ALLUSERS=1 TARGETDIR="V:\Glast_Software\Toaster\GLAST_EXT\Windows-i386-32bit\python\2.5.1-gl1\vcc71"