Changeset 4439
- Timestamp:
- May 26, 2020 9:34:42 AM (5 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified install/g2complete/build.sh ¶
r3924 r4439 8 8 mkdir -p $PREFIX/GSASII 9 9 cp $RECIPE_DIR/src/bootstrap.py $PREFIX/GSASII 10 python $PREFIX/GSASII/bootstrap.py -- noproxy --noinstall10 python $PREFIX/GSASII/bootstrap.py --binary=1.18 >> $HOME/build_log.txt -
TabularUnified install/g2complete/meta.yaml.template ¶
r4407 r4439 18 18 - pillow 19 19 - pyopengl 20 - wxpython>=4. 020 - wxpython>=4. 21 21 - svn 22 22 - hdf5 -
TabularUnified install/g2complete/src/bootstrap.py ¶
r4376 r4439 9 9 path2GSAS2 = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) 10 10 11 skipInstallSteps = False 12 skipDownloadSteps = False 13 skipProxy = False 14 showWXerror = False 15 help = False 16 allBinaries = False 11 skipInstallChecks = False # if set to True, continue installation even if current Python lacks packages and 12 # skips platform-dependent installation steps 13 skipDownloadSteps = False # if False, svn is used to download GSAS-II files and binaries 14 skipProxy = False # if False then the script creates a prompt asking for proxy info 15 showWXerror = False # if True, errors are shown in wxPython windows (used on Windows only) 16 help = False # if True, a help message is shown 17 allBinaries = False # if True, causes all binaries to be installed 18 binaryVersion=None # if specified, gives a specific numpy version to use (such as 1.18) 19 # for selecting a set of binaries to use 20 17 21 for a in sys.argv[1:]: 18 22 if 'noinstall' in a.lower(): 19 skipInstall Steps = True23 skipInstallChecks = True 20 24 if sys.platform.startswith('win'): showWXerror = True 21 25 elif 'nonet' in a.lower(): … … 24 28 elif 'noproxy' in a.lower(): 25 29 skipProxy = True 26 elif 'help' in a.lower():27 help = True28 30 elif 'allbin' in a.lower() or 'server' in a.lower(): 29 31 allBinaries = True 32 elif 'binary' in a.lower(): 33 numpyVersion = a.split('=')[1] 34 skipInstallChecks = True 35 if sys.platform.startswith('win'): showWXerror = True 36 skipProxy = True 30 37 else: 38 help = True 39 if 'help' in a.lower(): 31 40 help = True 32 41 … … 35 44 bootstrap.py options: 36 45 37 --noinstall skip post-install, such as creating run shortcuts 38 --noproxy do not ask for proxy information 39 --server load all binary versions 40 --allbin load all binary versions (same as --server) 41 --help this message 42 --nonet skip steps requiring internet 43 46 --noinstall skip post-install, such as creating run shortcuts, turns on 47 wxpython error display in Windows 48 --noproxy do not ask for proxy information 49 --server load all binary versions 50 --allbin load all binary versions (same as --server) 51 --help this message 52 --nonet skip steps requiring internet 53 --binary=ver specifies a specific numpy binary directory to use (such as 54 --binary=1.18); turns on --noinstall and --noproxy 44 55 ''') 45 56 sys.exit() … … 47 58 now = str(datetime.datetime.now()) 48 59 print('Running bootstrap from {} at {}\n\tId: {}'.format(path2GSAS2,now,version)) 60 print ("Python: %s"%sys.version.split()[0]) 61 try: 62 import numpy as np 63 print ("numpy: %s"%np.__version__) 64 except: 65 pass 49 66 fp = open(os.path.join(path2GSAS2,'bootstrap.log'),'a') 50 67 fp.write('Running bootstrap from {} at {}\n\tId: {}\n'.format(path2GSAS2,now,version)) … … 251 268 missing.append(pkg) 252 269 253 if missing and not skipInstall Steps:270 if missing and not skipInstallChecks: 254 271 msg = """Sorry, this version of Python cannot be used 255 272 for GSAS-II. It is missing the following package(s): … … 379 396 except Exception as err: 380 397 print('Error writing file {}:\n{}'.format(proxyinfo,err)) 398 381 399 if not skipDownloadSteps: 382 400 # patch: switch GSAS-II location if linked to XOR server (relocated May/June 2017) … … 465 483 print('\n'+75*'*') 466 484 485 # subsequent commands require GSASIIpath which better be here now, import it 467 486 try: 468 487 import GSASIIpath … … 473 492 BailOut(msg) 474 493 475 if allBinaries and not skipDownloadSteps: 494 if skipDownloadSteps: 495 pass 496 elif allBinaries: 476 497 print('Loading all binaries with command...') 477 498 if not GSASIIpath.svnSwitchDir('AllBinaries','',g2home+ 'Binaries/',None,True): 478 499 msg = 'Binary load failed. Subversion problem? Please seek help' 479 500 BailOut(msg) 501 elif numpyVersion: 502 binaryVersion = GSASIIpath.GetBinaryPrefix()+'n'+numpyVersion 503 if not GSASIIpath.svnSwitchDir('bindist','',g2home+ 'Binaries/'+binaryVersion,None,True): 504 msg = 'Binary load failed with '+binaryVersion+'. Subversion problem? Please seek help' 505 BailOut(msg) 480 506 else: 481 507 GSASIIpath.DownloadG2Binaries(g2home) … … 484 510 # test if the compiled files load correctly 485 511 #=========================================================================== 486 487 script = """ # commands that test each module can at least be loaded & run something in pyspg488 try:489 import GSASIIpath490 GSASIIpath.SetBinaryPath(loadBinary=False)491 import pyspg492 import histogram2d493 import polymask494 import pypowder495 import pytexture496 pyspg.sgforpy('P -1')497 print('==OK==')498 except Exception as err:499 print(err)500 """501 p = subprocess.Popen([sys.executable,'-c',script],stdout=subprocess.PIPE,stderr=subprocess.PIPE,502 cwd=path2GSAS2)503 res,err = MakeByte2str(p.communicate())504 if '==OK==' not in str(res) or p.returncode != 0:505 #print('\n'+75*'=')506 msg = 'Failed when testing the GSAS-II compiled files. GSAS-II will not run'507 msg += ' without correcting this.\n\nError message:\n'508 if res:509 msg += res510 msg += '\n'511 if err:512 msg += err513 #print('\nAttempting to open a web page on compiling GSAS-II...')514 msg += '\n\nPlease see web page\nhttps://subversion.xray.aps.anl.gov/trac/pyGSAS/wiki/CompileGSASII if you wish to compile for yourself (usually not needed for windows and Mac, but sometimes required for Linux.)'515 BailOut(msg)516 #import webbrowser517 #webbrowser.open_new('https://subversion.xray.aps.anl.gov/trac/pyGSAS/wiki/CompileGSASII')518 #print(75*'=')519 # if '86' in platform.machine() and (sys.platform.startswith('linux')520 # or sys.platform == "darwin"521 # or sys.platform.startswith('win')):522 # print('Platform '+sys.platform+' with processor type '+platform.machine()+' is supported')523 # else:524 # print('Platform '+sys.platform+' with processor type '+platform.machine()+' not is supported')525 else:526 print('Successfully tested compiled routines')512 if not skipInstallChecks: 513 script = """ # commands that test each module can at least be loaded & run something in pyspg 514 try: 515 import GSASIIpath 516 GSASIIpath.SetBinaryPath(loadBinary=False) 517 import pyspg 518 import histogram2d 519 import polymask 520 import pypowder 521 import pytexture 522 pyspg.sgforpy('P -1') 523 print('==OK==') 524 except Exception as err: 525 print(err) 526 """ 527 p = subprocess.Popen([sys.executable,'-c',script],stdout=subprocess.PIPE,stderr=subprocess.PIPE, 528 cwd=path2GSAS2) 529 res,err = MakeByte2str(p.communicate()) 530 if '==OK==' not in str(res) or p.returncode != 0: 531 #print('\n'+75*'=') 532 msg = 'Failed when testing the GSAS-II compiled files. GSAS-II will not run' 533 msg += ' without correcting this.\n\nError message:\n' 534 if res: 535 msg += res 536 msg += '\n' 537 if err: 538 msg += err 539 #print('\nAttempting to open a web page on compiling GSAS-II...') 540 msg += '\n\nPlease see web page\nhttps://subversion.xray.aps.anl.gov/trac/pyGSAS/wiki/CompileGSASII if you wish to compile for yourself (usually not needed for windows and Mac, but sometimes required for Linux.)' 541 BailOut(msg) 542 #import webbrowser 543 #webbrowser.open_new('https://subversion.xray.aps.anl.gov/trac/pyGSAS/wiki/CompileGSASII') 544 #print(75*'=') 545 # if '86' in platform.machine() and (sys.platform.startswith('linux') 546 # or sys.platform == "darwin" 547 # or sys.platform.startswith('win')): 548 # print('Platform '+sys.platform+' with processor type '+platform.machine()+' is supported') 549 # else: 550 # print('Platform '+sys.platform+' with processor type '+platform.machine()+' not is supported') 551 else: 552 print('Successfully tested compiled routines') 527 553 #=========================================================================== 528 554 # import all .py files so that .pyc files get created 529 if not skipInstall Steps:555 if not skipInstallChecks: 530 556 print('Byte-compiling all .py files...') 531 557 import compileall … … 533 559 print('done') 534 560 #=========================================================================== 535 # platform-dependent stuff561 # do platform-dependent stuff 536 562 #=========================================================================== 537 563 if sys.version_info[0] > 2: … … 540 566 exec(source_file.read()) 541 567 542 if skipInstall Steps:568 if skipInstallChecks: 543 569 pass 544 570 #=========================================================================== -
TabularUnified trunk/GSASIIpath.py ¶
r4396 r4439 539 539 cmd = [svn,'switch',URL,fpath, 540 540 '--non-interactive','--trust-server-cert', 541 '--accept','theirs-conflict','--force' ]541 '--accept','theirs-conflict','--force','-rHEAD'] 542 542 if svnVersionNumber(svn) > 1.6: cmd += ['--ignore-ancestry'] 543 543 if proxycmds: cmd += proxycmds 544 if verbose: print(u"Loading files to "+fpath+u"\n from "+URL) 544 if verbose: 545 print(u"Loading files to "+fpath+u"\n from "+URL) 545 546 s = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE) 546 547 out,err = MakeByte2str(s.communicate()) … … 566 567 return False 567 568 if verbose: 568 print('=== Output from svn switch'+(43*'=')) 569 s = '\nsvn command: ' 570 for i in cmd: s += i + ' ' 571 print(s) 572 print('\n=== Output from svn switch'+(43*'=')) 569 573 print(out.strip()) 570 574 print((70*'=')+'\n')
Note: See TracChangeset
for help on using the changeset viewer.