source: trunk1/pbs_swig/distro/setup.py.in @ 120

Last change on this file since 120 was 110, checked in by bas, 18 years ago

distro:

  • New release 2.9.0
  • New build system for torque 2.1.0 and higher
File size: 1.5 KB
Line 
1#!/usr/bin/env python
2#
3# $Id: setup.py 434 2005-11-04 15:02:07Z bas $
4#
5# set ts=4
6#
7
8import sys
9import os
10
11from distutils.core import setup, Extension
12
13# Try some usefule defaults if not set
14#
15PBS_LIB_DIR='@pbspath@'
16NEW_BUILD_SYSTEM=1
17
18if not PBS_LIB_DIR:
19        for dir in ['/usr/lib', '/usr/local/lib', '/opt/pbs/usr/lib', '/usr/lib/torque', '/opt/pbs/lib', '/opt/torque/lib' ]:
20                dummy_new = os.path.join(dir, 'libtorque.so')
21                dummy_old = os.path.join(dir, 'libpbs.a')
22                if os.path.exists(dummy_new):
23                        PBS_LIB_DIR=dir
24                        break
25                elif os.path.exists(dummy_old):
26                        PBS_LIB_DIR=dir
27                        NEW_BUILD_SYSTEM=0
28                        break
29
30if not PBS_LIB_DIR:
31        print 'Please specify where the PBS libraries are!!'
32        print 'edit setup.py and fill in the PBS_LIB_DIR variable'
33        sys.exit(1)
34
35# Test if we have all the libs:
36#
37if NEW_BUILD_SYSTEM:
38        LIBS = ['torque']
39else:
40        LIBS = ['log', 'net', 'pbs']
41        for lib in LIBS:
42                library = 'lib%s.a' %(lib)
43                dummy = os.path.join(PBS_LIB_DIR, library)
44        if not os.path.exists(dummy):
45                        print 'You need to install "%s" in %s' %(library, PBS_LIB_DIR)
46                        sys.exit(1)
47
48setup ( name = 'pbs_python',
49        version = '2.9.0',
50        description = 'openpbs/torque python interface',
51        author = 'Bas van der Vlies',
52        author_email = 'basv@sara.nl',
53        url = 'http://www.sara.nl/index_eng.html',
54
55        extra_path = 'pbs',
56                package_dir = { '' : 'src' }, 
57                py_modules = [ 'pbs', 'PBSQuery' ], 
58
59        ext_modules = [ 
60                Extension( '_pbs', ['src/pbs_wrap.c'],
61                library_dirs = [ PBS_LIB_DIR ],
62                libraries = LIBS) 
63        ]
64)
Note: See TracBrowser for help on using the repository browser.