ATLAS Offline Software
find_library.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 import sys,os
4 
5 __doc__ = """Print the full path of the requested shared library, as found in LD_LIBRARY_PATH.
6 Wildcards are accepted, in which case all (first) matches are printed.
7 The 'lib' prefix and 'so' suffix can be omitted. If no match if found, nothing is printed."""
8 
9 def usage():
10  use = "usage: %s <library> [library]" % os.path.basename(sys.argv[0])
11  print(use + os.linesep*2 + __doc__)
12 
13 if len(sys.argv) <= 1:
14  usage()
15  sys.exit(1)
16 
17 try:
18  from PyJobTransformsCore.envutil import find_libraries
19 except ImportError:
20  raise EnvironmentError("ATLAS Runtime environment not setup.")
21 
22 for lib in sys.argv[1:]:
23  full = find_libraries(lib)
24  for f in full: print(f)
python.envutil.find_libraries
def find_libraries(lib)
Definition: envutil.py:203
find_library.usage
def usage()
Definition: find_library.py:9
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70