[cig-commits] r4300 - long/3D/Gale/trunk

walter at geodynamics.org walter at geodynamics.org
Tue Aug 15 15:49:31 PDT 2006


Author: walter
Date: 2006-08-15 15:49:31 -0700 (Tue, 15 Aug 2006)
New Revision: 4300

Modified:
   long/3D/Gale/trunk/
   long/3D/Gale/trunk/configure.py
Log:
 r602 at earth:  boo | 2006-08-15 13:05:04 -0700
 Clean up configure.py



Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
   - 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:599
   + 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:602

Modified: long/3D/Gale/trunk/configure.py
===================================================================
--- long/3D/Gale/trunk/configure.py	2006-08-15 21:59:10 UTC (rev 4299)
+++ long/3D/Gale/trunk/configure.py	2006-08-15 22:49:31 UTC (rev 4300)
@@ -7,71 +7,21 @@
 
 
 if not hasattr(sys, 'version_info') or not sys.version_info[1] >= 2 or not sys.version_info[0] >= 2:
-  print '**** You must have Python version 2.2.1 or higher to run configure.py ***********'
-  print '*           Python is easy to install for end users or sys-admin.               *'
-  print '*                   http://www.python.org/download/                             *'
-  print '*                                                                               *'
-  print '*            You CANNOT configure Gale without Python                           *'
-  print '*********************************************************************************'
+  print '* You must have Python version 2.2.1 or higher to run configure.py *'
+  print '*           Python is easy to install for end users or sys-admin.  *'
+  print '*                   http://www.python.org/download/                *'
+  print '*                                                                  *'
+  print '*            You CANNOT configure Gale without Python              *'
+  print '********************************************************************'
   sys.exit(4)
 
-def check_gale_arch(opts):
-  # If GALE_ARCH not specified - use script name (if not configure.py)
-  found = 0
-  for name in opts:
-    if name.find('GALE_ARCH=') >= 0:
-      found = 1
-      break
-  # If not yet specified - use the filename of script
-  if not found:
-      filename = os.path.basename(sys.argv[0])
-      if not filename.startswith('configure') and not filename.startswith('reconfigure'):
-        useName = 'GALE_ARCH='+os.path.splitext(os.path.basename(sys.argv[0]))[0]
-        opts.append(useName)
-
-def chkcygwin():
-  if os.path.exists('/usr/bin/cygcheck.exe'):
-    buf = os.popen('/usr/bin/cygcheck.exe -c cygwin').read()
-    if buf.find('1.5.11-1') > -1:
-      return 1
-    else:
-      return 0
-  return 0
-
-def chkcygwinpython():
-  if os.path.exists('/usr/bin/cygcheck.exe'):
-    buf = os.popen('/usr/bin/cygcheck.exe -c python').read()
-    if buf.find('2.4') > -1:
-      return 1
-    else:
-      return 0
-  return 0
-
-def rhl9():
-  try:
-    file = open('/etc/redhat-release','r')
-  except:
-    return 0
-  try:
-    buf = file.read()
-    file.close()
-  except:
-    # can't read file - assume dangerous RHL9
-    return 1
-  if buf.find('Shrike') > -1:
-    return 1
-  else:
-    return 0
-
 def gale_configure(configure_options): 
-  print '================================================================================='
-  print '             Configuring Gale to compile on your system                         '
-  print '================================================================================='  
+  print '==================================================='
+  print '    Configuring Gale to compile on your system     '
+  print '==================================================='
 
   # Command line arguments take precedence (but don't destroy argv[0])
   sys.argv = sys.argv[:1] + configure_options + sys.argv[1:]
-  # check GALE_ARCH
-  check_gale_arch(sys.argv)
   extraLogs = []
 
   # support a few standard configure option types 
@@ -89,64 +39,16 @@
       if name.find('=') == -1: sys.argv[l] = sys.argv[l]+'=0'
       elif name.endswith('=1'): sys.argv[l].replace('=1','=0')
 
-  # Check for broken cygwin
-  if chkcygwin():
-    print '================================================================================='
-    print ' *** cygwin-1.5.11-1 detected. configure.py fails with this version ***'
-    print ' *** Please upgrade to cygwin-1.5.12-1 or newer version. This can   ***'
-    print ' *** be done by running cygwin-setup, selecting "next" all the way. ***'
-    print '================================================================================='
-    sys.exit(3)
-
-  # Disable threads on RHL9
-  if rhl9():
-    sys.argv.append('--useThreads=0')
-    extraLogs.append('''\
-================================================================================
-   *** RHL9 detected. Threads do not work correctly with this distribution ***
-    ********* Disabling thread usage for this run of configure.py ***********
-================================================================================''')
-
-  # Threads don't work for cygwin & python-2.4
-  if chkcygwinpython():
-    sys.argv.append('--useThreads=0')
-    extraLogs.append('''\
-================================================================================
-** Cygwin-python-2.4 detected. Threads do not work correctly with this version *
- ********* Disabling thread usage for this run of configure.py ****************
-================================================================================''')
-          
   # Should be run from the toplevel
   pythonDir = os.path.abspath(os.path.join('python'))
