BNL HET, NT, & RBRC Theory: Software

The following is information about software available on workstations. For information about getting into and out of our machines, please look here

If you are reading this you undoubtedly know how to browse the world wide web. From your workstation the best way to do that is to use netscape or mosaic. Both programs have versions to run under Xwindows, Macintosh, or Windows.

If you are traveling or at home, you can still explore the web from almost any terminal by connecting to one of our workstations and using lynx. This is particularly useful from remote places with slow access.

For other browsers see here.


All the Theory Group workstations use a common NIS (Yellow Pages) password file and NFS-mounted file system, so you can login to any of them and create files in your directory.

Software


Editors

The standard unix editor is "vi". This is always available on any machine, but is not very flexible.

The most powerful unix editor which is commonly available is "emacs". The principal virtues are that it allows for multiple windows and one can read (and save) mail from within emacs. Version 19 has some X support, with mouse driven commands.

A variant of emacs is "xemacs". Its interface has many mouse driven features which are integrated into Open Windows. It has several mail readers, of which "vm" is especially useful.

You might also try "jove", a light-weight version of emacs.


TeX

TeX, LaTeX, and TeXsis should work on all machines.

For previewing a dvi file, you can use xdvi; type ``xdvi name.dvi''.

Ghostview is the standard application for viewing postscript files. First turn ``name.dvi'' into a postscript file by ``dvips name.dvi -o''. This creates ``name.ps'', which can be viewed by ``ghostview name.ps''.

A newer viewer is gv, which is installed on quark, and which is preferable. Notably, with gv the down arrow key brings one down the page, and does not flip the page upside down, as with ghostview. To use, type ``gv name.ps''

The epsf package is good for incorporating figures and color text into your document. See the dvips documentation for details.

To write a letter with a BNL/BSA letterhead, use this letter.tex as a sample. It must be processed with TeXsis, a local TeX macro package that is installed on all of the HET/NT computers. After writing the letter, do "texsis file.tex", then print as usual. The result should look something like this letter.ps. See Section 10 of the TeXsis manual for additional information.

To write a letter with a RIKEN/BNL letterhead, use this rikenletter.tex as a sample. It must be processed with TeXsis. The result should look something like this rikenletter.ps. The RIKEN/BNL letterhead is available only on quark.

The command "tf" will take a filename as an argument, try to decide if it is tex, latex, or texsis, and process it through to displaying it on your X window with either ghostview or gv.


Compilers

The Sun f77 (Fortran), cc (ANSI C), and CC (C++ Version 6) compilers are supplied by CCD and are located in /opt/SUNWspro/bin on quark.phy.bnl.gov and on several of the older Suns. The C++ compiler now supports ANSI C++.

The GNU g77 (Fortran), gcc (ANSI C), and g++ (ANSI C++) compilers are located in /usr/local/bin on quark.phy.bnl.gov. They were compiled for Solaris 2.6 using the egcs-2.91.66 release, so they will not work with older versions of Solaris. The same release is contained in RedHat Linux 6.0. Support for debugging Fortran with gdb is poor.


Printing

All the Theory Group workstations use the HP LaserJet in the coffee room as their default printer. To print an ordinary or Postscript file on this printer, type ``lp name.ps''.

Please remember not to print a .dvi file. To print a postscript file from the .dvi, do "dvips name.dvi". To produce a postscript file from the .dvi, "dvips name.dvi -o" will produce "name.ps"; you can then print name.ps on a printer by "lp -d destination name.ps", where destination is the name of the printer.

Print queue: ``lpstat''. If you have a long job which isn't going to work, please kill it. Any long jobs should probably be printed in the back room, see ``Alternate printers'' below.

Killing print jobs: First find the process number by ``lpstat''. Then kill it by typing ``cancel lp-\#'', where "lp-\#" is the process number. Alternatively, ``cancel -u username'' should cancel all your print jobs.

Alternate printers:

The printer in the coffee room is not very fast, and should ONLY be used for short jobs, please!

