BNL HET, NT, & RBRC Theory Software

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

Warning: much of this file is obsolete. Use with caution.



The help desk at ITD at Brookhaven, ext. 5522, is usually friendly, knowledgeable, and useful.

The home page for the ITD department has useful information about proxies, etc.


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 and LaTeX should work on all machines. TeXsis is on quark and some of the machines.

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

Use either gv or ggv for viewing postscript files; some machines only have one or the other. To turn ``name.dvi'' into a postscript file do ``dvips name.dvi -o''. This creates ``''

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 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 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.


The GNU g77 (Fortran), gcc (ANSI C), and g++ (ANSI C++) compilers are available on


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

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 ""; you can then print on a printer by "lp -d destination", 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.

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, 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
At theprompt enter
and give your password when prompted. (Of course you should substitute the appropriate values for ""). For Telnet, type
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:

if [ -f /usr/bin/X11/fvwm2 ] ; then
    if [ -f /usr/bin/ssh-agent1 ] ; then
        exec /usr/bin/ssh-agent /usr/bin/X11/fvwm2
        exec /usr/bin/X11/fvwm2
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
        exec /usr/local/bin/fvwm2
elif [ -f /usr/local/bin/fvwm ] ; then
    exec /usr/local/bin/fvwm
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.


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 Both Mathematica 3 and Mathematica 4.01 are available on, 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/ and not ~you/ Graphics output is something like ``%'' or ``Out[1]''. With the current version of Mathematica, this does NOT generate standard postscript. To fix, you must do You can then print as usual by "lp".

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.


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 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 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 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 >
     ps2epsi myfig.eps

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

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: finger
108097 Gupta Goutam              T-10       K710  505-665-6463 
099533 Gupta Rajan               T-8        B285  505-667-7664
and you find Rajan's phone number and a good candidate for an email address. Sometimes it doesn't work so well: finger
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 "" 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.


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

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 too carried away with fancy html tricks, at least on your top level page. You might also check that things look 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 the Legato tape robot system. Instructions from ITD for recovering files are given here. You must login to quark to do this. It is safer to recover into a new, empty directory using the -d option.

"nwreconver" is a GUI interface for backup recovery. It is considerably easier to use: you can select a date using "Browse Time" under the "Change" menu and set a recovery directory under the "Options" menu. Click on all the files or directories you want, then click "Start" (and be patient).

Tips for Windows

The following is from experience with Windows Vista, which may or may not be true for other versions. Still...

First, you must register your computer within 30 minutes of accessing the Net while at the Lab. This is true even if on the wireless. Now normally this is no problem, because your browser will take you there anyway.

Except for Windows. Then if it is past 30 minutes on the Net, you have to call the Help desk to get them to unblock your computer. You will need your life number and MAC address for the computer. Note that the MAC address for a Windows computer is different for wireless versus ethernet.

Proxies are also peculiar. The proxy info from ITD, which is here, isn't enough, you have to manually set the proxy settings, see here.

Lastly, normally the printers show up when you try to print. Not under Windows, you have to install the drivers for the HP P4015n which we have in the coffee room, in order for the Windows machine to find it in the first place.

Tips for OS X

Problems with OS X Lion

If after installion Lion it doesn't recognize you as a user, see here.

If after installion Lion is really slow, do the following: During Restart, hold down the option key. Instead of the default to "Macintosh HD", click on "Recovery HD". Go to the OS X Utilities, then "Disk Utility". Click "Macintosh HD", then "Repair Disk" then "Repair Disk Permissions". When done, reboot. When you log back in, make sure to let it finish indexing Spotlight before opening any applications. You can check this by trying to use Spotlight. This proceedure is taken from here, ignoring the painful alternatives, like a clean install.

Other stuff

Mike Creutz, & Rob Pisarski,