Ptolemy NT Installation

The Ptolemy NT Installation is more tricky than it should be, we hope to fix this soon.

Quick nt4 Installation Instructions

This section is for people that don't like to read instructions.
If you have problems, see the detailed instructions below.
  1. Download and install Cygnus GNU-win32 b20.1
  2. Download and install gcc-2.95 from ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin/gcc-2.95/
  3. Download and install X11 for Cygwin from http://www.xemacs.freeserve.co.uk/
  4. Start up bash, and complete the following steps
    mkdir /tmp /bin /etc
    cp /Cygnus/cygwin-b20/H-i586-cygwin32/bin/bash.exe /bin/sh.exe
    cp /Cygnus/cygwin-b20/H-i586-cygwin32/bin/bash.exe /bin/bash.exe
    cp /Cygnus/cygwin-b20/H-i586-cygwin32/bin/rm.exe /bin
    mkpasswd -d -l -g > /etc/passwd
    mkgroup -d -l > /etc/group
    
    (/bin/bash.exe is used when we load a star)
  5. Set the following variables in the System Control Panel
    DISPLAY localhost:0.0
    PTOLEMY /users/ptolemy
    PTARCH nt4
    CC gcc
    
    Your PATH should include %PTOLEMY%\bin;%PTOLEMY%\bin.nt4
  6. If you have not yet done so, download the Ptolemy src and other.src tar files from http://ptolemy.eecs.berkeley.edu/ptolemyclassic/pt0.7.2/download.htm and then use GNU tar to extract the files.
    Do not use Winzip to extract the tar files. These tar files contain Cygwin symbolic links, which Winzip cannot handle.
  7. In a bash shell, do
    cd $PTOLEMY
    make -k ntbuild >& make.out &
    

Detailed nt4 Installation Instructions

This section covers the installation in more detail.
  1. Download Cygnus GNU-win32 b20.1 from ftp://go.cygnus.com/pub/sourceware.cygnus.com/cygwin/
  2. README
  3. Download full.exe (14Mb)
  4. Install Cygnus GNU-win32 by mousing on the full.exe icon. It is best if you install Cygnus GNU-win32 in a directory that does not have spaces in the pathname. Usually GNU-win32 is installed in the top level, so it ends up in c:/Cygnus. Be sure to update your path and the other variables mentioned in the Cygnus README file.
  5. Be sure to do mkdir /tmp
  6. Copy the bash.exe binary to /bin/sh.exe for use from make:
    mkdir /bin
    cp /Cygnus/cygwin-b20/H-i586-cygwin32/bin/bash.exe /bin
    
    It is possible to use the vanilla sh.exe rather than using bash.exe, but make has subtle problems with the sh.exe. Another problem is that pigi uses csh style syntax to exec subprocesses in a few places, and csh style syntax is not supported by the vanilla sh.exe, but it is supported by bash.exe. For more information, see Loading a star fails.

    Since the Xgraph stars and various scripts use /bin/rm you should also do:

    cp /Cygnus/cygwin-b20/H-i386-cygwin32/bin/rm.exe /bin
    
  7. Currently, xv does not build properly. You can download a version of xv from ftp://linc.cis.upenn.edu/pub/xv/xv-3.10.NTbin.tar.gz If you plan on trying to compile xv, copy the file gcc.exe from Cygnus/cygwin-b20/H-i386-cygwin-32/bin to /bin and rename it to cc.exe. Otherwise you will get problems while trying to compile xv.
  8. Create /etc/passwd and /etc/group by running
    mkdir /etc
    mkpasswd -d -l -g > /etc/passwd
    mkgroup -d -l > /etc/group
    
    For more information, type mkpasswd and mkgroup without any arguments. The Cygwin faq also covers these programs. If you do not have /etc/passwd, then you will get errors from GetTildePath() when trying to create an icon. (Reported by Sascha Schwarz <s_schwa@informatik.uni-kl.de>)
    The -d option will include all the users in the domain. Tim Kurzweg <tim@ee.pitt.edu> reports that mkgroup sometimes not place the user administrator in the administrator group.
  9. Download and install gcc-2.95 for b20 from ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin/gcc-2.95/
  10. Download X11 for b20 from http://dao.gsfc.nasa.gov/software/grads/win32/X11R6.3/
    Below are other possibilities:
  11. http://www.xemacs.freeserve.co.uk/
  12. Cygwin links to software ports
  13. X11 for b19, b20 ftp://www.lexa.ru/pub/domestic/sos/ports/
  14. X11 for b19http://dao.gsfc.nasa.gov/software/grads/win32/X11R6.3.
  15. Install X11R6.4:
    mkdir /usr
    cd /usr
    tar -xf /tmp/B20_X11R6_4_tar.gz
    
  16. Install an X server. The Pre-compiled X11R6.3 Libraries/Clients For GNU Win32 B19 page has some pointers to freely available X servers. Locally we use Hummingbird's Exceed, which is a commercial X server package.
  17. Add c:\usr\X11R6.4\bin to your path by using the System control panel.
  18. Verify that the X installation is working by starting up an X server setting your DISPLAY:
    DISPLAY=localhost:0.0
    export DISPLAY
    
    and then running /usr/X11R6.4/bin/xclock.
  19. To use the Java version of pxgraph, download JDK1.1. The JDK should be installed in c:/jdk1.1.n and you will need to update your path to include c:/jdk1.1.n/bin
    For a prebuilt X11 pxgraph binary, see: ftp://ptolemy.eecs.berkeley.edu/pub/misc/pxgraph/index.html

