Changeset c82cf89 in sasview


Ignore:
Timestamp:
May 1, 2018 8:16:02 AM (6 years ago)
Author:
wojciech
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
d2647feb
Parents:
f4161f7a
Message:

Forcing cc check at installation that should trigger Xcode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasview/sasview.py

    rf4161f7a rc82cf89  
    198198def check_sasmodels_compiler(): 
    199199    """ 
    200     Checking c compiler for sasmodels 
    201     """ 
    202     if sys.platform == "darwin" and not os.path.exists("/Library/Developer/CommandLineTools/usr/bin/cc"): 
    203         raise RuntimeError("No compiler. Open Terminal.app and type 'cc' at the command prompt for more instructions.") 
     200    Checking c compiler for sasmodels and trying to trigger xcode command line 
     201    for installation 
     202    """ 
     203    import subprocess 
     204    logger = logging.getLogger(__name__) 
     205    #if sys.platform == "darwin" and not\ 
     206    try: 
     207        # need shell=True on windows to keep console box from popping up 
     208        shell = (os.name == 'nt') 
     209        subprocess.check_output("cc", shell=shell, stderr=subprocess.STDOUT) 
     210    except subprocess.CalledProcessError: 
     211        raise RuntimeError("No compiler installed. Please follow installation instructions\n") 
    204212 
    205213def setup_sasmodels(): 
     
    225233    setup_sasmodels() 
    226234    setup_wx() 
    227     #check_sasmodels_compiler() 
     235    check_sasmodels_compiler() 
    228236    SasView() 
    229237 
Note: See TracChangeset for help on using the changeset viewer.