diff --git a/bootstrap/coriolisEnv.py b/bootstrap/coriolisEnv.py index 95b83f40..cc87530d 100755 --- a/bootstrap/coriolisEnv.py +++ b/bootstrap/coriolisEnv.py @@ -191,10 +191,11 @@ if __name__ == "__main__": else: sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version) - strippedPythonPath = "%s:" % (sitePackagesDir) + strippedPythonPath - strippedPythonPath = "%s/crlcore:" % (sitePackagesDir) + strippedPythonPath - strippedPythonPath = "%s/cumulus:" % (sitePackagesDir) + strippedPythonPath - strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath + strippedPythonPath = "%s:" % (sitePackagesDir) + strippedPythonPath + strippedPythonPath = "%s/crlcore:" % (sitePackagesDir) + strippedPythonPath + strippedPythonPath = "%s/cumulus:" % (sitePackagesDir) + strippedPythonPath + strippedPythonPath = "%s/cumulus/plugins:" % (sitePackagesDir) + strippedPythonPath + strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";\n' \ 'export PYTHONPATH;\n' diff --git a/crlcore/src/crlcore/coriolisInit.py b/crlcore/src/crlcore/coriolisInit.py index 89b28615..6425cb09 100644 --- a/crlcore/src/crlcore/coriolisInit.py +++ b/crlcore/src/crlcore/coriolisInit.py @@ -34,10 +34,16 @@ try: from helpers import Alliance import helpers.Display except ImportError, e: - module = str(e).split()[-1] - - print '[ERROR] The <%s> python module cannot be loaded.' % module - print ' Please check the integrity of the package.' + serror = str(e) + if serror.startswith('No module named'): + module = serror.split()[-1] + print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module + print ' Please check the integrity of the package.' + if str(e).find('cannot open shared object file'): + library = serror.split(':')[0] + print '[ERROR] The <%s> shared library cannot be loaded.' % library + print ' Under RHEL 6, you must be under devtoolset-2.' + print ' (scl enable devtoolset-2 bash)' sys.exit(1) except Exception, e: print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' diff --git a/cumulus/src/plugins/ChipPlugin.py b/cumulus/src/plugins/ChipPlugin.py index 29362d5c..1c49e314 100644 --- a/cumulus/src/plugins/ChipPlugin.py +++ b/cumulus/src/plugins/ChipPlugin.py @@ -58,10 +58,16 @@ try: import chip.BlockCorona import chip.PadsCorona except ImportError, e: - module = str(e).split()[-1] - - print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module - print ' Please check the integrity of the package.' + serror = str(e) + if serror.startswith('No module named'): + module = serror.split()[-1] + print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module + print ' Please check the integrity of the package.' + if str(e).find('cannot open shared object file'): + library = serror.split(':')[0] + print '[ERROR] The <%s> shared library cannot be loaded.' % library + print ' Under RHEL 6, you must be under devtoolset-2.' + print ' (scl enable devtoolset-2 bash)' sys.exit(1) except Exception, e: print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' @@ -162,6 +168,7 @@ def unicornHook ( **kw ): def ScriptMain ( **kw ): + rvalue = True try: helpers.staticInitialization( quiet=True ) #helpers.setTraceLevel( 550 ) @@ -198,11 +205,13 @@ def ScriptMain ( **kw ): except ErrorMessage, e: print e; errorCode = e.code if editor: editor.fit() + rvalue = False except Exception, e: print '\n\n', e; errorCode = 1 traceback.print_tb(sys.exc_info()[2]) + rvalue = False sys.stdout.flush() sys.stderr.flush() - return 0 + return rvalue diff --git a/cumulus/src/plugins/ClockTreePlugin.py b/cumulus/src/plugins/ClockTreePlugin.py index 54bef8b6..5327e15b 100755 --- a/cumulus/src/plugins/ClockTreePlugin.py +++ b/cumulus/src/plugins/ClockTreePlugin.py @@ -32,10 +32,16 @@ try: import clocktree.ClockTree import chip.Configuration except ImportError, e: - module = str(e).split()[-1] - - print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module - print ' Please check the integrity of the package.' + serror = str(e) + if serror.startswith('No module named'): + module = serror.split()[-1] + print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module + print ' Please check the integrity of the package.' + if str(e).find('cannot open shared object file'): + library = serror.split(':')[0] + print '[ERROR] The <%s> shared library cannot be loaded.' % library + print ' Under RHEL 6, you must be under devtoolset-2.' + print ' (scl enable devtoolset-2 bash)' sys.exit(1) except Exception, e: print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' diff --git a/cumulus/src/plugins/clocktree/ClockTree.py b/cumulus/src/plugins/clocktree/ClockTree.py index cbfabdfd..dd5222fb 100755 --- a/cumulus/src/plugins/clocktree/ClockTree.py +++ b/cumulus/src/plugins/clocktree/ClockTree.py @@ -56,10 +56,16 @@ try: from chip.Configuration import destroyNetComponents from chip.Configuration import GaugeConfWrapper except ImportError, e: - module = str(e).split()[-1] - - print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module - print ' Please check the integrity of the package.' + serror = str(e) + if serror.startswith('No module named'): + module = serror.split()[-1] + print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module + print ' Please check the integrity of the package.' + if str(e).find('cannot open shared object file'): + library = serror.split(':')[0] + print '[ERROR] The <%s> shared library cannot be loaded.' % library + print ' Under RHEL 6, you must be under devtoolset-2.' + print ' (scl enable devtoolset-2 bash)' sys.exit(1) except Exception, e: print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' diff --git a/cumulus/src/plugins/clocktree/RSMT.py b/cumulus/src/plugins/clocktree/RSMT.py index 3a41b26e..55a37598 100644 --- a/cumulus/src/plugins/clocktree/RSMT.py +++ b/cumulus/src/plugins/clocktree/RSMT.py @@ -38,10 +38,16 @@ try: from helpers import ErrorMessage import plugins except ImportError, e: - module = str(e).split()[-1] - - print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module - print ' Please check the integrity of the package.' + serror = str(e) + if serror.startswith('No module named'): + module = serror.split()[-1] + print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module + print ' Please check the integrity of the package.' + if str(e).find('cannot open shared object file'): + library = serror.split(':')[0] + print '[ERROR] The <%s> shared library cannot be loaded.' % library + print ' Under RHEL 6, you must be under devtoolset-2.' + print ' (scl enable devtoolset-2 bash)' sys.exit(1) except Exception, e: print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' diff --git a/documentation/examples/AM2901/design.py b/documentation/examples/AM2901/design.py index 1405d2ec..faa5ff8e 100755 --- a/documentation/examples/AM2901/design.py +++ b/documentation/examples/AM2901/design.py @@ -23,10 +23,16 @@ try: import Unicorn import placeandroute except ImportError, e: - module = str(e).split()[-1] - - print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module - print ' Please check the integrity of the package.' + serror = str(e) + if serror.startswith('No module named'): + module = serror.split()[-1] + print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module + print ' Please check the integrity of the package.' + if str(e).find('cannot open shared object file'): + library = serror.split(':')[0] + print '[ERROR] The <%s> shared library cannot be loaded.' % library + print ' Under RHEL 6, you must be under devtoolset-2.' + print ' (scl enable devtoolset-2 bash)' sys.exit(1) except Exception, e: print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' diff --git a/kite/src/init/kiteInit.py b/kite/src/init/kiteInit.py index 8dc5afac..1a064b16 100644 --- a/kite/src/init/kiteInit.py +++ b/kite/src/init/kiteInit.py @@ -7,10 +7,16 @@ try: from helpers import WarningMessage import Viewer except ImportError, e: - module = str(e).split()[-1] - - print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module - print ' Please check the integrity of the package.' + serror = str(e) + if serror.startswith('No module named'): + module = serror.split()[-1] + print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module + print ' Please check the integrity of the package.' + if str(e).find('cannot open shared object file'): + library = serror.split(':')[0] + print '[ERROR] The <%s> shared library cannot be loaded.' % library + print ' Under RHEL 6, you must be under devtoolset-2.' + print ' (scl enable devtoolset-2 bash)' sys.exit(1) except Exception, e: print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' diff --git a/unicorn/src/cgt.py b/unicorn/src/cgt.py index 5f483f26..1a6c4601 100755 --- a/unicorn/src/cgt.py +++ b/unicorn/src/cgt.py @@ -16,10 +16,16 @@ try: import Kite import Unicorn except ImportError, e: - module = str(e).split()[-1] - - print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module - print ' Please check the integrity of the package.' + serror = str(e) + if serror.startswith('No module named'): + module = serror.split()[-1] + print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module + print ' Please check the integrity of the package.' + if str(e).find('cannot open shared object file'): + library = serror.split(':')[0] + print '[ERROR] The <%s> shared library cannot be loaded.' % library + print ' Under RHEL 6, you must be under devtoolset-2.' + print ' (scl enable devtoolset-2 bash)' sys.exit(1) except Exception, e: print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python' diff --git a/unicorn/src/init/unicornInit.py b/unicorn/src/init/unicornInit.py index 8812ce4c..84c1992e 100644 --- a/unicorn/src/init/unicornInit.py +++ b/unicorn/src/init/unicornInit.py @@ -22,10 +22,16 @@ try: from helpers import WarningMessage import Viewer except ImportError, e: - module = str(e).split()[-1] - - print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module - print ' Please check the integrity of the package.' + serror = str(e) + if serror.startswith('No module named'): + module = serror.split()[-1] + print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module + print ' Please check the integrity of the package.' + if str(e).find('cannot open shared object file'): + library = serror.split(':')[0] + print '[ERROR] The <%s> shared library cannot be loaded.' % library + print ' Under RHEL 6, you must be under devtoolset-2.' + print ' (scl enable devtoolset-2 bash)' sys.exit(1) except Exception, e: print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'