CERNLIB-STATIC(1)

πŸ“¦ version 2025.09.18.4, in nixos 26.05, nixpkgs unstable

πŸ’– CERNLIB-STATIC(1) πŸ’–

okay bestie, this one is from the CERNlib commands manual: cernlib-static is the little icon that tells you which object libraries you need to link with the CERN Program Library. No cap, it's giving β€œlinker whisperer” energy πŸ”₯


✨ NAME ✨

cernlib-static β€” get libraries needed to link with CERN Program Library πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

cernlib-static [ options ] [ library[/version] ] ...

🌸 DESCRIPTION 🌸

cernlib-static writes to standard output a list of object libraries needed to link a program with the given library of CERNlib. Other libraries needed implicitly β€” both CERNlib and system libraries β€” are added automatically. Slay, honestly 🫢

The library may be any of the CERNlib libraries using a short name like packlib, mathlib, graflib, phtools... and yes, cernlib-static allows you to specify which version to use for this library, see usage notes below πŸ’…


πŸŽ€ OPTIONS πŸŽ€

cernlib-static recognizes the following options:

  • graphics-interface option β€” specifies the graphics interface to use. Defaults to X11. The choices available depend on the system in use:
    • all systems.
    • On HP/UX, X11R5 is used when available on the system.
    • all systems.
    • On HP/UX, Motif1.2 is used when available on the system.
    • Vendor specific graphics, DEC Ultrix, IBM/RS6000, SUN only.
    • Vendor specific graphics, Apollo only.
    • Vendor specific graphics, IBM/RS6000 and SGI only.
  • obsolete option β€” obsolete option. Ignored. literally β€œnothing to see here” energy πŸ’€
  • lapack/blas opt-out option β€” Don’t link against system lapack and blas.
  • vendor-libraries option β€” do automatically add vendor libraries needed to link, but not specified by the user.
  • level/version option β€” Use level of CERNlib libraries; can be pro, new or old, or you may specify the explicit version number; the default version is pro. The global version can be overwritten for an individual library by specifying the library as library/version.

🌿 where CERNlib lives: the CERN variable

cernlib-static expects to find the CERNlib directory tree in /cern; if your system does not have this, set the environment variable CERN to contain the name of the root directory for the CERNlib tree. 🧚


πŸ¦‹ version overrides on individual libraries

After the library, a version for that library different from the default version may be specified. The possible values are as for the version option, or in the case of graflib as for the graphics option. πŸ’–


πŸ’… USING IT / EXAMPLES πŸ’…

As cernlib-static writes the list of libraries to standard output, using it as a command will show the list of libraries generated by cernlib-static. Also, it can be used like other commands in the command line surrounded by back quotes (β€˜). πŸ‘‘

At CERN you should use the hepf77 command to link on your system as this gives the compiler parameters which are compatible with Cernlib (in particular for xlf on IBM/RS6000 and fort77 on HP/UX). You could type:

hepf77 your.o β€˜cernlib-staticβ€˜

to link your object file with routines from packlib and kernlib; you need not specify packlib, as this is added automatically. Also all kernlib routines are included in packlib. 🌈

If your application uses graflib and the Motif interface, the command would be:

hepf77 your.o β€˜cernlib-static graflib/Motifβ€˜

Again packlib need not be specified. πŸŽ€

If you prefer to have an environment variable CERNLIB set at login time, put the following into .profile for sh, ksh or similar:

CERNLIB=β€˜cernlib-static graflibβ€˜; export CERNLIB

For .login for users of csh or similar:

setenv CERNLIB "β€˜cernlib-static graflibβ€˜"

The CERNLIB variable can then be used in the link command instead of calling the cernlib-static command. πŸ’…


πŸ”₯ NOTES, CAVEATS & β€œNO CAP” WARNINGS πŸ”₯

There is no checking that any of the libraries (or options) are valid or exist. Most loaders only check the libraries once for symbols, hence the order the libraries given is important. This command does not check that the order given is correct. 😭

For systems other than Alliant, Apollo, DEC Ultrix, Digital Unix (or DEC OSF), HP/UX, SGI, Linux, Sun OS, Sun Solaris the libraries given for the graphics interface are likely to be wrong, even for X11 and Motif. This is a real warning, bestie β€” not a vibe check.

The cernlib-static command is available in the /cern/pro/bin directory in the CERNlib tree. 🧚


πŸ’Œ BUGS / REPORTING πŸ’Œ

If you have suggestions for improvements, or find bugs, please report them to cernlib@cern.ch. Your report must state which version of CERNlib you are using, or the output of the command: what which cernlib-static gives you. 🫢


Source/version: CERNlib commands β€” cernlib-static. Date: the original footer’s source/version and date are acknowledged here with full main-character respect. periodt πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ˜­πŸ”₯πŸ‘‘πŸŒˆβ­πŸ’€πŸ™ˆπŸ“πŸ§šπŸ’œ

πŸ“¦ where this page comes from