Changeset 1357
- Timestamp:
- May 20, 2014 11:15:02 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/fsource/SConstruct
r1148 r1357 201 201 if FCompiler == 'gfortran': 202 202 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'206 203 if sys.platform == "linux2" and PlatformBits == '64bit': 207 204 if FORTflags == "": FORTflags = ' -w -O2 -fPIC -m64' 205 if F2PYflags == "": F2PYflags = '--fcompiler=gnu95 --f77exec=gfortran --f77flags="-fno-range-check -m64"'# --arch="-arch x86_64"' 208 206 elif sys.platform == "linux2": 209 207 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"' 210 215 elif FCompiler == 'g77': 211 216 if FORTpath == "": FORTpath = G77path -
trunk/makeMacApp.py
r1356 r1357 133 133 134 134 # 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 136 137 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 141 140 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.executable146 141 else: 147 142 print("\nSorry, failed to find a Resources directory associated with "+str(sys.executable)) 148 143 pythonapp = sys.executable 149 144 150 145 # create a link to the python app, but named to match the project 151 146 if os.path.exists('/tmp/testpython'): os.remove('/tmp/testpython') … … 156 151 #print testout,errout 157 152 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!' 159 154 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 163 165 newpython = pythonapp 164 166 else: … … 166 168 newpython = os.path.join(apppath,"Contents","MacOS",project) 167 169 168 print sys.executable169 print newpython170 print pythonapp171 #sys.exit()172 173 170 if os.path.exists(apppath): # cleanup 174 171 print("\nRemoving old "+project+" app ("+str(apppath)+")")
Note: See TracChangeset
for help on using the changeset viewer.