Changeset 4741


Ignore:
Timestamp:
Jan 7, 2021 6:06:12 PM (3 years ago)
Author:
toby
Message:

deal with install python not matching target system

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • install/bootstrap.py

    r4739 r4741  
    2222allBinaries = False        # if True, causes all binaries to be installed
    2323                           #--> True: -allbinaries or -server
    24 numpyVersion=None          # if specified, gives a specific numpy version to use (such as 1.18)
     24
     25npVersion=None          # when set, gives a specific numpy version to use (such as 1.18)
    2526                           # for selecting a set of binaries to use
    2627                           #--> Set by: -binary=
     28
     29pyVersion=None             # when set, gives a specific Python version to use (such as 3.7)
     30                           # for selecting a set of binaries to use
     31                           #--> Set by: -binary=
     32
    2733
    2834for a in sys.argv[1:]:
     
    3844        allBinaries = True
    3945    elif 'binary' in a.lower():
    40         numpyVersion = a.split('=')[1]
     46        vers = a.split('=')[1].split(',')
     47        npVersion = vers[0]
     48        if len(vers) > 1:
     49            pyVersion = vers[1]
    4150        skipInstallChecks = True
    4251        if sys.platform.startswith('win'): showWXerror = True
     
    5867    --help        this message
    5968    --nonet       skip steps requiring internet
    60     --binary=ver  specifies a specific numpy binary directory to use (such as
    61                   --binary=1.18); turns on --noinstall and --noproxy
     69
     70    --binary=npver          specifies a specific numpy/python version to use in selecting
     71    --binary=npver,pyver    a binary directory to use ; turns on --noinstall and --noproxy
     72           (example --binary=1.18 or --binary=1.18,3.7)
     73           turns on --noinstall and --noproxy
    6274''')
    6375    sys.exit()
     
    587599        msg = 'Binary load failed. Subversion problem? Please seek help'
    588600        BailOut(msg)
    589 elif numpyVersion:
    590     binaryVersion = GSASIIpath.GetBinaryPrefix()+'_n'+numpyVersion
     601elif npVersion:
     602    binaryVersion = GSASIIpath.GetBinaryPrefix(pyver)+'_n'+npVersion
    591603    print('Load binaries from '+binaryVersion)
    592604    if not GSASIIpath.svnSwitchDir('bindist','',g2home+ 'Binaries/'+binaryVersion,None,True):
  • install/g2complete/build.sh.template

    r4738 r4741  
    88mkdir -p $PREFIX/GSASII
    99cp $RECIPE_DIR/src/bootstrap.py $PREFIX/GSASII
    10 python $PREFIX/GSASII/bootstrap.py --binary=**npversion** > $PREFIX/GSASII/conda_G2build_out.log 2>  $PREFIX/GSASII/conda_G2build_errors.log
     10python $PREFIX/GSASII/bootstrap.py --binary=**npversion**,**pyversion** > $PREFIX/GSASII/conda_G2build_out.log 2>&1
  • trunk/GSASIIpath.py

    r4740 r4741  
    751751    return updatecount,modcount,locked
    752752
    753 def GetBinaryPrefix():
     753def GetBinaryPrefix(pyver=None):
    754754    if sys.platform == "win32":
    755755        prefix = 'win'
     
    767767
    768768    # format current python version
    769     pyver = 'p{}.{}'.format(*sys.version_info[0:2])
     769    if pyver:
     770        pyver = 'p'+pyver
     771    else:
     772        pyver = 'p{}.{}'.format(*sys.version_info[0:2])
    770773
    771774    items = [prefix,bits,pyver]
Note: See TracChangeset for help on using the changeset viewer.