+#==============================================================
+# Check existence of required libraries in system and
+# warn user if some ones are absent
+#===============================================================
+def check_not_found_libs(filepath, optlibs):
+ a_file = open(filepath, 'r')
+ nf_mand_libs = list()
+ nf_opt_libs = list()
+ pref_opt_libs = optlibs.split(",")
+ for line in a_file:
+ line = line.strip()
+ if not line:
+ continue
+ line = line.split(" ")[0]
+ if line in nf_mand_libs or line in nf_opt_libs:
+ continue
+ is_optional = False;
+ for opt_lib in pref_opt_libs:
+ if line.lower().startswith(opt_lib.lower().strip()):
+ is_optional = True
+ break
+ if is_optional:
+ nf_opt_libs.append(line)
+ else:
+ nf_mand_libs.append(line)
+ pass
+
+ msg = "=== WARNING: Some libraries are absent! ===\n"
+ if nf_mand_libs:
+ msg += "One or several MANDATORY libraries listed below are not found. SALOME may not work properly.\n\t"
+ msg += "\n\t".join(nf_mand_libs)
+ msg += "\n"
+ if nf_opt_libs:
+ msg += "One or several OPTIONAL libraries listed below are not found. This does not affect on the correct work of SALOME platform.\n\t"
+ msg += "\n\t".join(nf_opt_libs)
+ if nf_mand_libs or nf_opt_libs:
+ print msg
+ a_file.close()
+ pass
+