1CERNLIB(1) General Commands Manual CERNLIB(1)
2
3
4
6 cernlib - print CERN library dependencies
7
9 cernlib [options] libraries
10
12 cernlib is a tool to list the compiler and linker options necessary to
13 compile a CERNLIB program that has the given library dependencies. It
14 is generally used within a command substitution, as in the following
15 example:
16
17 gfortran -o myprogram myprogram.F `cernlib -G Motif pawlib`
18
19 This version of cernlib has been completely rewritten from the original
20 script provided by CERN. It now does recursive library dependency
21 checking and removes duplicate entries.
22
23 Note that by default, the cernlib script assumes that the CERN
24 libraries are to be linked against statically; if the environment vari‐
25 ables $CERN or $CERN_ROOT are specified, it looks for the libraries
26 only in the "lib" subdirectory of those locations, not any "shlib" sub‐
27 directory. Furthermore, the script brackets the CERN libraries with
28 linker instructions to link statically. This is done to preserve the
29 original upstream behavior, in which all CERNLIB libraries exist only
30 in static form. For instance, "cernlib packlib" outputs:
31
32 -Wl,-static -lpacklib -lkernlib -Wl,-dy -lm -lnsl -lcrypt -ldl -lg2c
33
34 If you want to link against ALL libraries (including CERNLIB) either
35 statically or dynamically, call the cernlib script with its -safe flag
36 to omit these bracketing linker flags. That is: if you want to link
37 against all libraries (not just CERNLIB) statically, use the -static
38 compiler flag and call cernlib with its -safe flag:
39
40 gfortran -o myprogram myprogram.F -static `cernlib -safe -G Motif
41 pawlib`
42
43 and if you want to link against all libraries (including the CERN
44 libraries) dynamically, use the same command without the -static com‐
45 piler flag (the linker assumes dynamic linking by default):
46
47 gfortran -o myprogram myprogram.F `cernlib -safe -G Motif pawlib`
48
50 -a arch
51 Specify a system architecture, e.g. Linux (default), AIX, HP-UX,
52 etc.
53
54 -dy Equivalent to -safe; for backwards compatibility.
55
56 -G driver
57 Specify a graphics driver. The available options on Linux are
58 X11 and Motif (the latter option will also work when the Lesstif
59 library is present).
60
61 -P, -s Ignored; for backwards compatibility.
62
63 -safe Do not make any assumptions about whether the CERN libraries
64 should be linked against dynamically or statically. (The
65 default behavior, if this flag is not used, is to link them
66 statically.)
67
68 -u Do not include architecture-specific libraries in the output.
69
70 -v version
71 Specify version of $CERN_LEVEL. This is meaningless unless you
72 have installed an upstream version of CERNLIB (i.e. not packaged
73 by Debian); see the file /usr/share/doc/cern‐
74 lib-base/README.Debian.
75
76 -?, --help
77 Show a summary of options.
78
79 -- Tell cernlib that this marks the end of cernlib-specific flags,
80 and all following arguments are to be parsed as described in the
81 LIBRARIES section below. If -- is not given, the first word
82 parsed as a library name will be the first word not starting
83 with a hyphen "-" that is not an argument to a preceding cernlib
84 flag.
85
87 The following library names are recognized by this version of the cern‐
88 lib script. These names may be used exactly as shown here, or prefixed
89 by "-l".
90
91 Core CERN libraries
92 mathlib, packlib, kernlib
93
94 Graphics and PAW libraries
95 graflib, pawlib
96
97 Monte Carlo and GEANT libraries
98 cojets, eurodec, geant321, herwig59, isajet758, pdflib804, pho‐
99 tos202, phtools
100
101 Additional Monte Carlo libraries
102 (to obtain these, see /usr/share/doc/monte‐
103 carlo-base/README.Debian)
104 ariadne, ariadne-p5, fritiof, jetset, lepto, pythia5, pythia6
105
106 Aliases
107 The numerals at the end may be left off most of the library
108 names above.
109
110 Other library names
111 Various other names are recognized for backwards compatibility,
112 internal use, and non-Linux architectures. For the complete
113 list, please see the cernlib script.
114
115 Other Any names not recognized by cernlib that start with "-l" or with
116 any character other than a hyphen ("-") are output as
117 -l${name#-l} (i.e., are assumed to be a library). Names start‐
118 ing with a hyphen for which the second character is not "l" are
119 assumed to be compiler flags, and are output at the beginning of
120 the line before all other output.
121
123 /usr/share/doc/cernlib-base/README.Debian describes some of the changes
124 that have been made to the CERN libraries in order to comply with
125 Debian policy and the Filesystem Hierarchy Standard.
126
127 CERNLIB documentation for all related libraries and programs is avail‐
128 able at the following URL: http://cern.ch/cernlib/
129
131 This manual page and the version of the cernlib script that it
132 describes were written by Kevin McCarty <kmccarty@debian.org> for the
133 Debian GNU/Linux system (but may be used by others). They are licensed
134 under the GNU General Public License, version 2 or later (at your
135 choice).
136
138 Copyright (C) Kevin B. McCarty, 2002, 2003, 2004, 2005, 2006.
139
140
141
142 Jan 6, 2005 CERNLIB(1)