Changeset 1357


Ignore:
Timestamp:
May 20, 2014 11:15:02 PM (10 years ago)
Author:
toby
Message:

more 64-bit stuff; fix OS X install

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/fsource/SConstruct

    r1148 r1357  
    201201if FCompiler == 'gfortran':
    202202    if FORTpath == "": FORTpath = GFORTpath
    203     if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check"'
    204 #    if sys.platform == "linux2":
    205 #        if FORTflags == "": FORTflags = ' -w -O2 -fPIC'
    206203    if sys.platform == "linux2" and PlatformBits == '64bit':
    207204        if FORTflags == "": FORTflags = ' -w -O2 -fPIC -m64'
     205        if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m64"'# --arch="-arch x86_64"'
    208206    elif sys.platform == "linux2":
    209207        if FORTflags == "": FORTflags = ' -w -O2 -fPIC -m32'
     208        if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m32"'
     209    elif sys.platform == "darwin" and PlatformBits == '64bit':
     210        LDFLAGS += " -arch x86_64 -m64"
     211        if FORTflags == "": FORTflags = ' -w -O2 -m64'
     212        if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m64"'
     213    elif sys.platform == "darwin":
     214        if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m32"'
    210215elif FCompiler == 'g77':
    211216    if FORTpath == "": FORTpath = G77path
  • trunk/makeMacApp.py

    r1356 r1357  
    133133
    134134    # find the python application; must be an OS X app
    135     pythonpath,top = os.path.split(os.path.realpath(sys.executable))
     135    pythonpath = os.path.realpath(sys.executable)
     136    top = True
    136137    while top:
    137         if 'Resources' in pythonpath:
    138             pass
    139         elif os.path.exists(os.path.join(pythonpath,'Resources')):
    140             break
     138        pythonapp = os.path.join(pythonpath,'Resources','Python.app','Contents','MacOS','Python')
     139        if os.path.exists(pythonapp): break
    141140        pythonpath,top = os.path.split(pythonpath)
    142         pythonapp = os.path.join(pythonpath,'Resources','Python.app','Contents','MacOS','Python')
    143         if not os.path.exists(pythonapp):
    144             print("\nSorry, failed to find a Python app in "+str(pythonapp))
    145             pythonapp = sys.executable
    146141    else:
    147142        print("\nSorry, failed to find a Resources directory associated with "+str(sys.executable))
    148143        pythonapp = sys.executable
    149 
     144   
    150145    # create a link to the python app, but named to match the project
    151146    if os.path.exists('/tmp/testpython'): os.remove('/tmp/testpython')
     
    156151    #print testout,errout
    157152    if testout.strip() != "OK":
    158         print 'Run of python app failed, assuming Canopy <=1.4'
     153        print 'Run of python app failed, resorting to non-app version of Python, Alas!'
    159154        pythonapp = sys.executable
    160         # switch to pythonw
    161         if os.path.split(pythonapp)[1].lower() == 'python':
    162             pythonapp = os.path.join(os.path.split(pythonapp)[0],'pythonw')
     155        # is this brain-dead Canopy 1.4.0, if so, switch to pythonw
     156        try:
     157            import canopy.version
     158            if canopy.version.version == '1.4.0':
     159                print 'using pythonw for Canopy 1.4.0'
     160                pythonapp = os.path.join(os.path.split(pythonapp)[0],'pythonw')
     161                if not os.path.exists(pythonapp):
     162                    raise Exception('no pythonw here: '+pythonapp)
     163        except ImportError:
     164            pass
    163165        newpython = pythonapp
    164166    else:
     
    166168        newpython =  os.path.join(apppath,"Contents","MacOS",project)
    167169
    168     print sys.executable
    169     print newpython
    170     print pythonapp
    171     #sys.exit()
    172    
    173170    if os.path.exists(apppath): # cleanup
    174171        print("\nRemoving old "+project+" app ("+str(apppath)+")")
Note: See TracChangeset for help on using the changeset viewer.