For long papers, and really in general, the best printer is in the library. This is very fast, and automatically prints double-sided! Do "lp -dlibrary name.ps" or "lpr -Plibrary name.ps" to print the file "name.ps".

To use the Riken printer in Rm 2-40, do ``lp -drikenpr filename''.

You can also use the HP5si double-sided Postscript printer in 2-84 and the HP8550 Postscript printer in 1-87:
``lp -dphyhp1 filename'' for the HP5si printer
``lp -dphyhp2 filename'' for the HP8500
``lp -dphyhp2_c filename'' for the HP8500 (color)


Netscape

Netscape is the most powerful browser for the web. The following will help it run better. Under "Options", choose "Preferences".

Under "Window and link styles", your home page should be

thy.phy.bnl.gov/bnl.html
To be able to read news groups under Netscape, under ``Mail and News'' select:
News (NNTP) Server: news.bnl.gov
To help load pages faster, you should use the CCD proxy server, which provides a cache for the whole Lab. Go to ``Advanced'' under the ``Preferences'' menu. Then under ``Cache'' set the disk cache to 0 kBytes and under ``Proxies'' set
HTTP Proxy: httpproxy.bnl.gov Port: 8080
Also set no proxy for bnl.gov.

When you're done, choose ``Save Options''.


Mail and Labmail

In addition to Netacape mail and Emacs mail, we also have the standard Unix mail clients: mail, mailx, elm, and pine. (Elm and pine both work well over slow connections. Elm is nice because it allows you to select your own editor, but pine handles attachments better.)

To quote from the ITD page on Labmail:

"Labmail is the BNL system for providing a generic e-mail address for BNL employees. This system allows people to contact registered users through an address of the form username@bnl.gov, rather than using the final destination address." To sign up, go to the above link.

This system is most useful if you know with absolute certainty that your employment at BNL will never cease. If you are not certain of this, then you should be aware that under current policy, labmail is turned off the day after your employment is terminated, with no possibility of having your email forwarded to any other account.


Telnet and FTP

