- SALOME platform version
- Copyright and license info
- Default target and temporary directories
+ - List of optional libraries for Salome
"""
def __init__(self,
theVersion = None,
theLicense = None,
thePlatforms = None,
theTargetdir = None,
- theTmpdir = None):
+ theTmpdir = None,
+ theOptLibs = None):
self.version = strip(theVersion)
self.caption = strip(theCaption)
self.copyright = strip(theCopyright)
self.platforms = strip(thePlatforms)
self.targetdir = strip(theTargetdir)
self.tmpdir = strip(theTmpdir)
+ self.optlibs = strip(theOptLibs)
#==============================================================
# class Product : pre-requisite product options
configElem.getAttribute('license').strip(),
configElem.getAttribute('platforms').strip(),
configElem.getAttribute('targetdir').strip(),
- configElem.getAttribute('tempdir').strip())
+ configElem.getAttribute('tempdir').strip(),
+ configElem.getAttribute('optionallibs').strip())
if not self.pltname and self.config.platforms:
self.pltname = self.config.platforms.split(",")[0].strip()
pass
pass
return pltname, all_platforms[pltname]
+#==============================================================
+# 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
+
#------------------------------------------------------------------#
# #
# EXECUTION STARTS HERE #
rm_src_tmp = "FALSE"
pass
- # modify *.la files, if --single-directory option was -----------
- if is_single_dir:
- message("Modifying of *.la files of SALOME modules...")
- cmd = '%s/modifyLaFiles.sh modify_la_files %s' % (scripts_dir, target_dir)
- res = os.system(cmd)
-
# pickup environment -----------
message("Creating environment files")
for product in parser.products :
pass
pass
+ if not is_force_src:
+ if is_single_dir:
+ # modify *.la files, if --single-directory option was pointed -----------
+ message("Modifying of *.la files of SALOME modules...")
+ cmd = '%s/modifyLaFiles.sh modify_la_files %s' % (scripts_dir, target_dir)
+ res = os.system(cmd)
+ else:
+ # check that all required libraries are in system
+ message("Check existence of Fortran and other required libraries...")
+ cmd = '%s/checkFortran.sh find_libraries %s > %s/not_found_libs.txt' % (scripts_dir, target_dir, tmp_dir)
+ if os.system(cmd):
+ check_not_found_libs("%s/not_found_libs.txt" % (tmp_dir), parser.config.optlibs)
+
# clean temporary directory -----------
message("Cleaning temporary directory")
clean_all()