Salome HOME
Fix issue 0020160:[CEA:321] (installation wizard should make the difference between...
authorakl <akl@opencascade.com>
Fri, 27 Feb 2009 13:34:24 +0000 (13:34 +0000)
committerakl <akl@opencascade.com>
Fri, 27 Feb 2009 13:34:24 +0000 (13:34 +0000)
16 files changed:
config.xml
config_Debian_3.1.xml
config_Debian_4.0.xml
config_Debian_4.0_64bit.xml
config_Mandrake_10.1.xml
config_Mandriva_2006.0.xml
config_Mandriva_2006.0_64bit.xml
config_Mandriva_2007.0.xml
config_Mandriva_2008.0.xml
config_Mandriva_2008.0_64bit.xml
config_RedHatEnterprise_4.xml
config_RedHat_8.0.xml
config_RedHat_9.xml
config_Scientific_4.2.xml
config_Scientific_4.3.xml
runInstall

index 748ecb84251d7ad8ce6c0aac0f86c01be3884726..9e7e9294cd58c38f1810e293763e1ac0b6215b0e 100644 (file)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Debian4.0,Debian3.1,Mandrake10.1,Mandriva2006.0,Mandriva2007.0,Mandriva2008.0,Mandriva2006.0_64,RedHat8.0,RedHat9,RedHatEnterprise4,Scientific4.2,Scientific4.3"
          targetdir="${HOME}/salome_4.1.1"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index a2ed6a00cfe8b884cc52d9d9a32081f32caf25de..4c3c4db551950ebc4b8228370302aaa2f2d6f84d 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Debian 3.1"
          targetdir="${HOME}/salome_5.1.1"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index 294f2b04a90b89554431fe8c06f25b30162d4b61..7bbad453fb10c7d49f5ade6c10d3026a51fe5c31 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Debian 4.0"
          targetdir="${HOME}/salome_5.1.1"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index 0b5b89313fdc5e7488efd10afed376cad027a77c..6edfaa7988325eb97eac3dc9028d7ec9616bef7f 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Debian 4.0 64bit"
          targetdir="${HOME}/salome_5.1.1"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index 76e90faa4df2cd12d13c396078fd0976520534d1..478e219b14034f23917e05749df8cb5b6f3b0f6a 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Mandrake10.1"
          targetdir="${HOME}/salome_5.0.0"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index 4b494f43856368124ef1b168d4befb5274c9b04e..edf646962ff050e97ea04008ed7aa0b8130f533e 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Mandriva 2006.0"
          targetdir="${HOME}/salome_5.1.1"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index cb603ed299f073c982e040db5d691230b6206f6a..4add7b5f3c05f8dcbb3f8768d4d98a74aea20e1c 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Mandriva 2006.0 64bit"
          targetdir="${HOME}/salome_5.1.1"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index c36489a1d6637809cda7bd89c1e20082e6d2a22a..045142a4a80128620d76a15bf10dbcb6639621d2 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Mandriva2007.0"
          targetdir="${HOME}/salome_5.0.0"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index e4d7b862ca7c4b7d7c383941ba5c0ba35d0b4758..df5038a9ea3a210438b6fe4450cadc0571174b11 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Mandriva 2008.0"
          targetdir="${HOME}/salome_5.1.1"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index 0dc27d711e46175b83696971c354d02025ae6753..a1104bacf89982c4869af8689bd836805b93523f 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Mandriva 2008.0 64bit"
          targetdir="${HOME}/salome_5.1.1"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index 5f15c0aa2282ae9d8f9f2b68300bc935f1388561..dcb1250612707efd4da4587b4f1397b48b8058a9 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="RedHatEnterprise4"
          targetdir="${HOME}/salome_5.0.0"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index b0d68c2f8a01c55fa4db0a426dd25d422b08d760..5c4aa58256a214bbca3b4c258dce5271c0b48b22 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="RedHat8.0"
          targetdir="${HOME}/salome_5.0.0"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index b2d1e5e83c4e77b0745249cc8b217e7f3f641c77..fbe18974cb59a8b29b4662bd6d90b50c74d8c88b 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="RedHat9"
          targetdir="${HOME}/salome_5.0.0"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index f15c2a762009cb63f3a34a3497af49a74da601da..ba5e03d013816511837a5a34b54efb908e754747 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Scientific4.2"
          targetdir="${HOME}/salome_5.0.0"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index c22994485cc9932bfdf005235c42f641e1679e5f..bca298796b694f6b9f3c1a0f7aa5781b5e9ca786 100755 (executable)
@@ -6,7 +6,8 @@
           license="&lt;h5>GNU LGPL&lt;/h5>"
          platforms="Scientific4.3"
          targetdir="${HOME}/salome_5.0.0"
-         tempdir="/tmp"/>
+         tempdir="/tmp"
+         optionallibs="libcppunit,libblsurf"/>
 
   <buttons>
     <button label="Launch SALOME"
index 3f82079cd2fe104bb990f5ad95a1e1a6ac7dfc2b..70bfc6c47c4ea60d983f5601fc599020c4c9fee5 100755 (executable)
@@ -373,6 +373,7 @@ class Config :
     - SALOME platform version
     - Copyright and license info
     - Default target and temporary directories
+    - List of optional libraries for Salome
     """
     def __init__(self,
                  theVersion   = None,
@@ -381,7 +382,8 @@ class Config :
                  theLicense   = None,
                  thePlatforms = None,
                  theTargetdir = None,
-                 theTmpdir    = None):
+                 theTmpdir    = None,
+                 theOptLibs   = None):
         self.version   = strip(theVersion)
         self.caption   = strip(theCaption)
         self.copyright = strip(theCopyright)
@@ -389,6 +391,7 @@ class Config :
         self.platforms = strip(thePlatforms)
         self.targetdir = strip(theTargetdir)
         self.tmpdir    = strip(theTmpdir)
+        self.optlibs   = strip(theOptLibs)
 
 #==============================================================
 # class Product : pre-requisite product options
@@ -456,7 +459,8 @@ class ConfigParser:
                              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
@@ -1098,6 +1102,46 @@ def select_platform(all_platforms):
         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                         #
@@ -1301,12 +1345,6 @@ if __name__ == "__main__":
         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 :
@@ -1333,6 +1371,19 @@ if __name__ == "__main__":
             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()