[Distutils] sample setup.py for SWIG'd extensions in a package.

Joe Van Andel vanandel@ucar.edu
Wed, 02 Feb 2000 14:44:40 -0700


This is a multi-part message in MIME format.
--------------13C833499F5ECA2F221B74E6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

If you are interested in a contribution to a HOWTO type document, here's
a setup.py I wrote for a set of extensions for radar processing.  The
package has 3 sub-packages: 'a1pp','rec', and 'util', with both .py
files and C++ extensions.  I use 'SWIG' to generate wrappers for my C++
classes, which generates a Python wrapper, and an extension.   

I'm definitely not done with this, but I though anyone using SWIG's
wrapped classes would like to see how the extensions are named.  (It
took some experimentation for me to figure it out).


-- 
Joe VanAndel  	          
National Center for Atmospheric Research
http://www.atd.ucar.edu/~vanandel/
Internet: vanandel@ucar.edu
--------------13C833499F5ECA2F221B74E6
Content-Type: text/plain; charset=us-ascii;
 name="setup.py"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="setup.py"

#!/usr/bin/env python

# setup script for building Python Environment for Radar Processing
# PERP extensions to Python



# To use:
#   * run this to build :
#       python setup.py build
#     or this to build and install it
#       python setup.py install

# created 01 Feb 2000 Joseph VanAndel

import os
from glob import glob
from distutils.command import install
from distutils.core import setup


# the locate of the RDSS source tree.
RDSS='/scr/canoe4/rdss'

# location of include files, based on RDSS
DDU_INC =  RDSS + '/spol/ddutils'
SPOL_INC = RDSS + '/spol/include'

#DDM_LIB =  RDSS + '/spol/ddutils/i386/libddm.a'
DDM_LIB =  RDSS + '/spol/ddutils/i386'

setup (name = "Perp",
       version = "0.2",
       maintainer = "Joseph VanAndel",
       maintainer_email = "vanandel@ucar.edu",
       description = "Python Environment for Radar Processing(PERP)",
#       cmdclass = {'install': Install},
       packages = ['','a1pp','rec','util'],
       install_path = 'Perp',
       include_dirs = ['./include',DDU_INC,SPOL_INC],
#       ext_package = 'Perp',
       ext_modules = [
                      ('a1pp.pulsepairc',
                       {'sources': ['a1pp/pulsepair.cc',
                                    'a1pp/pulsepair_wrap.cc'],
                       'libraries': ['gcc', 'stdc++','pthread']
                        },
                        ),
                      ('a1pp.IIR_Filterc',
                       {'sources': ['a1pp/IIR_Filter.cc',
                                    'a1pp/IIR_Filter_wrap.cc'],
                       'libraries': ['gcc', 'stdc++','pthread']
                        },
                        ),
                      ('rec.RadarFeaturec',
                       {'sources': ['rec/RadarFeature.cc',
                                    'rec/RadarFeature_wrap.cc'],
                       'libraries': ['gcc', 'stdc++','pthread']
                        },
                        ),
                      ('util.du_SweepUtilc',
                       {'sources': ['util/du_SweepUtil.cc',
                                    'util/du_SweepUtil_wrap.cc'],
                       'library_dirs': [DDM_LIB],
                       'libraries': ['ddm','gcc', 'stdc++','pthread'],
#                       'extra_preargs': [DDM_LIB]
                        },
                        ),
                ]
)

--------------13C833499F5ECA2F221B74E6--