-#  petscDir  = os.path.abspath(os.path.join(os.environ['PETSC_DIR'], 'python'))
   petscDir  = os.path.abspath(os.path.join('python/petsc/python'))
   bsDir     = os.path.join(pythonDir, 'BuildSystem')
   if not os.path.isdir(pythonDir):
     raise RuntimeError('Run configure from $GALE_DIR, not '+os.path.abspath('.'))
   if not os.path.isdir(bsDir):
-    print '================================================================================='
+    print '================================================================'
     print '''++ Could not locate BuildSystem in %s/python.''' % os.getcwd()
-    print '''++ Downloading it using "hg clone http://crust.geodynamics.org/BuildSystem %s/python/BuildSystem"''' % os.getcwd()
-    print '================================================================================='
-    (status,output) = commands.getstatusoutput('hg clone http://crust.geodynamics.org/BuildSystem python/BuildSystem')
-    if status:
-      if output.find('ommand not found') >= 0:
-        print '================================================================================='
-        print '''** Unable to locate bk (Bitkeeper) to download BuildSystem; make sure hg is in your path'''
-        print '''** or manually copy BuildSystem to $GALE_DIR/python/BuildSystem from a machine where'''
-        print '''** you do have hg installed and can clone BuildSystem. '''
-        print '================================================================================='
-      elif output.find('Cannot resolve host') >= 0:
-        print '================================================================================='
-        print '''** Unable to download BuildSystem. You must be off the network.'''
-        print '''** Connect to the internet and run configure.py again.'''
-        print '================================================================================='
-      else:
-        print '================================================================================='
-        print '''** Unable to download BuildSystem. Please send this message to cig-long at geodynamics.org'''
-        print '================================================================================='
-      print output
-      sys.exit(3)
+    sys.exit(3)
       
   sys.path.insert(0, bsDir)
   sys.path.insert(0, pythonDir)
@@ -198,34 +100,34 @@
     +'---------------------------------------------------------------------------------------\n'  \
     +emsg+'*********************************************************************************\n'
     se = ''
-#   except (TypeError, ValueError), e:
-#     emsg = str(e)
-#     if not emsg.endswith('\n'): emsg = emsg+'\n'
-#     msg ='*********************************************************************************\n'\
-#     +'                ERROR in COMMAND LINE ARGUMENT to configure.py \n' \
-#     +'---------------------------------------------------------------------------------------\n'  \
-#     +emsg+'*********************************************************************************\n'
-#     se = ''
-#   except ImportError, e :
-#     emsg = str(e)
-#     if not emsg.endswith('\n'): emsg = emsg+'\n'
-#     msg ='*********************************************************************************\n'\
-#     +'                     UNABLE to FIND MODULE for configure.py \n' \
-#     +'---------------------------------------------------------------------------------------\n'  \
-#     +emsg+'*********************************************************************************\n'
-#     se = ''
-#   except SystemExit, e:
-#     if e.code is None or e.code == 0:
-#       return
-#     msg ='*********************************************************************************\n'\
-#     +'           CONFIGURATION CRASH  (Please send configure.log to cig-long at geodynamics.org)\n' \
-#     +'*********************************************************************************\n'
-#     se  = str(e)
-#   except Exception, e:
-#     msg ='*********************************************************************************\n'\
-#     +'          CONFIGURATION CRASH  (Please send configure.log to cig-long at geodynamics.org)\n' \
-#     +'*********************************************************************************\n'
-#     se  = str(e)
+  except (TypeError, ValueError), e:
+    emsg = str(e)
+    if not emsg.endswith('\n'): emsg = emsg+'\n'
+    msg ='*********************************************************************************\n'\
+    +'                ERROR in COMMAND LINE ARGUMENT to configure.py \n' \
+    +'---------------------------------------------------------------------------------------\n'  \
+    +emsg+'*********************************************************************************\n'
+    se = ''
+  except ImportError, e :
+    emsg = str(e)
+    if not emsg.endswith('\n'): emsg = emsg+'\n'
+    msg ='*********************************************************************************\n'\
+    +'                     UNABLE to FIND MODULE for configure.py \n' \
+    +'---------------------------------------------------------------------------------------\n'  \
+    +emsg+'*********************************************************************************\n'
+    se = ''
+  except SystemExit, e:
+    if e.code is None or e.code == 0:
+      return
+    msg ='*********************************************************************************\n'\
+    +'           CONFIGURATION CRASH  (Please send configure.log to cig-long at geodynamics.org)\n' \
+    +'*********************************************************************************\n'
+    se  = str(e)
+  except Exception, e:
+    msg ='*********************************************************************************\n'\
+    +'          CONFIGURATION CRASH  (Please send configure.log to cig-long at geodynamics.org)\n' \
+    +'*********************************************************************************\n'
+    se  = str(e)
 
   print msg
   if not framework is None:



More information about the cig-commits mailing list