source: trunk/GSASIIpath.py @ 436

Last change on this file since 436 was 280, checked in by vondreele, 14 years ago

update binlinux2.6-64

  • Property svn:keywords set to Date Author Revision URL Id
File size: 1.4 KB
Line 
1# determine a binary path for the pyd files based on the host OS and the python version, 
2# path is relative to location of the script that is called as well as this file
3# this must be imported before anything that imports any .pyd/.so file for GSASII
4import os.path as ospath
5import sys
6import platform
7bindir = None
8if sys.platform == "win32":
9    if platform.architecture()[0] == '64bit':
10        bindir = 'binwin64-%d.%d' % sys.version_info[0:2]
11    else:
12        bindir = 'binwin%d.%d' % sys.version_info[0:2]
13elif sys.platform == "darwin":
14    bindir = 'binmac%d.%d' % sys.version_info[0:2]
15elif sys.platform == "linux2":
16    if platform.architecture()[0] == '64bit':
17        bindir = 'binlinux64-%d.%d' % sys.version_info[0:2]
18    else:
19        bindir = 'binlinux%d.%d' % sys.version_info[0:2]
20for loc in sys.path[0],ospath.split(__file__)[0]:
21    if bindir:
22        if ospath.exists(ospath.join(loc,bindir)) and ospath.join(loc,bindir) not in sys.path: 
23            sys.path.insert(0,ospath.join(loc,bindir))
24        # is there a bin directory? (created by a local compile), if so put
25        # that at the top of the path
26    if ospath.exists(ospath.join(loc,'bin')):
27        bindir = 'bin'
28        if ospath.join(loc,'bin') not in sys.path: 
29            sys.path.insert(0,ospath.join(loc,bindir))
30if bindir == None:
31    print "Warning GSAS-II binary libraries not found, some sections of code will not function"
Note: See TracBrowser for help on using the repository browser.