Changeset 5125


Ignore:
Timestamp:
Jan 6, 2022 3:26:31 PM (17 months ago)
Author:
toby
Message:

successful Raspberry Pi install

Files:
14 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpath.py

    r5069 r5125  
    782782
    783783def GetBinaryPrefix(pyver=None):
     784    '''Creates the first part of the binary directory name
     785    such as linux_64_p3.9 (where the full name will be
     786    linux_64_p3.9_n1.21).
     787
     788    Note that any change made here is also needed in GetBinaryDir in
     789    fsource/SConstruct
     790    '''
    784791    if sys.platform == "win32":
    785792        prefix = 'win'
     
    791798        print(u'Unknown platform: '+sys.platform)
    792799        raise Exception('Unknown platform')
    793     if 'arm' in platform.machine():
     800    if 'arm' in platform.machine() and platform.architecture()[0] == '64bit':
    794801        bits = 'arm'
     802    elif 'arm' in platform.machine():
     803        bits = 'arm32'
    795804    elif platform.architecture()[0] == '64bit':
    796805        bits = '64'
     
    804813        pyver = 'p{}.{}'.format(*sys.version_info[0:2])
    805814
    806     items = [prefix,bits,pyver]
    807     return '_'.join(items)
     815    return '_'.join([prefix,bits,pyver])
    808816
    809817def svnList(URL,verbose=True):
  • trunk/fsource/SConstruct

    r5007 r5125  
    55# know the details of what OS, compiler and python you are using as well as the command-line
    66# options you need.
     7from __future__ import division, print_function
    78import platform
    89import sys
     
    4142        print(u'Unknown platform: '+sys.platform)
    4243        raise Exception('Unknown platform')
    43     if 'arm' in platform.machine() and sys.platform == "darwin":
     44    if 'arm' in platform.machine() and platform.architecture()[0] == '64bit':
    4445        bits = 'arm'
     46    elif 'arm' in platform.machine():
     47        bits = 'arm32'
    4548    elif platform.architecture()[0] == '64bit':
    4649        bits = '64'
    4750    else:
    4851        bits = '32'
    49     pyver = 'p{}.{}'.format(*sys.version_info[0:2])
    50     npver = 'n' + np.__version__[:np.__version__.find('.',2)]
     52    pyver = 'p{}.{}'.format(pyVersions[0].strip(),pyVersions[1].strip())
     53    #pyver = 'p{}.{}'.format(*sys.version_info[0:2])
     54    npver = 'n' + pyVersions[3][:pyVersions[3].find('.',2)]
    5155    return '_'.join([prefix,bits,pyver,npver])
    5256#==========================================================================================
     
    6165for pth in [F2PYpath,spath,os.path.normpath(os.path.join(spath,'..')),os.path.join(spath,'Scripts')]:
    6266    if not pth: continue
     67    if sys.platform == "win32":
     68        program = 'f2py3.exe'
     69    else:
     70        program = 'f2py3'
     71    f2pyprogram = os.path.join(pth,program)
     72    if is_exe(f2pyprogram):
     73        F2PYpath,F2PYprog = os.path.split(f2pyprogram)
     74        break
    6375    if sys.platform == "win32":
    6476        program = 'f2py.exe'
     
    207219       (builds into ../bin<platform-dir> for module distribution)
    208220    """)
    209     #sys.exit()
     221    sys.exit()
    210222#==========================================================================================
    211223# override from command-line options
     
    220232# then run it to get info about the verision and the number of bits
    221233pythonpath = ''
    222 for program in ['python','../python']:
     234for program in ['python3','../python3','python','../python']:
    223235    if sys.platform == "win32" and os.path.splitext(program)[1].lower() != '.exe':
    224236        program = program + '.exe'
     
    230242    print ('python not found')
    231243    sys.exit()
    232 #p = subprocess.Popen(pythonprogram, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
    233 #p.stdin.write("import sys,platform;print (str(sys.version_info[0]));print (str(sys.version_info[1]));print (platform.architecture()[0]);sys.exit()")
    234 #p.stdin.close()
    235 #p.wait()
    236 #versions = p.stdout.readlines()
    237 versions = platform.python_version_tuple()
    238 version = str(int(versions[0])) + '.' + str(int(versions[1]))
     244p = subprocess.Popen(pythonprogram, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
     245p.stdin.write("""
     246import sys,platform;
     247print (str(sys.version_info[0]))
     248print (str(sys.version_info[1]))
     249print (platform.architecture()[0])
     250import numpy as np
     251print(np.__version__)
     252sys.exit()""")
     253p.stdin.close()
     254p.wait()
     255pyVersions = p.stdout.readlines()
     256#pyVersions = platform.python_version_tuple()
     257version = str(int(pyVersions[0])) + '.' + str(int(pyVersions[1]))
    239258PlatformBits = '64bits'
    240259if 'arm' in platform.machine() and sys.platform == "darwin":
    241260   PlatformBits = 'arm'
    242 if '32' in platform.architecture()[0]:
     261elif 'arm' in platform.machine() and '32' in platform.architecture()[0]:
     262   PlatformBits = 'arm32'
     263elif 'arm' in platform.machine():
     264   PlatformBits = 'arm'
     265elif '32' in platform.architecture()[0]:
    243266   PlatformBits = '32bits'
    244 #PlatformBits = versions[2][:-1]
     267#PlatformBits = pyVersions[2][:-1]
    245268#
    246269# Set install location
     
    257280        if FORTflags == "": FORTflags = ' -w -O2 -fPIC -m64'
    258281        if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m64"' # --arch="-arch x86_64"'
     282    elif sys.platform.startswith("linux") and 'arm' in platform.machine():
     283        if FORTflags == "": FORTflags = ' -w -O2 -fPIC'
     284        if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check"'
    259285    elif sys.platform.startswith("linux"):
    260286        if FORTflags == "": FORTflags = ' -w -O2 -fPIC -m32'
     
    387413for mod in modlist: print (" " + mod,)
    388414print ("")
     415print ('Use "scons help" to see build options')
    389416print (80*'=')
    390417#print (env.Dump())
    391418if 'help' in COMMAND_LINE_TARGETS: sys.exit()
    392 if not os.path.exists(InstallLoc):
     419if not os.path.exists(InstallLoc) and not GetOption('no_exec'):
    393420    import datetime
    394421    print('Creating '+InstallLoc)
    395422    os.makedirs(InstallLoc)
     423if not GetOption('no_exec'):
    396424    fp = open(os.path.join(InstallLoc,'Build.notes.txt'),'w')
    397425    fp.write('Created {} on {}\n'.format(datetime.datetime.isoformat(datetime.datetime.now()),
Note: See TracChangeset for help on using the changeset viewer.