The Lab has blocked both outgoing and incoming Telnet and FTP (don't blame us). If possible, you should use ssh and/or scp; see the following section and the documentation on Mindterm. If you need Telnet or FTP to access an outside machine from within BNL, you can do so through a proxy, a computer which retransmits your request outside the firewall. For FTP, type
ftp ftpgw.sec.bnl.local
Once you are connected, type
quote site your.remote.ip.address
user remoteusername
and give your password when prompted. (Of course you should substitute the appropriate values for "your.remote.ip.address" and "remoteusername".) For Telnet, type
telnet tngw.sec.bnl.local
Once you are connected, type
open your.remote.ip.address
and login as usual.

Secure Shell (ssh)

We run Version 1 of Secure Shell (ssh) on quark, on our all Linux machines, and on many of our other computers. Whenever possible you should use ssh to login and scp to copy files. This will encrypt your login and so prevent your password or anything else from being sniffed even if another computer on the network is insecure. See the ssh and scp man pages for details. In addition to its security features, ssh automatically takes care of setting up the DISPLAY variable for X clients.

ssh-agent makes ssh even easier to use; it allows you to give a pass phrase once to identify yourself and then to login to remote machines without giving a password. Setting it up does require several steps:


Window Managers

The default window manager is CDE on quark and either KDE or Gnome on most of the Linux machines. All three are slow and cumbersome compared to fvwm, although they do offer some additional features. To change the default, you need to replace .dtprofile, .xinitrc, and/or .Xclients in your home directory with something like the following:
#!/bin/sh

if [ -f /usr/bin/X11/fvwm2 ] ; then
    if [ -f /usr/bin/ssh-agent1 ] ; then
        exec /usr/bin/ssh-agent /usr/bin/X11/fvwm2
    else
        exec /usr/bin/X11/fvwm2
    fi
elif [ -f /usr/local/bin/fvwm2 ] ; then
    if [ -f /usr/local/bin/ssh-agent1 ] ; then
        exec /usr/local/bin/ssh-agent /usr/local/bin/fvwm2
    else
        exec /usr/local/bin/fvwm2
    fi
elif [ -f /usr/local/bin/fvwm ] ; then
    exec /usr/local/bin/fvwm
fi
See the "Secure Shell" section for a discussion of ssh-agent.

CERN Program Library

Various versions of the CERN Program Library are located in /usr/local/cern on quark, qcd, bigbang, and several other machines. When linking with it on quark, it is sometimes necessary to add other system libraries, e.g.
f77 ... -L/usr/local/cern/pro/lib -lpacklib -lkernlib -lxnet -lnsl

Cernlib documentation is available from CERN. The RHIC Computing Facility has local copies, although these may be out of date.


Plotting

Gnuplot: Typing ``gnuplot'' will give you the ``gnuplot>'' prompt.

Type ``help'' for online documentation.

Control p (n) lets you flip back (forward) through the command history so you don't need to retype long lines.

The Physics Analysis Workstation from CERN, is also available; type ``paw''.

We also have Doug's program ``axis''.

Once you get used to the interface, ``xfig'' makes nice line drawings.


Mathematica: terminal mode

Mathematica 4.1 is available on quark.phy.bnl.gov. Both Mathematica 3 and Mathematica 4.01 are available on sun2.bnl.gov, which has faster processors and more memory but is more heavily used. In the following, I assume that you are running mathematica on machine "M".

The dumb but efficient way of using mathematica is to login to M and type

(or ``math401'' for version 4.01 on sun2). You can then work interactively.

For long jobs, you need an editor. There are two ways to proceeding, each a putz. The first is to edit a file separately with the editor of your choice, and then read ``filename'' in by ``In[1]:= < < filename'' in mathematica. This is good for long files, but awkward for single lines.

If you use emacs, you can do the following. On machine M, type ``emacs &'' to open a local window running emacs off of M. Then get into shell, ``M-x shell'', and whence into Mathematica. One can then use emacs commands in the Mathematica shell. If you use tcsh, bash, etc, you will find annoying characters such as control M at the end of each line. To avoid this, add the line "setenv ESHELL /bin/csh" to your .cshrc file.

Figures: See below on setting the DISPLAY variable if you want graphics. Plots in Mathematica will pop up a new window with the graph on your screen. To save it, type

Here n``filename'' follows unix conventions, except that one canNOT use ``~'' for home directory; you must save to, e.g., /home/you/file.ps and not ~you/file.ps. Graphics output is something like ``%'' or ``Out[1]''. With the current version of Mathematica, this does NOT generate standard postscript. To fix file.ps, you must do You can then print as usual by "lp fixed_file.ps".


Mathematica: X front end

There is a very nice front end for X-windows, which is started by typing The X front end will pop up on a new window on your screen. This is a "notebook" interface like that on the Macintosh. Gack.

Unlike Mathematica 2, both versions 3 and 4 can use the $DISPLAY variable properly. But they still need special fonts installed in the local X-server, i.e., in your desktop machine. This requires mounting the exported Mathematica directory on your local machine with the same name as it has on the remote machine.


Adobe Illustrator

Adobe Illustrator runs on penguin in single user mode. Please be sure to kill the process when you're done, as otherwise the single user mode will block others from using it. To start AI, type

/usr/local/adobe/Illustrator_5.5/bin/illustrator &

Adobe Illustrator allows you to draw and modify postscript files. To edit postscript files with AI, first type
ps2ai file.ps
and then run AI on the output, which is file.ai.

Within AI, files can be saved as "file.eps", which can then be used in LaTeX, etc.

One can generate adobe figures within Mathematica, and then edit them with AI.

To draw Feynman diagrams directly with AI, use the sample files from FeynDiagram (/usr/local/src/FeynDiagram/Examples), convert to .ai format as above, and then use in AI.


Sketch

Sketch is a freely available program that can also edit Adobe Illustrator files. It is installed in /usr/local/bin on quark. Sketch can make labels using its own text command or via an interface to LaTeX. To use the latter, you first need to install some Python scripts:
mkdir $HOME/.sketch
cp ~paige/.sketch/*.py $HOME/.sketch
Your LD_LIBRARY_PATH needs to be properly set, e.g.,
setenv LD_LIBRARY_PATH /lib:/usr/lib:/usr/openwin/lib:/usr/local/lib
For more information see the Sketch user's guide and developer's guide.

FeynDiagram

FeynDiagram is a C++ package to create high quality Feynman diagrams in Postscript. It includes straight and curved solid, dashed, double, photon, and gluon lines, various vertices, and labels using a TeX-like syntax. The source and documentation are in /usr/local/src/FeynDiagram on quark.phy.bnl.gov. It has been compiled with the egcs-2.91.66 release of the GNU C++ compiler; this required some minor changes in the code.

To use FeynDiagram, write a C++ program, say myfig.C, describing the diagram following the documentation in /usr/local/src/FeynDiagram/Docs and the examples in /usr/local/src/FeynDiagram/Examples on quark.phy.bnl.gov. The documentation and the examples are very good; you do not need any prior knowledge of C++. Compile your program with the GNU C++ compiler and execute it as follows:

     g++ -o myfig myfig.C -lFD -lm
     myfig > myfig.ps
     ps2epsi myfig.ps myfig.eps


Star Office

Star Office 5.1 is installed on quark. It can read most Microsoft Office files and generally provides similar functionality. Thus, it provides an alternative to Wincenter for dealing with such files.

Before you use Star Office for the first time, you must run

/Office51/bin/setup
Follow the prompts; the defaults are all reasonable. After running this setup (once), you can start Star Office by typing
~/Office51/bin/soffice [filename]
You may wish to define an alias for this, e.g.,
alias soffice "~/Office51/bin/soffice \!*"

Open Office

Open Office 1.0 is installed on quark. It is a GPL successor to Star Office and generally works better than Star Office 5.1. It can read most Microsoft Office files and can write files in formats compatible with it.

Before you use Open Office for the first time, you must run

/OpenOffice.org1.0/setup
Follow the prompts; the defaults are all reasonable. After running this setup (once), you can start Open Office by typing
/OpenOffice.org1.0/program/soffice [filename]
You may wish to define an alias for this, e.g.,
alias soffice "/OpenOffice.org1.0/program/soffice"

Finding files

In .cshrc you might try the line To use, "locate mystring" gives a list of you files and directories that have the string "mystring" in their name. The command "find" is very powerful, but has too many options to remember easily without using an alias like the above.


Fingers and plans

In your home directory you should have a file named ".plan" which contains your phone number, address, and anything which might be useful to someone trying to reach you. The command "finger emailaddress" often will return that file for the person with the given emailaddress. It may also tell you if that person is logged in and if they have unread e-mail.

Some clever systems will try to guess who you want to reach from a guess at their address. This can be very useful for reaching someone whose address you are not sure of. For an example:

wind.phy.bnl.gov% finger gupta@lanl.gov
[lanl.gov] 
108097 Gupta Goutam              T-10       K710  505-665-6463 
099533 Gupta Rajan               T-8        B285  505-667-7664 rg@lanl.gov
and you find Rajan's phone number and a good candidate for an email address. Sometimes it doesn't work so well:
wind.phy.bnl.gov% finger ginsparg@xxx.lanl.gov
[xxx.lanl.gov] 
Sadly, life's mysteries must remain hidden from so many of you.

Tarring: file.tar

This combines a bunch of files into one to simplify moving things around. A .tar extension is a clue that you have one of these. In these examples, the "v" means be verbose, which I find reassuring, and "f" means you are working with a file rather than a tape.


Compressing: file.Z or file.gz

There are several kinds of compression. The old type is compress: "compress filename" will replace "filename" with "filename.Z" which should be somewhat shorter but contains the same information. "uncompress filename" will replace "filename.Z" with the uncompressed "filename"

A newer version of compression is "gzip". "gzip filename" will produce "filename.gz". To uncompress, "gunzip filename.gz" will give back "filename" It is best using "gzip" and "gunzip" whenever possible. In particular, the hep server at Los Alamos now uses gzip for many papers; uncompress will not work.


Uuencoding: file.uu

This is a scheme for turning binary files into ascii. It was invented for mailing binary files. If you receive a file with an extension of .uu, and/or you receive a file with a lot of gibberishy lines beginning mostly with "M", then you probably have a uuencoded file. Type "uudecode filename" to create the unencoded file. If you get the file by mail or some other means which might put a header on the front, your don't usually need to bother to remove the header since uudecode looks for a line starting with "begin" before going to work.

If you have a file you want to uuencode, then type

The third argument is the name hidden in the begin line and will be the name for the extracted file when uudecode is used. The encoded file can then be mailed or whatever.

Now you should know what to do with something called "file.tar.Z.uu" or "file.tar.gz.uu"

The program ``uufiles'' will put a bunch of files into an automatically unpacking compressed uuencoded tarfile ready for mailing.


Don't mail or post raw postscript files

Postscript is very inefficient spacewise. (Actually this is not necessarily true if you write it yourself. However, most programs that automatically generate postscript are rather sloppy.) It is best to use the above tools before mailing or posting something in postscript. For example and now you send "filename.ps.gz.uu" wherever you want.

To reverse the process:


Spell checking

A spell checker is built into our unix. Just type "spell myfile" and you will get a list of words your machine is wondering about. Even better is "ispell myfile," which will suggest corrections and make them at your request. Emacs and jove have built in ways to do this.


Calculators

"xcalc" should bring up a small calculator for quick computations; however, it is broken on the suns. Try "calctool" instead.


Ising simulation

Try typing "xising" when logged into one of our sparcstations from something supporting xwindows. The source is available here.

If you have a color monitor, you can play with the Bak, Tang, Wiesenfeld sandpile model by typing "xsand" at one of our sparcstations. To see the Potts model in action, type "xpotts." Finally, try "xautomalab" for more general cellular automata. The sources are available here. They should compile on anything supporting Xwindows with color.


Curious how much memory you have?

On a Sun, type "dmesg | grep mem"

To find out your operating system version, type "uname -a"


How to freeze openwin

From a shell, start "textedit". In the shell window, enter ^Z to stop the new program. Forget to type "bg" to put it in the background and then click on the new program's window.

How to get out of this problem:

From another terminal, log in to your machine. Do "ps" and look for the process number for the program you started above. Enter "kill -9 #" where # is the process number just determined.

Note, the -9 lets "kill" stop anything you are allowed to; it may be "overkill" but won't hurt in this case.

If openwindows gets more seriously stuck, then kill -9 the process called openwin from the remote terminal.


Setting up your personal home page

Remember: Everything in this directory can and will be read from all over the world. Do not put anything there which is at all private.

Don't get carried away with fancy html tricks, at least on your top level page. Maybe modems are getting faster, but in practice transfer rates of more than a few hundred bytes per second are unusual. If you keep all the stuff, including graphics, on your top page to under 10K, the waiting time for downloading it is fairly tolerable. Also check that it looks O.K. under a more versitile browser, such as lynx.

Note also that web servers often log the requests they receive. Ours are logged on quark in /usr/local/etc/apache/var/log/access_log. After you set up your page, you can find out if anyone else has looked at it by grepping that file. This file is rotated twice a month since it grows so fast.


Backup and recovery of files

All files in the /home file system of the High Energy Theory Group workstations are backed up daily by CCD using Legato. Instructions for file recovery are here.


Revision Control Software

RCS (Revision Control System) and CVS (Concurrent Versions System) are installed in /usr/local/bin on quark. See the CVS Home Page for more information.


Other stuff


Mike Creutz, creutz@bnl.gov & Rob Pisarski, pisarski@bnl.gov

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.