Ignore:
Timestamp:
Jun 22, 2021 11:24:07 AM (21 months ago)
Author:
toby
Message:

move hist/phase docs to Phase/Data? section; cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fsource/SConstruct

    r3674 r4969  
    4141        print(u'Unknown platform: '+sys.platform)
    4242        raise Exception('Unknown platform')
    43     if platform.architecture()[0] == '64bit':
     43    if 'arm' in platform.machine():
     44        bits = 'arm'
     45    elif platform.architecture()[0] == '64bit':
    4446        bits = '64'
    4547    else:
     
    5153# misc initializations
    5254# need command-line options for fortran command and fortran options
    53 F2PYflags = '' # compiler options for f2py command
     55#F2PYflags = '' # compiler options for f2py command
     56F2PYflags = '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include' # compiler options for f2py command
    5457F2PYpath = ARGUMENTS.get('F2PYpath', '')
    5558# find a default f2py relative to the scons location. Should be in the same place as f2py
     
    9598FORTflags = ""
    9699LDFLAGS = ''
     100SDKROOT = ''
    97101tmpdir = None
    98102#==========================================================================================
     
    109113elif sys.platform == "darwin":
    110114    LDFLAGS = '-undefined dynamic_lookup -bundle'
     115    SDKROOT = os.environ['SDKROOT']
    111116    F2PYsuffix = '.so'
    112117elif sys.platform.startswith("linux"):
     
    232237version = str(int(versions[0])) + '.' + str(int(versions[1]))
    233238PlatformBits = '64bits'
     239if 'arm' in platform.machine():
     240   PlatformBits = 'arm'
    234241if '32' in platform.architecture()[0]:
    235242   PlatformBits = '32bits'
     
    248255    if sys.platform.startswith("linux") and "64" in PlatformBits:
    249256        if FORTflags == "": FORTflags = ' -w -O2 -fPIC -m64'
    250         if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m64"'# --arch="-arch x86_64"'
     257        if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m64"' # --arch="-arch x86_64"'
    251258    elif sys.platform.startswith("linux"):
    252259        if FORTflags == "": FORTflags = ' -w -O2 -fPIC -m32'
    253260        if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m32"'
    254261    elif sys.platform == "darwin": # now 64 bit only
    255         #if "64" in PlatformBits:
    256         LDFLAGS += " -arch x86_64 -m64"
    257         if FORTflags == "": FORTflags = ' -w -O2 -m64'
    258         if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m64"'
     262        if 'arm' in PlatformBits:
     263            #LDFLAGS += " -arch x86_64 -m64"
     264            if FORTflags == "": FORTflags = ' -w -O2'
     265            if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check"'
     266        else:
     267            LDFLAGS += " -arch x86_64 -m64"
     268            if FORTflags == "": FORTflags = ' -w -O2 -m64'
     269            if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m64"'
    259270    elif sys.platform == "win32" and "64" in PlatformBits:
    260271        if FORTflags == "": FORTflags = ' -w -O2 -m64'
     
    328339if pythonpath != "" and pythonpath != F2PYpath: env.PrependENVPath('PATH', pythonpath)
    329340#   add other needed environment variables
    330 var = 'LDFLAGS'
    331 if eval(var) != "":
    332     env['ENV'][var] = eval(var)
    333     print("Setting environment variable {} to {}".format(var,eval(var)))
     341for var in ('LDFLAGS','SDKROOT'):
     342    if eval(var) != "":
     343       env['ENV'][var] = eval(var)
     344       print("Setting environment variable {} to {}".format(var,eval(var)))
    334345if 'WINDIR' in os.environ: env['ENV']['WINDIR'] = os.environ['WINDIR']
    335346
     
    355366modlist = []
    356367for src in glob.glob('*.for'):
    357     target = os.path.splitext(src)[0] + F2PYsuffix
     368    target = os.path.splitext(src)[0] + F2PYsuffix # xxx.pyd or xxx.so
    358369    out = env.f2py(target,src)
    359370    Clean(out, Glob(os.path.splitext(src)[0] + "*" + F2PYsuffix)) # this picks up old- & new-style .pyd/.so names
Note: See TracChangeset for help on using the changeset viewer.