Changeset 316


Ignore:
Timestamp:
Jun 28, 2011 1:02:15 PM (10 years ago)
Author:
toby
Message:

scons fixes; copy win options from batch file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fsource/SConstruct

    r315 r316  
    2828FORTpath = which_path('gfortran')   # default path to compiler
    2929ENVvars = {}
     30SCONSvars = {}
    3031liblist = []
    3132#==========================================================================================
     
    3435    F2PYsuffix = '.pyd'
    3536    FORTpath = which_path('g77')   # default path to compiler
    36 if sys.platform == "darwin":
     37    F2PYflags = '--compiler=mingw32 --fcompiler=gnu'
     38    SCONSvars['FORTRANFLAGS'] = ' -w -O2 -fno-automatic -finit-local-zero -malign-double -mwindows'
     39elif sys.platform == "darwin":
    3740    ENVvars['LDFLAGS'] = '-undefined dynamic_lookup -bundle -static-libgfortran -static-libgcc'
    3841    F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check"'
     
    5659var = 'LDFLAGS'
    5760if ARGUMENTS.get(var, None) is not None:
    58     print 'Setting LDFLAGS environment vafiable to',ARGUMENTS.get(var),'based on command line'
     61    print 'Setting '+var+' environment variable to',ARGUMENTS.get(var),'based on command line'
    5962    ENVvars[var] = ARGUMENTS.get(var)
    60            
    61 
     63var = 'FORTRANFLAGS'
     64if ARGUMENTS.get(var, None) is not None:
     65    print 'Setting '+var+' internal variable to',ARGUMENTS.get(var),'based on command line'
     66    SCONSvars[var] = ARGUMENTS.get(var)
    6267#==========================================================================================
    6368
     
    8893    InstallLoc = '../' + prefix + bits + version
    8994    Alias('install',InstallLoc)
    90 elif 'help' in COMMAND_LINE_TARGETS:
     95if 'help' in COMMAND_LINE_TARGETS:
    9196    print """
    9297Building Fortran routines for use with GSAS-II
     
    126131
    127132LDFLAGS='string'   -- string of options to be used for f2py during link step
     133
     134FORTRANFLAGS='string'  -- string of options to be used for Fortran
     135   during library build step
    128136
    129137Note that at present, only 32-bit python is supported and python 3.x is
     
    139147    """
    140148    sys.exit()
    141 #else:
    142 #    raise Exception, 'Unknown scons option(s): ' + str(COMMAND_LINE_TARGETS)
    143149
    144150# commands needed to run f2py
     
    155161#for path in PATH:
    156162#    env.PrependENVPath('PATH', path)
    157 for envvar in ENVvars:
    158     env['ENV'][envvar] = ENVvars[envvar]
    159 
     163for var in ENVvars:
     164    env['ENV'][var] = ENVvars[var]
     165for var in SCONSvars:
     166    env[var] = ENVvars[var]
     167
     168# for testing
    160169#out = env.f2py('fellipse.for')
    161170#filename = str(out[0])
Note: See TracChangeset for help on using the changeset viewer.