CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit for current CERN information.

next up previous
Next: CERNLIB on LINUX/IBM Up: Program Library News Previous: Change of CERN

Introducing the "cernlib" Command in Unix

  Gunter Folger CN/ASD

Since release 93d of the CERN Program Library the cernlib command is available also in UNIX. The cernlib script is in /cern/pro/bin. The usage of cernlib in UNIX is similar to VM and VAX.

cernlib can be used in two ways, either directly in the compile/link command or to define an environment variable. Assuming that f77 is the link command, the following will link a user program with packlib, the X11 version of graflib, and all the system libraries needed (please note that the cernlib command must be given between two backquotes, or grave accent marks() as for any other UNIX command substitution):

f77 your.o  `cernlib graflib`

One can also set up an environment variable; this could be done in the login procedure. Depending on the shell in use the syntax is

The environment variable CERNLIB can then be used in link commands for th rest of the session:
f77 your.o  $CERNLIB

For a full description of options available consult the man page for cernlib. The man pages for CERN Program library tools are kept in /cern/man. To have access to this directory through the man command, add this directory to your MANPATH, or, for most UNIX systems, you can also type

man -M /cern/man cernlib.

Should you have further questions, comments, suggestions for improvement please send an e-mail to

Janne Saarela
Tue May 16 13:43:26 METDST 1995