LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
check_libs.cc File Reference
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <regex>
#include "cetlib/LibraryManager.h"
#include "cetlib_except/exception.h"

Go to the source code of this file.

Functions

void try_loading (LibraryManager &libs, string const &path, string const &expected_symbol)
 
void checkLoadability (string const &type, string const &expected_symbol)
 
int main ()
 

Function Documentation

void checkLoadability ( string const &  type,
string const &  expected_symbol 
)

Definition at line 50 of file check_libs.cc.

References evd::details::end(), and try_loading().

Referenced by main().

52 {
53  static const regex system_service("libart_Framework_Services_System_[A-Za-z]+_service\\.dylib");
54 
55  vector<string> libraries;
56  LibraryManager libs(type);
57 
58  size_t numLibs = libs.getLoadableLibraries(libraries);
59  cout << " found "
60  << numLibs
61  << " libraries of type "
62  << type
63  << ", list follows...\n";
64 
66  it = libraries.begin(),
67  end = libraries.end();
68  it != end; ++it)
69  {
70  cout << " " << *it;
71  if (regex_search(*it, system_service))
72  cout << "... ok\n";
73  else
74  try_loading(libs, *it, expected_symbol);
75  }
76 
77 }
intermediate_table::const_iterator const_iterator
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void try_loading(LibraryManager &libs, string const &path, string const &expected_symbol)
Definition: check_libs.cc:25
int main ( )

Definition at line 79 of file check_libs.cc.

References checkLoadability(), keras::KerasModel::compute_output(), keras::DataChunk::get_3d(), and keras::DataChunk::read_from_file().

80 {
81  checkLoadability("module", "make");
82  checkLoadability("service", "make");
83 
84  checkLoadability("map", "SEAL_CAPABILITIES");
85  checkLoadability("dict", "_init");
86 
87  return 0;
88 }
void checkLoadability(string const &type, string const &expected_symbol)
Definition: check_libs.cc:50
void try_loading ( LibraryManager &  libs,
string const &  path,
string const &  expected_symbol 
)

Definition at line 25 of file check_libs.cc.

References e.

Referenced by checkLoadability().

28 {
29  void* sym = 0;
30  try
31  {
32  libs.getSymbolByPath(path, expected_symbol, sym);
33  if (sym)
34  cout << "... ok\n";
35  else
36  cout << "... symbol value was zero: report this to ART core team\n";
37  }
38  catch (cet::exception& e)
39  {
40  cout << "... FAILED:\n"
41  << e.what() << '\n';
42  }
43  catch (...)
44  {
45  cout << " ... FAILED: Loading threw an unidentified exception\n";
46  }
47 
48 }
Float_t e
Definition: plot.C:34
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33