Building Ptolemy

  1. Since Ptolemy has lots of small files, you are better off avoid FAT partitions and placing the sources on a NTFS partition.
  2. If you have not yet done so, download the Ptolemy src and other.src tar files from http://ptolemy.eecs.berkeley.edu/ptolemyclassic/pt0.7.2/download.htm and then use GNU tar to extract the files.
    Do not use Winzip to extract the tar files. These tar files contain Cygwin symbolic links, which Winzip cannot handle.
    Note that Ptolemy 0.7.1p1 and earlier had problems with problem with $PTOLEMY/colors/ptolemy/con and file names that contained percent characters. These problems have been fixed in 0.7.2devel
    If you are using tar and you get a warning like
    bash-2.02$ tar -zxf /tmp/pt0.7.2devel.src.tar.gz
    tar: ptolemy/tcltk/tcl/man/mann/Toplevel.n: Could not create file: Permission denied
    tar: ptolemy/tcltk/tcl/man/mann/optionmenu.n: Could not create file: Permission denied
    tar: ptolemy/tcltk/tcl/man/mann/messagebox.n: Could not create file: Permisson denied
    tar: Error exit delayed from previous errors
    
    These errors occur because of case sensitivity problems. The files that are reported as errors are only different by case. For example:
    /users/ptolemy/tcltk/tcl/man/mann/Toplevel.n
    /users/ptolemy/tcltk/tcl/man/mann/toplevel.n
    
    In the short term, you can ignore the above errors.
    If you do not have enough space for Ptolemy on your disk, you may be able to use the Cygwin mount command to mount a disk with enough space.
  3. You may need to do:
    cd $PTOLEMY
    chmod -R a+w .
    chown -R yourlogin .
    
    Where yourlogin is your NT login, which should also be present in /etc/passwd, which was created in the mkpasswd step above.

    The chown works around a problem where the configure scripts have problems with the write permissions on directories. If you don't chown the tree, then you may see messages like

    not updating unwritable cache config.cache.
    
    We are not sure of the cause of this problem, hopefully it will be fixed in a future release.
  4. Building Itcl, Octtools and Ptolemy will require about 470Mb of space for the sources, build directories and installation directories. To save space, you can build and install Itcl and Octtools separately and then do
    rm -rf $PTOLEMY/obj.nt4/tcltk $PTOLEMY/obj.nt4/octtools
    
  5. Set up your environment by setting the variables below. In the Start menu, select Settings, then Control Panels, then System, then select the Environment tab
    The values of PTOLEMY and PTARCH should follow these conventions:
  6. The value should not contain a colon ':'. For example, D:/users/ptolemy is incorrect.
  7. Do not use multiple slashes.
    For example, //D/users/ptolemy is incorrect.
  8. The values to set are:
    PTARCH nt4
    PTOLEMY /users/ptolemy
    CC gcc
    
    In the NT System Environment control panel, set your PATH to include
    %PTOLEMY%\bin;%PTOLEMY%\bin.nt4
    
    Note that if you are setting variables directly in bash, then you should not use the DOS %foo% syntax, instead use $foo.
  9. If you have Samba setup, then start up bash and cd to the tree with something like:
    mkdir /users/ptolemy
    mount //UnixHost/ptolemy /users/ptolemy
    cd $PTOLEMY
    

    Now you have three ways to get to the sources using Samba:

    1. Mount a Ptolemy tree located on Unix machine with the Run Start menu choice.
    2. cd to the UNC, such as cd //carson/ptdesign
    3. cd to the Cygwin mount point: cd /users/ptolemy
    Note that there are two ways to run Tycho, via the native Windows itkwish or via the Cygwin32 itkwish. The Windows itkwish does not understand Cygwin32 mount points, but the Cygwin32 version does.

    Note that you can set PTOLEMY to the raw UNC format //UnixHost/ptolemy, but if you do, you will have problems with configuring Itcl. Instead use the mount command as above.

  10. To do the actual build, do
    cd $PTOLEMY
    make -k ntbuild >& make.out
    
    Note that the ntbuild rule builds everything but xv and the GNU tools.
  11. You can safely ignore the following warnings and errors:
  12. Ignore the warning:
    touch: /users/ptolemy/obj.nt4: Permission denied
    
  13. While building Itcl, you may see warnings like:
    checking host system type... Invalid configuration
    `i586-CYGWIN32-NT40': system `NT40' not recognized
    
    
  14. Ignore warnings from X11R6 files of the form:
    type defaults to `int' in declaration
    
  15. octtools/Xpackages/iv fails to compile You can ignore this error.
  16. xv fails to build In the short term, you can ignore this error.
  17. If you create a shortcut, you may want to use the Mr. Ptolemy icon from $PTOLEMY/tycho/doc/img/ptolemy.ico
  18. If you have problems, try Ptolemy NT Hints and Ptolemy NT Bugs Also, my NT and Ptolemy page might be of use.

Some of the notes above are from Saschas Schwarz, <s_schwa@informatik.uni-kl.de>
Up to the Ptolemy under NT page - Back to Ptolemy NT Bugs
Copyright © 1997-1999, The Regents of the University of California. All rights reserved.
Last updated: 10/26/99, comments to: cxh at eecs