CERNLIB(1)
π» CERNLIB(1) β from the General Commands Manual, bestie β¨
okay so picture this: it's section 1 of the manual, the command's called cernlib, and she's here to spill the tea on CERN library dependencies. buckle up π
πΈ NAME πΈ
cernlib β print CERN library dependencies. that's it. that's the whole job. iconic behavior honestly π
β¨ SYNOPSIS β¨
cernlib [options] libraries
π DESCRIPTION π
so cernlib is literally just a tool that lists the compiler and linker options you need to compile a CERNLIB program that has whatever library dependencies you hand her. that's the vibe. π¦
she's generally used inside a command substitution, like this:
gfortran -o myprogram myprogram.F `cernlib -G Motif pawlib`
ngl, this version of cernlib has been completely rewritten from the original script provided by CERN. glow-up of the century π
and now she does recursive library dependency checking and removes duplicate entries. we love a queen who cleans up after herself β¨
β οΈ heads up bestie: by default, thecernlibscript assumes that the CERN libraries are to be linked against statically. and if the environment variables$CERNor$CERN_ROOTare specified, she looks for the libraries only in the"lib"subdirectory of those locations β not any"shlib"subdirectory. no cap, that's the whole rule.
furthermore (yes i said furthermore π), the script brackets the CERN libraries with linker instructions to link statically. why? to preserve the original upstream behavior, in which all CERNLIB libraries exist only in static form. periodt. for instance, cernlib packlib outputs:
-Wl,-static -lpacklib -lkernlib -Wl,-dy -lm -lnsl -lcrypt -ldl -lg2c
so if you want to link against ALL libraries (including CERNLIB) either statically or dynamically, call the cernlib script with its -safe flag to omit these bracketing linker flags. that's the move π«Ά
meaning: if you want to link against all libraries (not just CERNLIB) statically, use the -static compiler flag and call cernlib with its -safe flag:
gfortran -o myprogram myprogram.F -static `cernlib -safe -G Motif pawlib`
and if you want to link against all libraries (including the CERN libraries) dynamically, use the same command without the -static compiler flag β the linker assumes dynamic linking by default, so she doesn't even need to be told π
gfortran -o myprogram myprogram.F `cernlib -safe -G Motif pawlib`
π OPTIONS π
-aarch β specify a system architecture, e.g.Linux(default),AIX,HP-UX, etc. π₯οΈ-dyβ equivalent to-safe; for backwards compatibility. old money π©-Gdriver β specify a graphics driver. the available options on Linux areX11andMotif(the latter option will also work when the Lesstif library is present). π¨-P,-sβ ignored; for backwards compatibility. she's literally just standing there being decorative π-safeβ do not make any assumptions about whether the CERN libraries should be linked against dynamically or statically. (the default behavior, if this flag is not used, is to link them statically.) so like, don't assume. ask. π-uβ do not include architecture-specific libraries in the output. keep it minimal bestie βοΈ-vversion β specify version of$CERN_LEVEL. this is meaningless unless you have installed an upstream version of CERNLIB (i.e. not packaged by Debian); see the file/usr/share/doc/cernlib-base/README.Debian. ποΈ-?,--helpβ show a summary of options. the classic cry for help, but make it helpful π₯Ί--β tellcernlibthat this marks the end ofcernlib-specific flags, and all following arguments are to be parsed as described in the LIBRARIES section below. if--is not given, the first word parsed as a library name will be the first word not starting with a hyphen"-"that is not an argument to a precedingcernlibflag. iykyk π§
π¦ LIBRARIES π¦
okay so these are the library names recognized by this version of the cernlib script. you may use these names exactly as shown here, or prefixed by -l. easy. slay. π
π Core CERN libraries
mathlib, packlib, kernlib
π Graphics and PAW libraries
graflib, pawlib
π₯ Monte Carlo and GEANT libraries
cojets, eurodec, geant321, herwig59, isajet758, pdflib804, photos202, phtools
β Additional Monte Carlo libraries
(to obtain these, see /usr/share/doc/montecarlo-base/README.Debian)
ariadne, ariadne-p5, fritiof, jetset, lepto, pythia5, pythia6
π Aliases
the numerals at the end may be left off most of the library names above. so like, drop the digits, she'll still know who you mean π
πΈ Other library names
various other names are recognized for backwards compatibility, internal use, and non-Linux architectures. for the complete list, please see the cernlib script. go read the source, it's giving main character energy π
π«Ά Other
any names not recognized by cernlib that start with -l or with any character other than a hyphen ("-") are output as -l${name#-l} (i.e., are assumed to be a library). β¨
names starting with a hyphen for which the second character is not "l" are assumed to be compiler flags, and are output at the beginning of the line before all other output. she puts them first, because she has priorities π€
π§ SEE ALSO π§
/usr/share/doc/cernlib-base/README.Debian describes some of the changes that have been made to the CERN libraries in order to comply with Debian policy and the Filesystem Hierarchy Standard. boring but necessary, read it ποΈ
CERNLIB documentation for all related libraries and programs is available at the following URL: http://cern.ch/cernlib/ π
π AUTHOR π
this manual page and the version of the cernlib script that it describes were written by Kevin McCarty <kmccarty@debian.org> for the Debian GNU/Linux system (but may be used by others). they are licensed under the GNU General Public License, version 2 or later (at your choice). give credit where credit is due bestie π«Ά
π COPYRIGHT π
Copyright (C) Kevin B. McCarty, 2002, 2003, 2004, 2005, 2006.
Jan 6, 2005 β ok so that's the date and now we're moving right along, because there's more coming and i am not leaving you on read π β¨
π COPYRIGHT π
Okay so the legal bit, and it's short and sweet bestie β no fine print marathon here:
Copyright (C) Kevin B. McCarty, 2002, 2003, 2004, 2005, 2006.
That's it. That's the whole copyright section. Six years of Kevin B. McCarty holding the copyright, from 2002 all the way through 2006. Respect the hustle. π«Ά
And that's a wrap on the whole page, babes! β¨ This was CERNLIB(1) β dated Jan 6, 2005 if you're keeping track β so go forth, link your libraries, and remember: the docs ate, and so will you. π
πΈ periodt.
π¦ where this page comes from
- nixos 26.05: cernlib 2025.09.18.4
- nixpkgs unstable: cernlib 2025.09.18.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms