Changeset 5355
- Timestamp:
- Oct 23, 2022 8:49:57 PM (5 months ago)
- Location:
- trunk/fsource
- Files:
-
- 33 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/fsource/SConstruct
r5133 r5355 117 117 tmpdir = None 118 118 #========================================================================================== 119 EXEsuffix = '' 119 120 # configure platform dependent options here: 120 121 if sys.platform == "win32": 121 122 F2PYsuffix = '.pyd' 123 EXEsuffix = '.exe' 122 124 if G77path != "": 123 125 FCompiler='g77' … … 371 373 env.Append(BUILDERS = {'fort' : fort, 'lib' : lib},) 372 374 375 # Define a builder to compile and copy NIST*LATTICE programs 376 def generate_nist(source, target, env, for_signature): 377 #exe = os.path.splitext(str(source[0]))[0] + EXEsuffix 378 exe = target 379 # cmd = FCompiler + ' $SOURCE ' + NISTlib[0] + ' -o ' + exe 380 cmd = FCompiler + ' $SOURCE ' + NISTlib[0] + ' -o $TARGET' 381 if sys.platform == "win32": 382 installcmd = "copy $TARGET " + InstallLoc 383 else: 384 installcmd = "cp $TARGET " + InstallLoc 385 return [cmd, installcmd] 386 env.Append(BUILDERS = {'nist' : Builder(generator = generate_nist)},) 387 388 373 389 #========================================================================================== 374 390 # Setup build Environment … … 388 404 # locate libraries to be built (subdirectories named *subs) 389 405 liblist = [] 406 NISTlib = [] 390 407 for sub in glob.glob('*subs'): 391 408 filelist = [] 392 for file in glob.glob(os.path.join(sub,'*.for')) :409 for file in glob.glob(os.path.join(sub,'*.for'))+glob.glob(os.path.join(sub,'*.f')): 393 410 #target = os.path.splitext(file)[0]+'.o' 394 411 target = env.fort(file) # connect .o files to .for files … … 400 417 else: 401 418 lib = Library(sub, filelist) # register library to be created 402 liblist.append(lib[0].name) 419 if 'NIST' in lib[0].name: 420 NISTlib = [lib[0].name] 421 else: 422 liblist.append(lib[0].name) 403 423 filename = str(lib[0]) 424 425 # NIST*LATTICE programs 426 for src in 'LATTIC.f','convcell.f': 427 target = os.path.splitext(src)[0] + EXEsuffix 428 out = env.nist(target,src) 429 Clean(out, target) 430 Depends(target, NISTlib) # make sure library is rebuilt if old 431 404 432 # find modules that need to be built 405 433 modlist = [] 406 434 for src in glob.glob('*.for'): 435 #break # bail out early for testing 407 436 target = os.path.splitext(src)[0] + F2PYsuffix # xxx.pyd or xxx.so 408 437 out = env.f2py(target,src) … … 410 439 Depends(target, liblist) # make sure libraries are rebuilt if old 411 440 modlist.append(out[0].name) 412 #break # bail out early for testing413 441 #========================================================================================== 414 442 # all done with setup, show the user the options and let scons do the work
Note: See TracChangeset
for help on using the changeset viewer.