Changeset 300 for trunk/setup.py.in
- Timestamp:
- 01/17/14 14:01:25 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/setup.py.in
r295 r300 8 8 import sys 9 9 import os 10 import glob 10 11 11 12 from distutils.core import setup, Extension 13 from distutils.version import LooseVersion 12 14 13 15 # Strip off the -L it is also added by the python setup tools … … 23 25 LIBS = ['torque'] 24 26 25 ### Make symlinks to right torque version26 #27 27 VERSION = "@pbs_version@" 28 tmp = VERSION.split('.') 28 SOURCE_DIR='src' 29 29 30 major_version = int(tmp[0]) 31 minor_version = int(tmp[1]) 32 #build_version = int(tmp[2]) 33 build_version = int(tmp[2].split('-')[0]) 30 os.chdir(SOURCE_DIR) 34 31 35 36 os.chdir('src')37 38 ## Always unlink previous links39 #40 32 try: 41 33 os.unlink('pbs.py') 42 os.unlink('pbs_wrap.c')43 34 except OSError: 44 35 pass 45 36 46 if major_version >= 2 and minor_version >= 4 and build_version >= 7: 47 os.symlink('pbs_wrap_2.4.c', 'pbs_wrap.c') 48 os.symlink('pbs_2.4.py', 'pbs.py') 49 TORQUE_VERSION='TORQUE_2_4' 37 if LooseVersion(VERSION) >= LooseVersion('4.2'): 38 39 inc=os.environ.get('PBS_PYTHON_INCLUDEDIR','/usr/include/torque') 40 os.environ['CC']='g++' 41 os.environ['CFLAGS']=' '.join(os.environ.get('CFLAGS','').split(' ')+['-I%s'%inc]) 42 43 if not os.path.exists(os.path.join(inc,'log.h')): 44 print 'Failed to find log.h in inlcude dir %s. (Set incude dir via PBS_PYTHON_INCLUDEDIR variable)'%inc 45 sys.exit(2) 46 47 for fn in glob.glob('*.h'): 48 os.remove(fn) 49 50 TORQUE_VERSION='TORQUE_4' 51 SOURCE_FILE='src/C++/pbs_wrap.cxx' 52 53 os.symlink('C++/pbs.py', 'pbs.py') 54 55 elif LooseVersion(VERSION) >= LooseVersion('2.4'): 56 57 TORQUE_VERSION='TORQUE_2' 58 SOURCE_FILE='src/C/pbs_wrap.c' 59 60 os.symlink('C++/pbs.py', 'pbs.py') 61 50 62 else: 51 os.symlink('pbs_wrap_2.1.c', 'pbs_wrap.c') 52 os.symlink('pbs_2.1.py', 'pbs.py') 53 TORQUE_VERSION='TORQUE_OLD' 63 64 print "Version: %s is not supported" %(VERSION) 65 sys.exit(1) 66 54 67 55 68 os.chdir('..') … … 57 70 setup ( 58 71 name = 'pbs_python', 59 version = '4. 3.6',72 version = '4.8.0', 60 73 description = 'openpbs/torque python interface', 61 74 license = 'LGPLV3', … … 66 79 67 80 extra_path = 'pbs', 68 package_dir = { '' : 'src'},69 py_modules = [ 'pbs', 'PBSQuery', 'PBSAdvancedParser'],81 package_dir = { '' : SOURCE_DIR }, 82 py_modules = [ 'pbs', 'PBSQuery'], 70 83 71 84 ext_modules = [ 72 Extension( '_pbs', [ 'src/pbs_wrap.c'],85 Extension( '_pbs', [SOURCE_FILE], 73 86 library_dirs = [ PBS_LIB_DIR ], 74 87 extra_link_args = [ PBS_LIB_COMPILE_LINE ],
Note: See TracChangeset
for help on using the changeset viewer.