Changeset 4812
- Timestamp:
- Nov 12, 2007, 5:03:44 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/utilities/compile.py
r4811 r4812 10 10 Ole Nielsen, Duncan Gray Oct 2001 11 11 """ 12 13 # FIXME (Ole): Although this script says it works with a range of compilers, 14 # it has only really been used with gcc. 12 15 13 16 import os, string, sys, types … … 151 154 152 155 # Verify that compiler can be executed 153 s = '%s --version' %compiler154 s = s + ' > /dev/null' # Suppress output156 print 'Compiler: %s, version ' %compiler, 157 s = '%s -dumpversion' %(compiler) 155 158 err = os.system(s) 159 print 156 160 if err != 0: 157 msg = 'Unable to execute compiler: %s. ' %compiler158 msg += 'Make sure it is available on the system path. '159 msg += 'One way is to try to check that %s runs on ' %compiler161 msg = 'Unable to execute compiler: %s. ' %compiler 162 msg += 'Make sure it is available on the system path.\n' 163 msg += 'One way to check this is to run %s on ' %compiler 160 164 msg += 'the commandline.' 161 raise Exception, msg 162 163 165 raise Exception, msg 166 167 164 168 # Find location of include files 165 169 # … … 183 187 184 188 185 # Add Python path + utilities to includelist (see ticket:31)186 # Assume there is only one 'utilities' dir under path dirs189 # Add Python path + utilities to includelist (see ticket:31) 190 # Assume there is only one 'utilities' dir under path dirs 187 191 188 192 utilities_include_dir = None … … 263 267 if verbose: 264 268 print s 265 else: 266 s = s + ' 2> /dev/null' #Suppress errors 267 269 270 # Doesn't work on Windows anyway 271 #else: 272 # s = s + ' 2> /dev/null' #Suppress errors 273 268 274 try: 269 275 err = os.system(s) … … 279 285 else: 280 286 s = '%s -%s %s -o %s.%s "%s" -lm' %(loader, sharedflag, object_files, root1, libext, libs) 287 281 288 if verbose: 282 289 print s 283 else: 284 s = s + ' 2> /dev/null' #Suppress warnings 290 291 # Doesn't work on Windows anyway 292 #else: 293 # s = s + ' 2> /dev/null' #Suppress warnings 285 294 286 295 try: 287 296 err=os.system(s) 288 297 if err != 0: 289 raise 'At empting to link %s failed - please try manually' %root1298 raise 'Attempting to link %s failed - please try manually' %root1 290 299 except: 291 300 raise 'Could not link %s - please try manually' %root1 … … 414 423 compile(filename) 415 424 except Exception, e: 416 print 'Could not compile C extension %s' %filename 425 msg = 'Could not compile C extension %s\n' %filename 426 msg += str(e) 427 raise Exception, msg 417 428 else: 418 429 print 'C extension %s OK' %filename
Note: See TracChangeset
for help on using the changeset viewer.