Changeset 5125
- Timestamp:
- Jan 6, 2022 3:26:31 PM (17 months ago)
- Files:
-
- 14 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIpath.py
r5069 r5125 782 782 783 783 def 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 ''' 784 791 if sys.platform == "win32": 785 792 prefix = 'win' … … 791 798 print(u'Unknown platform: '+sys.platform) 792 799 raise Exception('Unknown platform') 793 if 'arm' in platform.machine() :800 if 'arm' in platform.machine() and platform.architecture()[0] == '64bit': 794 801 bits = 'arm' 802 elif 'arm' in platform.machine(): 803 bits = 'arm32' 795 804 elif platform.architecture()[0] == '64bit': 796 805 bits = '64' … … 804 813 pyver = 'p{}.{}'.format(*sys.version_info[0:2]) 805 814 806 items = [prefix,bits,pyver] 807 return '_'.join(items) 815 return '_'.join([prefix,bits,pyver]) 808 816 809 817 def svnList(URL,verbose=True): -
trunk/fsource/SConstruct
r5007 r5125 5 5 # know the details of what OS, compiler and python you are using as well as the command-line 6 6 # options you need. 7 from __future__ import division, print_function 7 8 import platform 8 9 import sys … … 41 42 print(u'Unknown platform: '+sys.platform) 42 43 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': 44 45 bits = 'arm' 46 elif 'arm' in platform.machine(): 47 bits = 'arm32' 45 48 elif platform.architecture()[0] == '64bit': 46 49 bits = '64' 47 50 else: 48 51 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)] 51 55 return '_'.join([prefix,bits,pyver,npver]) 52 56 #========================================================================================== … … 61 65 for pth in [F2PYpath,spath,os.path.normpath(os.path.join(spath,'..')),os.path.join(spath,'Scripts')]: 62 66 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 63 75 if sys.platform == "win32": 64 76 program = 'f2py.exe' … … 207 219 (builds into ../bin<platform-dir> for module distribution) 208 220 """) 209 #sys.exit()221 sys.exit() 210 222 #========================================================================================== 211 223 # override from command-line options … … 220 232 # then run it to get info about the verision and the number of bits 221 233 pythonpath = '' 222 for program in ['python ','../python']:234 for program in ['python3','../python3','python','../python']: 223 235 if sys.platform == "win32" and os.path.splitext(program)[1].lower() != '.exe': 224 236 program = program + '.exe' … … 230 242 print ('python not found') 231 243 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])) 244 p = subprocess.Popen(pythonprogram, stdout=subprocess.PIPE, stdin=subprocess.PIPE) 245 p.stdin.write(""" 246 import sys,platform; 247 print (str(sys.version_info[0])) 248 print (str(sys.version_info[1])) 249 print (platform.architecture()[0]) 250 import numpy as np 251 print(np.__version__) 252 sys.exit()""") 253 p.stdin.close() 254 p.wait() 255 pyVersions = p.stdout.readlines() 256 #pyVersions = platform.python_version_tuple() 257 version = str(int(pyVersions[0])) + '.' + str(int(pyVersions[1])) 239 258 PlatformBits = '64bits' 240 259 if 'arm' in platform.machine() and sys.platform == "darwin": 241 260 PlatformBits = 'arm' 242 if '32' in platform.architecture()[0]: 261 elif 'arm' in platform.machine() and '32' in platform.architecture()[0]: 262 PlatformBits = 'arm32' 263 elif 'arm' in platform.machine(): 264 PlatformBits = 'arm' 265 elif '32' in platform.architecture()[0]: 243 266 PlatformBits = '32bits' 244 #PlatformBits = versions[2][:-1]267 #PlatformBits = pyVersions[2][:-1] 245 268 # 246 269 # Set install location … … 257 280 if FORTflags == "": FORTflags = ' -w -O2 -fPIC -m64' 258 281 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"' 259 285 elif sys.platform.startswith("linux"): 260 286 if FORTflags == "": FORTflags = ' -w -O2 -fPIC -m32' … … 387 413 for mod in modlist: print (" " + mod,) 388 414 print ("") 415 print ('Use "scons help" to see build options') 389 416 print (80*'=') 390 417 #print (env.Dump()) 391 418 if 'help' in COMMAND_LINE_TARGETS: sys.exit() 392 if not os.path.exists(InstallLoc) :419 if not os.path.exists(InstallLoc) and not GetOption('no_exec'): 393 420 import datetime 394 421 print('Creating '+InstallLoc) 395 422 os.makedirs(InstallLoc) 423 if not GetOption('no_exec'): 396 424 fp = open(os.path.join(InstallLoc,'Build.notes.txt'),'w') 397 425 fp.write('Created {} on {}\n'.format(datetime.datetime.isoformat(datetime.datetime.now()),
Note: See TracChangeset
for help on using the changeset viewer.